🛟 Updated.
4724a07 parent: 8a8691c modified
.tickets/issues/0043-allow-to-run-an-agent-in-background.yaml +2 -2 | @@ -1,12 +1,12 @@ | ||
| 1 | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | 2 | id: 43 |
| 3 | 3 | title: Allow to run an agent in background |
| 4 | -state: open | |
| 4 | +state: closed | |
| 5 | 5 | author: |
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-10-30T05:41:00.096Z |
| 9 | -updatedAt: 2026-10-30T05:41:00.096Z | |
| 9 | +updatedAt: 2026-11-09T18:44:51.295Z | |
| 10 | 10 | labels: [] |
| 11 | 11 | epic: Agents |
| 12 | 12 | body: "" |
| @@ -1,12 +1,12 @@ | |||
| 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | id: 43 | 2 | id: 43 |
| 3 | title: Allow to run an agent in background | 3 | title: Allow to run an agent in background |
| 4 | -state: open | 4 | +state: closed |
| 5 | author: | 5 | author: |
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-10-30T05:41:00.096Z | 8 | createdAt: 2026-10-30T05:41:00.096Z |
| 9 | -updatedAt: 2026-10-30T05:41:00.096Z | 9 | +updatedAt: 2026-11-09T18:44:51.295Z |
| 10 | labels: [] | 10 | labels: [] |
| 11 | epic: Agents | 11 | epic: Agents |
| 12 | body: "" | 12 | body: "" |
added
agents/alice/Hello.txt +1 -0 | new file mode 100644 | ||
| @@ -0,0 +1 @@ | ||
| 1 | +this is a test | |
| new file mode 100644 | |||
| @@ -0,0 +1 @@ | |||
| 1 | +this is a test | ||
renamed
agents/alice/demo/toto.txt +0 -0 | similarity index 100% | ||
| rename from agents/snippets/claude-acp/workspace/notes/hello.txt | ||
| rename to agents/alice/demo/toto.txt |
| similarity index 100% | |||
| rename from agents/snippets/claude-acp/workspace/notes/hello.txt | |||
| rename to agents/alice/demo/toto.txt |
modified
agents/garfield/.mm/sessions/20261101-193546-499c6566.json +101 -1 | @@ -4,7 +4,7 @@ | ||
| 4 | 4 | "provider": "llmman", |
| 5 | 5 | "model": "hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M", |
| 6 | 6 | "createdAt": "2026-11-07T05:40:22.475613Z", |
| 7 | - "updatedAt": "2026-11-07T05:40:22.475645Z", | |
| 7 | + "updatedAt": "2026-11-08T18:34:40.484121Z", | |
| 8 | 8 | "messages": [ |
| 9 | 9 | { |
| 10 | 10 | "content": [ |
| @@ -13,6 +13,106 @@ | ||
| 13 | 13 | } |
| 14 | 14 | ], |
| 15 | 15 | "role": "system" |
| 16 | + }, | |
| 17 | + { | |
| 18 | + "content": [ | |
| 19 | + { | |
| 20 | + "text": "Oui, mais ça se résoud avec les sbx ai gov policies et des agents hooks et/ou des outils comme nemoguardrails" | |
| 21 | + } | |
| 22 | + ], | |
| 23 | + "role": "user" | |
| 24 | + }, | |
| 25 | + { | |
| 26 | + "content": [ | |
| 27 | + { | |
| 28 | + "toolRequest": { | |
| 29 | + "input": { | |
| 30 | + "name": "technical-text" | |
| 31 | + }, | |
| 32 | + "name": "read_skill", | |
| 33 | + "ref": "9Dc6qVpFKd9wXxR6xDGo361AWlezoiPe" | |
| 34 | + } | |
| 35 | + } | |
| 36 | + ], | |
| 37 | + "role": "model" | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "content": [ | |
| 41 | + { | |
| 42 | + "toolResponse": { | |
| 43 | + "name": "read_skill", | |
| 44 | + "output": "---\nname: technical-text\ndescription: Before translating a technical text — code, commands, Markdown, README, documentation, commit message, error message.\nkeywords: code, README, doc, documentation, commit, bug, API, terminal\n---\n\n# Translating a technical text\n\n- Inside `inline code` and ``` code blocks: translate nothing, except the comments.\n- Keep identifiers, flags, paths, versions, keys of a config file unchanged.\n- Keep Markdown exactly: `#` headings, `-` lists, `**bold**`, links `[text](url)` — translate the text, never the url.\n- Use the usual words of developers:\n\n | French | English |\n |---|---|\n | dépôt | repository |\n | branche, fusionner | branch, merge |\n | déployer, mise en production | deploy, release |\n | lancer, exécuter | run |\n | une fonctionnalité | a feature |\n | un correctif | a fix |\n | le journal | the log |\n | un fichier de configuration | a config file |\n\n- A commit message stays short and in the imperative: \"Corrige le calcul\" ↔ \"Fix the computation\".\n- \"bug\", \"commit\", \"push\", \"build\" stay as they are in French.\n", | |
| 45 | + "ref": "9Dc6qVpFKd9wXxR6xDGo361AWlezoiPe" | |
| 46 | + } | |
| 47 | + } | |
| 48 | + ], | |
| 49 | + "role": "tool" | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "content": [ | |
| 53 | + { | |
| 54 | + "text": "Yes, but it is resolved with sbx ai gov policies and agent hooks and/or tools like nemoguardrails." | |
| 55 | + } | |
| 56 | + ], | |
| 57 | + "role": "model" | |
| 58 | + }, | |
| 59 | + { | |
| 60 | + "content": [ | |
| 61 | + { | |
| 62 | + "text": "Traduit: Michael Douglas Just Threw Some Massive Shade At Cher's Oscar Win—And Fans Are Losing It" | |
| 63 | + } | |
| 64 | + ], | |
| 65 | + "role": "user" | |
| 66 | + }, | |
| 67 | + { | |
| 68 | + "content": [ | |
| 69 | + { | |
| 70 | + "toolRequest": { | |
| 71 | + "input": { | |
| 72 | + "name": "idioms" | |
| 73 | + }, | |
| 74 | + "name": "read_skill", | |
| 75 | + "ref": "UKV4WgQRzAzZa57aIL1kFq4YO7rylw06" | |
| 76 | + } | |
| 77 | + } | |
| 78 | + ], | |
| 79 | + "role": "model" | |
| 80 | + }, | |
| 81 | + { | |
| 82 | + "content": [ | |
| 83 | + { | |
| 84 | + "toolResponse": { | |
| 85 | + "name": "read_skill", | |
| 86 | + "output": "---\nname: idioms\ndescription: Before translating a text with an idiom, a proverb, a figurative expression or slang — and the false friends to avoid.\nkeywords: expression, idiome, proverbe, proverb, argot, slang, familier, figuré\n---\n\n# Idioms and false friends\n\nTranslate what the idiom means, with the other language's own idiom when it exists; never word for word.\n\n| French | English |\n|---|---|\n| tomber dans les pommes | to faint, to pass out |\n| il pleut des cordes | it's raining cats and dogs |\n| avoir le cafard | to feel down |\n| coûter les yeux de la tête | to cost an arm and a leg |\n| poser un lapin | to stand someone up |\n| ce n'est pas ma tasse de thé | it's not my cup of tea |\n| quand les poules auront des dents | when pigs fly |\n| en faire tout un fromage | to make a mountain out of a molehill |\n| les doigts dans le nez | with one hand tied behind my back, easily |\n| avoir un poil dans la main | to be bone idle |\n\nFalse friends — the left word does NOT mean the right one:\n\n| Word | Means | Not |\n|---|---|---|\n| actually | en fait | actuellement (= currently) |\n| eventually | finalement | éventuellement (= possibly) |\n| library | bibliothèque | librairie (= bookshop) |\n| sensible | raisonnable | sensible (= sensitive) |\n| to realize | se rendre compte | réaliser (= to carry out) |\n| to attend | assister à | attendre (= to wait) |\n| a coin | une pièce | un coin (= a corner) |\n", | |
| 87 | + "ref": "UKV4WgQRzAzZa57aIL1kFq4YO7rylw06" | |
| 88 | + } | |
| 89 | + } | |
| 90 | + ], | |
| 91 | + "role": "tool" | |
| 92 | + }, | |
| 93 | + { | |
| 94 | + "content": [ | |
| 95 | + { | |
| 96 | + "text": "Michael Douglas a jeté une ombre énorme sur la victoire de Cher aux Oscars — et les fans sont en délire." | |
| 97 | + } | |
| 98 | + ], | |
| 99 | + "role": "model" | |
| 100 | + }, | |
| 101 | + { | |
| 102 | + "content": [ | |
| 103 | + { | |
| 104 | + "text": "Traduire: oui d’où le 2ème article" | |
| 105 | + } | |
| 106 | + ], | |
| 107 | + "role": "user" | |
| 108 | + }, | |
| 109 | + { | |
| 110 | + "content": [ | |
| 111 | + { | |
| 112 | + "text": "Yes, hence the second article." | |
| 113 | + } | |
| 114 | + ], | |
| 115 | + "role": "model" | |
| 16 | 116 | } |
| 17 | 117 | ] |
| 18 | 118 | } |
| \ No newline at end of file | ||
| @@ -4,7 +4,7 @@ | |||
| 4 | "provider": "llmman", | 4 | "provider": "llmman", |
| 5 | "model": "hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M", | 5 | "model": "hf.co/unsloth/gemma-4-E4B-it-GGUF:Q4_K_M", |
| 6 | "createdAt": "2026-11-07T05:40:22.475613Z", | 6 | "createdAt": "2026-11-07T05:40:22.475613Z", |
| 7 | - "updatedAt": "2026-11-07T05:40:22.475645Z", | 7 | + "updatedAt": "2026-11-08T18:34:40.484121Z", |
| 8 | "messages": [ | 8 | "messages": [ |
| 9 | { | 9 | { |
| 10 | "content": [ | 10 | "content": [ |
| @@ -13,6 +13,106 @@ | |||
| 13 | } | 13 | } |
| 14 | ], | 14 | ], |
| 15 | "role": "system" | 15 | "role": "system" |
| 16 | + }, | ||
| 17 | + { | ||
| 18 | + "content": [ | ||
| 19 | + { | ||
| 20 | + "text": "Oui, mais ça se résoud avec les sbx ai gov policies et des agents hooks et/ou des outils comme nemoguardrails" | ||
| 21 | + } | ||
| 22 | + ], | ||
| 23 | + "role": "user" | ||
| 24 | + }, | ||
| 25 | + { | ||
| 26 | + "content": [ | ||
| 27 | + { | ||
| 28 | + "toolRequest": { | ||
| 29 | + "input": { | ||
| 30 | + "name": "technical-text" | ||
| 31 | + }, | ||
| 32 | + "name": "read_skill", | ||
| 33 | + "ref": "9Dc6qVpFKd9wXxR6xDGo361AWlezoiPe" | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + ], | ||
| 37 | + "role": "model" | ||
| 38 | + }, | ||
| 39 | + { | ||
| 40 | + "content": [ | ||
| 41 | + { | ||
| 42 | + "toolResponse": { | ||
| 43 | + "name": "read_skill", | ||
| 44 | + "output": "---\nname: technical-text\ndescription: Before translating a technical text — code, commands, Markdown, README, documentation, commit message, error message.\nkeywords: code, README, doc, documentation, commit, bug, API, terminal\n---\n\n# Translating a technical text\n\n- Inside `inline code` and ``` code blocks: translate nothing, except the comments.\n- Keep identifiers, flags, paths, versions, keys of a config file unchanged.\n- Keep Markdown exactly: `#` headings, `-` lists, `**bold**`, links `[text](url)` — translate the text, never the url.\n- Use the usual words of developers:\n\n | French | English |\n |---|---|\n | dépôt | repository |\n | branche, fusionner | branch, merge |\n | déployer, mise en production | deploy, release |\n | lancer, exécuter | run |\n | une fonctionnalité | a feature |\n | un correctif | a fix |\n | le journal | the log |\n | un fichier de configuration | a config file |\n\n- A commit message stays short and in the imperative: \"Corrige le calcul\" ↔ \"Fix the computation\".\n- \"bug\", \"commit\", \"push\", \"build\" stay as they are in French.\n", | ||
| 45 | + "ref": "9Dc6qVpFKd9wXxR6xDGo361AWlezoiPe" | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + ], | ||
| 49 | + "role": "tool" | ||
| 50 | + }, | ||
| 51 | + { | ||
| 52 | + "content": [ | ||
| 53 | + { | ||
| 54 | + "text": "Yes, but it is resolved with sbx ai gov policies and agent hooks and/or tools like nemoguardrails." | ||
| 55 | + } | ||
| 56 | + ], | ||
| 57 | + "role": "model" | ||
| 58 | + }, | ||
| 59 | + { | ||
| 60 | + "content": [ | ||
| 61 | + { | ||
| 62 | + "text": "Traduit: Michael Douglas Just Threw Some Massive Shade At Cher's Oscar Win—And Fans Are Losing It" | ||
| 63 | + } | ||
| 64 | + ], | ||
| 65 | + "role": "user" | ||
| 66 | + }, | ||
| 67 | + { | ||
| 68 | + "content": [ | ||
| 69 | + { | ||
| 70 | + "toolRequest": { | ||
| 71 | + "input": { | ||
| 72 | + "name": "idioms" | ||
| 73 | + }, | ||
| 74 | + "name": "read_skill", | ||
| 75 | + "ref": "UKV4WgQRzAzZa57aIL1kFq4YO7rylw06" | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + ], | ||
| 79 | + "role": "model" | ||
| 80 | + }, | ||
| 81 | + { | ||
| 82 | + "content": [ | ||
| 83 | + { | ||
| 84 | + "toolResponse": { | ||
| 85 | + "name": "read_skill", | ||
| 86 | + "output": "---\nname: idioms\ndescription: Before translating a text with an idiom, a proverb, a figurative expression or slang — and the false friends to avoid.\nkeywords: expression, idiome, proverbe, proverb, argot, slang, familier, figuré\n---\n\n# Idioms and false friends\n\nTranslate what the idiom means, with the other language's own idiom when it exists; never word for word.\n\n| French | English |\n|---|---|\n| tomber dans les pommes | to faint, to pass out |\n| il pleut des cordes | it's raining cats and dogs |\n| avoir le cafard | to feel down |\n| coûter les yeux de la tête | to cost an arm and a leg |\n| poser un lapin | to stand someone up |\n| ce n'est pas ma tasse de thé | it's not my cup of tea |\n| quand les poules auront des dents | when pigs fly |\n| en faire tout un fromage | to make a mountain out of a molehill |\n| les doigts dans le nez | with one hand tied behind my back, easily |\n| avoir un poil dans la main | to be bone idle |\n\nFalse friends — the left word does NOT mean the right one:\n\n| Word | Means | Not |\n|---|---|---|\n| actually | en fait | actuellement (= currently) |\n| eventually | finalement | éventuellement (= possibly) |\n| library | bibliothèque | librairie (= bookshop) |\n| sensible | raisonnable | sensible (= sensitive) |\n| to realize | se rendre compte | réaliser (= to carry out) |\n| to attend | assister à | attendre (= to wait) |\n| a coin | une pièce | un coin (= a corner) |\n", | ||
| 87 | + "ref": "UKV4WgQRzAzZa57aIL1kFq4YO7rylw06" | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | + ], | ||
| 91 | + "role": "tool" | ||
| 92 | + }, | ||
| 93 | + { | ||
| 94 | + "content": [ | ||
| 95 | + { | ||
| 96 | + "text": "Michael Douglas a jeté une ombre énorme sur la victoire de Cher aux Oscars — et les fans sont en délire." | ||
| 97 | + } | ||
| 98 | + ], | ||
| 99 | + "role": "model" | ||
| 100 | + }, | ||
| 101 | + { | ||
| 102 | + "content": [ | ||
| 103 | + { | ||
| 104 | + "text": "Traduire: oui d’où le 2ème article" | ||
| 105 | + } | ||
| 106 | + ], | ||
| 107 | + "role": "user" | ||
| 108 | + }, | ||
| 109 | + { | ||
| 110 | + "content": [ | ||
| 111 | + { | ||
| 112 | + "text": "Yes, hence the second article." | ||
| 113 | + } | ||
| 114 | + ], | ||
| 115 | + "role": "model" | ||
| 16 | } | 116 | } |
| 17 | ] | 117 | ] |
| 18 | } | 118 | } |
| \ No newline at end of file | \ No newline at end of file | ||
deleted
agents/ralph/kotlin.md +0 -220 | deleted file mode 100644 | ||
| @@ -1,220 +0,0 @@ | ||
| 1 | -# Getting Started in Kotlin | |
| 2 | - | |
| 3 | -## What is Kotlin? | |
| 4 | - | |
| 5 | -Kotlin is a modern statically-typed programming language for the JVM, Android, and browser development. It's designed to be fully interoperable with Java while providing additional features that make coding easier and more efficient. | |
| 6 | - | |
| 7 | -## Installation | |
| 8 | - | |
| 9 | -### Using SDKMAN! (Recommended) | |
| 10 | - | |
| 11 | -```bash | |
| 12 | -sdk install kotlin | |
| 13 | -``` | |
| 14 | - | |
| 15 | -### Using Homebrew | |
| 16 | - | |
| 17 | -```bash | |
| 18 | -brew install kotlin | |
| 19 | -``` | |
| 20 | - | |
| 21 | -### Manual Installation | |
| 22 | - | |
| 23 | -Download the latest Kotlin compiler from the official website and extract it: | |
| 24 | - | |
| 25 | -```bash | |
| 26 | -# Download Kotlin compiler | |
| 27 | -curl -O https://github.com/JetBrains/kotlin/releases/download/v1.9.0/kotlin-compiler-1.9.0.zip | |
| 28 | - | |
| 29 | -# Extract | |
| 30 | -unzip kotlin-compiler-1.9.0.zip | |
| 31 | - | |
| 32 | -# Add to PATH | |
| 33 | -export PATH="$PATH:$(pwd)/kotlinc" | |
| 34 | -``` | |
| 35 | - | |
| 36 | -## First Kotlin Program | |
| 37 | - | |
| 38 | -Create a file called `Hello.kt`: | |
| 39 | - | |
| 40 | -```kotlin | |
| 41 | -fun main() { | |
| 42 | - println("Hello, World!") | |
| 43 | -} | |
| 44 | -``` | |
| 45 | - | |
| 46 | -Compile and run it: | |
| 47 | - | |
| 48 | -```bash | |
| 49 | -kotlinc Hello.kt -include-runtime -d Hello.jar | |
| 50 | -java -jar Hello.jar | |
| 51 | -``` | |
| 52 | - | |
| 53 | -Expected output: | |
| 54 | -``` | |
| 55 | -Hello, World! | |
| 56 | -``` | |
| 57 | - | |
| 58 | -## Basic Syntax | |
| 59 | - | |
| 60 | -### Variables | |
| 61 | - | |
| 62 | -```kotlin | |
| 63 | -// Immutable variable | |
| 64 | -val name: String = "Kotlin" | |
| 65 | - | |
| 66 | -// Mutable variable | |
| 67 | -var age: Int = 25 | |
| 68 | -``` | |
| 69 | - | |
| 70 | -### Functions | |
| 71 | - | |
| 72 | -```kotlin | |
| 73 | -// Function with return type | |
| 74 | -fun greet(name: String): String { | |
| 75 | - return "Hello, $name!" | |
| 76 | -} | |
| 77 | - | |
| 78 | -// Function without return type (Unit) | |
| 79 | -fun printMessage() { | |
| 80 | - println("This function returns Unit") | |
| 81 | -} | |
| 82 | -``` | |
| 83 | - | |
| 84 | -### Control Structures | |
| 85 | - | |
| 86 | -```kotlin | |
| 87 | -// If expression | |
| 88 | -if (age >= 18) { | |
| 89 | - println("Adult") | |
| 90 | -} else { | |
| 91 | - println("Minor") | |
| 92 | -} | |
| 93 | - | |
| 94 | -// When expression (switch equivalent) | |
| 95 | -distinctUntilChanged = when (age) { | |
| 96 | - 0 -> "Zero" | |
| 97 | - in 1..12 -> "Child" | |
| 98 | - in 13..19 -> "Teenager" | |
| 99 | - else -> "Adult" | |
| 100 | -} | |
| 101 | -``` | |
| 102 | - | |
| 103 | -## Working with Collections | |
| 104 | - | |
| 105 | -### Lists | |
| 106 | - | |
| 107 | -```kotlin | |
| 108 | -val numbers = listOf(1, 2, 3, 4, 5) | |
| 109 | -val nameList = listOf("Alice", "Bob", "Charlie") | |
| 110 | - | |
| 111 | -// Access elements | |
| 112 | -val first = numbers[0] | |
| 113 | - | |
| 114 | -// Iterate | |
| 115 | -for (number in numbers) { | |
| 116 | - println(number) | |
| 117 | -} | |
| 118 | -``` | |
| 119 | - | |
| 120 | -### Maps | |
| 121 | - | |
| 122 | -```kotlin | |
| 123 | -val person = mapOf( | |
| 124 | - "name" to "John", | |
| 125 | - "age" to 30, | |
| 126 | - "city" to "New York" | |
| 127 | -) | |
| 128 | - | |
| 129 | -// Access values | |
| 130 | -val name = person["name"] | |
| 131 | -``` | |
| 132 | - | |
| 133 | -## Object-Oriented Programming | |
| 134 | - | |
| 135 | -### Classes | |
| 136 | - | |
| 137 | -```kotlin | |
| 138 | -class Person(val name: String, var age: Int) { | |
| 139 | - fun haveBirthday() { | |
| 140 | - age++ | |
| 141 | - } | |
| 142 | -} | |
| 143 | - | |
| 144 | -// Create instance | |
| 145 | -val person = Person("Alice", 25) | |
| 146 | -person.haveBirthday() | |
| 147 | -``` | |
| 148 | - | |
| 149 | -### Inheritance | |
| 150 | - | |
| 151 | -```kotlin | |
| 152 | -open class Animal { | |
| 153 | - open fun makeSound() { | |
| 154 | - println("Some sound") | |
| 155 | - } | |
| 156 | -} | |
| 157 | - | |
| 158 | -class Dog : Animal() { | |
| 159 | - override fun makeSound() { | |
| 160 | - println("Woof!") | |
| 161 | - } | |
| 162 | -} | |
| 163 | -``` | |
| 164 | - | |
| 165 | -## Null Safety | |
| 166 | - | |
| 167 | -```kotlin | |
| 168 | -// Nullable type | |
| 169 | -var name: String? = "Kotlin" | |
| 170 | - | |
| 171 | -// Safe call operator | |
| 172 | -if (name != null) { | |
| 173 | - println(name.length) | |
| 174 | -} | |
| 175 | - | |
| 176 | -// Elvis operator | |
| 177 | -val length = name?.length ?: 0 | |
| 178 | -``` | |
| 179 | - | |
| 180 | -## Extensions | |
| 181 | - | |
| 182 | -```kotlin | |
| 183 | -// Extension function | |
| 184 | -fun String.hey() { | |
| 185 | - println("Hey, $this!") | |
| 186 | -} | |
| 187 | - | |
| 188 | -// Usage | |
| 189 | -"Kotlin".hey() | |
| 190 | -``` | |
| 191 | - | |
| 192 | -## Coroutines (Asynchronous Programming) | |
| 193 | - | |
| 194 | -```kotlin | |
| 195 | -import kotlinx.coroutines.* | |
| 196 | - | |
| 197 | -// Simple coroutine | |
| 198 | -runBlocking { | |
| 199 | - launch { | |
| 200 | - delay(1000L) | |
| 201 | - println("World!") | |
| 202 | - } | |
| 203 | - println("Hello!") | |
| 204 | -} | |
| 205 | - | |
| 206 | -// Deferred (returns a result) | |
| 207 | -fun getData(): Deferred<String> = GlobalScope.async { | |
| 208 | - delay(1000L) | |
| 209 | - "Data" | |
| 210 | -} | |
| 211 | - | |
| 212 | -// Usage | |
| 213 | -val result = getData().await() | |
| 214 | -``` | |
| 215 | - | |
| 216 | -## Resources | |
| 217 | - | |
| 218 | -- [Official Kotlin Documentation](https://kotlinlang.org/docs/home.html) | |
| 219 | -- [Kotlin Playground](https://play.kotlinlang.org/) | |
| 220 | -- [Kotlin Koans](https://kotlinlang.org/docs/tutorials/koans.html) | |
| deleted file mode 100644 | |||
| @@ -1,220 +0,0 @@ | |||
| 1 | -# Getting Started in Kotlin | ||
| 2 | - | ||
| 3 | -## What is Kotlin? | ||
| 4 | - | ||
| 5 | -Kotlin is a modern statically-typed programming language for the JVM, Android, and browser development. It's designed to be fully interoperable with Java while providing additional features that make coding easier and more efficient. | ||
| 6 | - | ||
| 7 | -## Installation | ||
| 8 | - | ||
| 9 | -### Using SDKMAN! (Recommended) | ||
| 10 | - | ||
| 11 | -```bash | ||
| 12 | -sdk install kotlin | ||
| 13 | -``` | ||
| 14 | - | ||
| 15 | -### Using Homebrew | ||
| 16 | - | ||
| 17 | -```bash | ||
| 18 | -brew install kotlin | ||
| 19 | -``` | ||
| 20 | - | ||
| 21 | -### Manual Installation | ||
| 22 | - | ||
| 23 | -Download the latest Kotlin compiler from the official website and extract it: | ||
| 24 | - | ||
| 25 | -```bash | ||
| 26 | -# Download Kotlin compiler | ||
| 27 | -curl -O https://github.com/JetBrains/kotlin/releases/download/v1.9.0/kotlin-compiler-1.9.0.zip | ||
| 28 | - | ||
| 29 | -# Extract | ||
| 30 | -unzip kotlin-compiler-1.9.0.zip | ||
| 31 | - | ||
| 32 | -# Add to PATH | ||
| 33 | -export PATH="$PATH:$(pwd)/kotlinc" | ||
| 34 | -``` | ||
| 35 | - | ||
| 36 | -## First Kotlin Program | ||
| 37 | - | ||
| 38 | -Create a file called `Hello.kt`: | ||
| 39 | - | ||
| 40 | -```kotlin | ||
| 41 | -fun main() { | ||
| 42 | - println("Hello, World!") | ||
| 43 | -} | ||
| 44 | -``` | ||
| 45 | - | ||
| 46 | -Compile and run it: | ||
| 47 | - | ||
| 48 | -```bash | ||
| 49 | -kotlinc Hello.kt -include-runtime -d Hello.jar | ||
| 50 | -java -jar Hello.jar | ||
| 51 | -``` | ||
| 52 | - | ||
| 53 | -Expected output: | ||
| 54 | -``` | ||
| 55 | -Hello, World! | ||
| 56 | -``` | ||
| 57 | - | ||
| 58 | -## Basic Syntax | ||
| 59 | - | ||
| 60 | -### Variables | ||
| 61 | - | ||
| 62 | -```kotlin | ||
| 63 | -// Immutable variable | ||
| 64 | -val name: String = "Kotlin" | ||
| 65 | - | ||
| 66 | -// Mutable variable | ||
| 67 | -var age: Int = 25 | ||
| 68 | -``` | ||
| 69 | - | ||
| 70 | -### Functions | ||
| 71 | - | ||
| 72 | -```kotlin | ||
| 73 | -// Function with return type | ||
| 74 | -fun greet(name: String): String { | ||
| 75 | - return "Hello, $name!" | ||
| 76 | -} | ||
| 77 | - | ||
| 78 | -// Function without return type (Unit) | ||
| 79 | -fun printMessage() { | ||
| 80 | - println("This function returns Unit") | ||
| 81 | -} | ||
| 82 | -``` | ||
| 83 | - | ||
| 84 | -### Control Structures | ||
| 85 | - | ||
| 86 | -```kotlin | ||
| 87 | -// If expression | ||
| 88 | -if (age >= 18) { | ||
| 89 | - println("Adult") | ||
| 90 | -} else { | ||
| 91 | - println("Minor") | ||
| 92 | -} | ||
| 93 | - | ||
| 94 | -// When expression (switch equivalent) | ||
| 95 | -distinctUntilChanged = when (age) { | ||
| 96 | - 0 -> "Zero" | ||
| 97 | - in 1..12 -> "Child" | ||
| 98 | - in 13..19 -> "Teenager" | ||
| 99 | - else -> "Adult" | ||
| 100 | -} | ||
| 101 | -``` | ||
| 102 | - | ||
| 103 | -## Working with Collections | ||
| 104 | - | ||
| 105 | -### Lists | ||
| 106 | - | ||
| 107 | -```kotlin | ||
| 108 | -val numbers = listOf(1, 2, 3, 4, 5) | ||
| 109 | -val nameList = listOf("Alice", "Bob", "Charlie") | ||
| 110 | - | ||
| 111 | -// Access elements | ||
| 112 | -val first = numbers[0] | ||
| 113 | - | ||
| 114 | -// Iterate | ||
| 115 | -for (number in numbers) { | ||
| 116 | - println(number) | ||
| 117 | -} | ||
| 118 | -``` | ||
| 119 | - | ||
| 120 | -### Maps | ||
| 121 | - | ||
| 122 | -```kotlin | ||
| 123 | -val person = mapOf( | ||
| 124 | - "name" to "John", | ||
| 125 | - "age" to 30, | ||
| 126 | - "city" to "New York" | ||
| 127 | -) | ||
| 128 | - | ||
| 129 | -// Access values | ||
| 130 | -val name = person["name"] | ||
| 131 | -``` | ||
| 132 | - | ||
| 133 | -## Object-Oriented Programming | ||
| 134 | - | ||
| 135 | -### Classes | ||
| 136 | - | ||
| 137 | -```kotlin | ||
| 138 | -class Person(val name: String, var age: Int) { | ||
| 139 | - fun haveBirthday() { | ||
| 140 | - age++ | ||
| 141 | - } | ||
| 142 | -} | ||
| 143 | - | ||
| 144 | -// Create instance | ||
| 145 | -val person = Person("Alice", 25) | ||
| 146 | -person.haveBirthday() | ||
| 147 | -``` | ||
| 148 | - | ||
| 149 | -### Inheritance | ||
| 150 | - | ||
| 151 | -```kotlin | ||
| 152 | -open class Animal { | ||
| 153 | - open fun makeSound() { | ||
| 154 | - println("Some sound") | ||
| 155 | - } | ||
| 156 | -} | ||
| 157 | - | ||
| 158 | -class Dog : Animal() { | ||
| 159 | - override fun makeSound() { | ||
| 160 | - println("Woof!") | ||
| 161 | - } | ||
| 162 | -} | ||
| 163 | -``` | ||
| 164 | - | ||
| 165 | -## Null Safety | ||
| 166 | - | ||
| 167 | -```kotlin | ||
| 168 | -// Nullable type | ||
| 169 | -var name: String? = "Kotlin" | ||
| 170 | - | ||
| 171 | -// Safe call operator | ||
| 172 | -if (name != null) { | ||
| 173 | - println(name.length) | ||
| 174 | -} | ||
| 175 | - | ||
| 176 | -// Elvis operator | ||
| 177 | -val length = name?.length ?: 0 | ||
| 178 | -``` | ||
| 179 | - | ||
| 180 | -## Extensions | ||
| 181 | - | ||
| 182 | -```kotlin | ||
| 183 | -// Extension function | ||
| 184 | -fun String.hey() { | ||
| 185 | - println("Hey, $this!") | ||
| 186 | -} | ||
| 187 | - | ||
| 188 | -// Usage | ||
| 189 | -"Kotlin".hey() | ||
| 190 | -``` | ||
| 191 | - | ||
| 192 | -## Coroutines (Asynchronous Programming) | ||
| 193 | - | ||
| 194 | -```kotlin | ||
| 195 | -import kotlinx.coroutines.* | ||
| 196 | - | ||
| 197 | -// Simple coroutine | ||
| 198 | -runBlocking { | ||
| 199 | - launch { | ||
| 200 | - delay(1000L) | ||
| 201 | - println("World!") | ||
| 202 | - } | ||
| 203 | - println("Hello!") | ||
| 204 | -} | ||
| 205 | - | ||
| 206 | -// Deferred (returns a result) | ||
| 207 | -fun getData(): Deferred<String> = GlobalScope.async { | ||
| 208 | - delay(1000L) | ||
| 209 | - "Data" | ||
| 210 | -} | ||
| 211 | - | ||
| 212 | -// Usage | ||
| 213 | -val result = getData().await() | ||
| 214 | -``` | ||
| 215 | - | ||
| 216 | -## Resources | ||
| 217 | - | ||
| 218 | -- [Official Kotlin Documentation](https://kotlinlang.org/docs/home.html) | ||
| 219 | -- [Kotlin Playground](https://play.kotlinlang.org/) | ||
| 220 | -- [Kotlin Koans](https://kotlinlang.org/docs/tutorials/koans.html) | ||
added
agents/snippets/claude-acp/workspace/hello.txt +1 -0 | new file mode 100644 | ||
| @@ -0,0 +1 @@ | ||
| 1 | +this a test with claude-acp | |
| \ No newline at end of file | ||
| new file mode 100644 | |||
| @@ -0,0 +1 @@ | |||
| 1 | +this a test with claude-acp | ||
| \ No newline at end of file | \ No newline at end of file | ||