joonecli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/__tests__/optimizations.test.js.map +1 -1
- package/dist/__tests__/promptBuilder.test.js +14 -20
- package/dist/__tests__/promptBuilder.test.js.map +1 -1
- package/dist/agents/agentRegistry.d.ts +37 -0
- package/dist/agents/agentRegistry.js +58 -0
- package/dist/agents/agentRegistry.js.map +1 -0
- package/dist/agents/agentSpec.d.ts +54 -0
- package/dist/agents/agentSpec.js +9 -0
- package/dist/agents/agentSpec.js.map +1 -0
- package/dist/agents/builtinAgents.d.ts +20 -0
- package/dist/agents/builtinAgents.js +125 -0
- package/dist/agents/builtinAgents.js.map +1 -0
- package/dist/cli/config.d.ts +4 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/index.js +25 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/postinstall.d.ts +2 -0
- package/dist/cli/postinstall.js +25 -0
- package/dist/cli/postinstall.js.map +1 -0
- package/dist/commands/builtinCommands.d.ts +21 -0
- package/dist/commands/builtinCommands.js +241 -0
- package/dist/commands/builtinCommands.js.map +1 -0
- package/dist/commands/commandRegistry.d.ts +90 -0
- package/dist/commands/commandRegistry.js +128 -0
- package/dist/commands/commandRegistry.js.map +1 -0
- package/dist/core/agentLoop.d.ts +4 -1
- package/dist/core/agentLoop.js +21 -9
- package/dist/core/agentLoop.js.map +1 -1
- package/dist/core/autoSave.d.ts +41 -0
- package/dist/core/autoSave.js +69 -0
- package/dist/core/autoSave.js.map +1 -0
- package/dist/core/compactor.d.ts +66 -0
- package/dist/core/compactor.js +170 -0
- package/dist/core/compactor.js.map +1 -0
- package/dist/core/contextGuard.d.ts +33 -0
- package/dist/core/contextGuard.js +95 -0
- package/dist/core/contextGuard.js.map +1 -0
- package/dist/core/promptBuilder.d.ts +16 -1
- package/dist/core/promptBuilder.js +27 -14
- package/dist/core/promptBuilder.js.map +1 -1
- package/dist/core/sessionResumer.js +3 -3
- package/dist/core/sessionResumer.js.map +1 -1
- package/dist/core/subAgent.d.ts +56 -0
- package/dist/core/subAgent.js +240 -0
- package/dist/core/subAgent.js.map +1 -0
- package/dist/debug_google.d.ts +1 -0
- package/dist/debug_google.js +23 -0
- package/dist/debug_google.js.map +1 -0
- package/dist/test_google.d.ts +1 -0
- package/dist/test_google.js +32 -89
- package/dist/test_google.js.map +1 -0
- package/dist/tools/router.js +2 -0
- package/dist/tools/router.js.map +1 -1
- package/dist/tools/spawnAgent.d.ts +19 -0
- package/dist/tools/spawnAgent.js +130 -0
- package/dist/tools/spawnAgent.js.map +1 -0
- package/dist/ui/App.js +88 -5
- package/dist/ui/App.js.map +1 -1
- package/package.json +3 -2
- package/src/cli/index.ts +12 -0
- package/src/cli/postinstall.ts +28 -0
- package/src/core/compactor.ts +2 -2
- package/src/core/contextGuard.ts +4 -4
- package/src/core/sessionStore.ts +2 -1
- package/src/core/subAgent.ts +2 -2
- package/tests/core/sessionStore.test.ts +2 -2
- package/src/test_google.js +0 -40
- package/src/test_google.ts +0 -40
package/README.md
CHANGED
|
@@ -26,36 +26,36 @@
|
|
|
26
26
|
|
|
27
27
|
## 🚀 Getting Started
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
## 🚀 Quickstart
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
The fastest way to experience Joone is to run it on-demand without installing anything globally. This will automatically trigger the onboarding wizard and launch your first session seamlessly:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
|
|
34
|
+
npx joone@latest start
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
###
|
|
37
|
+
### Global Installation (Alternative)
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
If you prefer to install Joone globally:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
joone
|
|
42
|
+
npm install -g joone
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Once installed, simply run `joone` in any directory. If it's your first time, the configuration wizard will open automatically.
|
|
46
46
|
|
|
47
|
-
###
|
|
47
|
+
### Configuration
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
If you ever need to change your LLM provider, API keys, or models, run the configuration wizard:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
joone
|
|
52
|
+
joone config
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
To start an autonomous session in your current project directory:
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
|
|
58
|
+
joone start
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### Uninstallation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimizations.test.js","sourceRoot":"","sources":["../../src/__tests__/optimizations.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAiB,MAAM,0BAA0B,CAAC;AAClF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EACL,eAAe,EACf,cAAc,GACf,MAAM,4BAA4B,CAAC;AAEpC,kFAAkF;AAClF,6BAA6B;AAC7B,kFAAkF;AAElF,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,gEAAgE;IAEhE,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,CAAC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,IAAI,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;QAErE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -15,16 +15,14 @@ describe("CacheOptimizedPromptBuilder", () => {
|
|
|
15
15
|
conversationHistory: [],
|
|
16
16
|
};
|
|
17
17
|
const messages = builder.buildPrompt(state);
|
|
18
|
-
//
|
|
19
|
-
expect(messages).toHaveLength(
|
|
20
|
-
//
|
|
18
|
+
// exactly 1 static message when history is empty
|
|
19
|
+
expect(messages).toHaveLength(1);
|
|
20
|
+
// must be system-type message
|
|
21
21
|
expect(messages[0]._getType()).toBe("system");
|
|
22
|
-
expect(messages[1]._getType()).toBe("system");
|
|
23
|
-
expect(messages[2]._getType()).toBe("system");
|
|
24
22
|
// Order must be: global → project → session
|
|
25
23
|
expect(messages[0].content).toContain("You are a coding assistant.");
|
|
26
|
-
expect(messages[
|
|
27
|
-
expect(messages[
|
|
24
|
+
expect(messages[0].content).toContain("Use TypeScript.");
|
|
25
|
+
expect(messages[0].content).toContain("OS: Windows");
|
|
28
26
|
});
|
|
29
27
|
// ─── Behavior 2: Conversation history appended AFTER the static prefix ───
|
|
30
28
|
// Dynamic messages must never appear before the static prefix.
|
|
@@ -40,17 +38,15 @@ describe("CacheOptimizedPromptBuilder", () => {
|
|
|
40
38
|
],
|
|
41
39
|
};
|
|
42
40
|
const messages = builder.buildPrompt(state);
|
|
43
|
-
//
|
|
44
|
-
expect(messages).toHaveLength(
|
|
45
|
-
// First
|
|
41
|
+
// 1 static + 2 conversation = 3
|
|
42
|
+
expect(messages).toHaveLength(3);
|
|
43
|
+
// First is system messages (static prefix)
|
|
46
44
|
expect(messages[0]._getType()).toBe("system");
|
|
47
|
-
expect(messages[1]._getType()).toBe("system");
|
|
48
|
-
expect(messages[2]._getType()).toBe("system");
|
|
49
45
|
// Last 2 are conversation messages
|
|
50
|
-
expect(messages[
|
|
51
|
-
expect(messages[
|
|
52
|
-
expect(messages[
|
|
53
|
-
expect(messages[
|
|
46
|
+
expect(messages[1]._getType()).toBe("human");
|
|
47
|
+
expect(messages[2]._getType()).toBe("ai");
|
|
48
|
+
expect(messages[1].content).toBe("Hello");
|
|
49
|
+
expect(messages[2].content).toBe("Hi there!");
|
|
54
50
|
});
|
|
55
51
|
// ─── Behavior 3: Static prefix is identical across calls ───
|
|
56
52
|
// If we call buildPrompt twice with the same state (but more history),
|
|
@@ -68,10 +64,8 @@ describe("CacheOptimizedPromptBuilder", () => {
|
|
|
68
64
|
state.conversationHistory.push(new HumanMessage("What is 2+2?"));
|
|
69
65
|
state.conversationHistory.push(new AIMessage("4"));
|
|
70
66
|
const secondCall = builder.buildPrompt(state);
|
|
71
|
-
// Static prefix (first
|
|
67
|
+
// Static prefix (first message) must be identical
|
|
72
68
|
expect(secondCall[0].content).toBe(firstCall[0].content);
|
|
73
|
-
expect(secondCall[1].content).toBe(firstCall[1].content);
|
|
74
|
-
expect(secondCall[2].content).toBe(firstCall[2].content);
|
|
75
69
|
});
|
|
76
70
|
// ─── Behavior 4: System reminder is injected as a HumanMessage ───
|
|
77
71
|
it("injects a system reminder as a HumanMessage with <system-reminder> tags", () => {
|
|
@@ -99,7 +93,7 @@ describe("CacheOptimizedPromptBuilder", () => {
|
|
|
99
93
|
const compacted = builder.compactHistory(longHistory, "Completed steps 1 and 2.");
|
|
100
94
|
// Default keepLastN=6, history has 4 → summary + all 4 preserved
|
|
101
95
|
expect(compacted).toHaveLength(5);
|
|
102
|
-
expect(compacted[0]._getType()).toBe("
|
|
96
|
+
expect(compacted[0]._getType()).toBe("human");
|
|
103
97
|
expect(compacted[0].content).toContain("Completed steps 1 and 2.");
|
|
104
98
|
// Recent messages are preserved after the summary
|
|
105
99
|
expect(compacted[1].content).toBe("Step 1");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptBuilder.test.js","sourceRoot":"","sources":["../../src/__tests__/promptBuilder.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,2BAA2B,GAE5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,YAAY,EACZ,SAAS,GACV,MAAM,0BAA0B,CAAC;AAElC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,6CAA6C;IAC7C,kEAAkE;IAClE,2DAA2D;IAC3D,mDAAmD;IAEnD,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QACpF,MAAM,OAAO,GAAG,IAAI,2BAA2B,EAAE,CAAC;QAClD,MAAM,KAAK,GAAiB;YAC1B,wBAAwB,EAAE,6BAA6B;YACvD,aAAa,EAAE,iBAAiB;YAChC,cAAc,EAAE,aAAa;YAC7B,mBAAmB,EAAE,EAAE;SACxB,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE5C,
|
|
1
|
+
{"version":3,"file":"promptBuilder.test.js","sourceRoot":"","sources":["../../src/__tests__/promptBuilder.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,2BAA2B,GAE5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,YAAY,EACZ,SAAS,GACV,MAAM,0BAA0B,CAAC;AAElC,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,6CAA6C;IAC7C,kEAAkE;IAClE,2DAA2D;IAC3D,mDAAm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B,IAAI,YAAY,CAAC,QAAQ,CAAC;YAC1B,IAAI,SAAS,CAAC,QAAQ,CAAC;YACvB,IAAI,YAAY,CAAC,QAAQ,CAAC;YAC1B,IAAI,SAAS,CAAC,QAAQ,CAAC;SACxB,CAAC;QAEF,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,CACtC,WAAW,EACX,0BAA0B,CAC3B,CAAC;QAEF,iEAAiE;QACjE,MAAM,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9C,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC;QACnE,kDAAkD;QAClD,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry for named sub-agents. The registry enables:
|
|
5
|
+
* - Decoupled agent development (add agents without touching the main loop)
|
|
6
|
+
* - Prompt injection (registry summary included in the main agent's system prompt)
|
|
7
|
+
* - Lookup by name for the spawn_agent tool
|
|
8
|
+
*/
|
|
9
|
+
import { AgentSpec } from "./agentSpec.js";
|
|
10
|
+
export declare class AgentRegistry {
|
|
11
|
+
private agents;
|
|
12
|
+
/**
|
|
13
|
+
* Register a new agent spec. Overwrites if name already exists.
|
|
14
|
+
*/
|
|
15
|
+
register(spec: AgentSpec): void;
|
|
16
|
+
/**
|
|
17
|
+
* Look up an agent by name.
|
|
18
|
+
*/
|
|
19
|
+
get(name: string): AgentSpec | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Returns all registered agent specs.
|
|
22
|
+
*/
|
|
23
|
+
getAll(): AgentSpec[];
|
|
24
|
+
/**
|
|
25
|
+
* Returns all registered agent names.
|
|
26
|
+
*/
|
|
27
|
+
getNames(): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if an agent with the given name exists.
|
|
30
|
+
*/
|
|
31
|
+
has(name: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Generates a summary of all available agents, formatted for injection
|
|
34
|
+
* into the main agent's system prompt.
|
|
35
|
+
*/
|
|
36
|
+
getSummary(): string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry for named sub-agents. The registry enables:
|
|
5
|
+
* - Decoupled agent development (add agents without touching the main loop)
|
|
6
|
+
* - Prompt injection (registry summary included in the main agent's system prompt)
|
|
7
|
+
* - Lookup by name for the spawn_agent tool
|
|
8
|
+
*/
|
|
9
|
+
export class AgentRegistry {
|
|
10
|
+
agents = new Map();
|
|
11
|
+
/**
|
|
12
|
+
* Register a new agent spec. Overwrites if name already exists.
|
|
13
|
+
*/
|
|
14
|
+
register(spec) {
|
|
15
|
+
this.agents.set(spec.name, spec);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Look up an agent by name.
|
|
19
|
+
*/
|
|
20
|
+
get(name) {
|
|
21
|
+
return this.agents.get(name);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns all registered agent specs.
|
|
25
|
+
*/
|
|
26
|
+
getAll() {
|
|
27
|
+
return Array.from(this.agents.values());
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns all registered agent names.
|
|
31
|
+
*/
|
|
32
|
+
getNames() {
|
|
33
|
+
return Array.from(this.agents.keys());
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns true if an agent with the given name exists.
|
|
37
|
+
*/
|
|
38
|
+
has(name) {
|
|
39
|
+
return this.agents.has(name);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generates a summary of all available agents, formatted for injection
|
|
43
|
+
* into the main agent's system prompt.
|
|
44
|
+
*/
|
|
45
|
+
getSummary() {
|
|
46
|
+
if (this.agents.size === 0) {
|
|
47
|
+
return "No sub-agents are currently registered.";
|
|
48
|
+
}
|
|
49
|
+
const lines = ["Available sub-agents (use spawn_agent tool to invoke):\n"];
|
|
50
|
+
for (const spec of this.agents.values()) {
|
|
51
|
+
const tools = spec.tools ? ` [tools: ${spec.tools.join(", ")}]` : " [all tools]";
|
|
52
|
+
const turns = spec.maxTurns ?? 10;
|
|
53
|
+
lines.push(` • ${spec.name}: ${spec.description}${tools} (max ${turns} turns)`);
|
|
54
|
+
}
|
|
55
|
+
return lines.join("\n");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=agentRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentRegistry.js","sourceRoot":"","sources":["../../src/agents/agentRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,OAAO,aAAa;IAChB,MAAM,GAA2B,IAAI,GAAG,EAAE,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,IAAe;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,yCAAyC,CAAC;QACnD,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,0DAA0D,CAAC,CAAC;QAE3E,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;YACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC;YACjF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,GAAG,KAAK,SAAS,KAAK,SAAS,CAAC,CAAC;QACnF,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Specification
|
|
3
|
+
*
|
|
4
|
+
* Defines the shape of a sub-agent: its identity, capabilities, constraints,
|
|
5
|
+
* and tools. This enables decoupled agent development — new agents can be
|
|
6
|
+
* added to the registry without modifying the main agent or harness.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Describes a named sub-agent with a purpose-tuned configuration.
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentSpec {
|
|
12
|
+
/** Unique name (e.g., "script_runner", "code_reviewer"). */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Human-readable description included in the main agent's prompt. */
|
|
15
|
+
description: string;
|
|
16
|
+
/** Dedicated system prompt for this sub-agent. */
|
|
17
|
+
systemPrompt: string;
|
|
18
|
+
/** Restrict to specific tool names. If omitted, all main-agent tools are available. */
|
|
19
|
+
tools?: string[];
|
|
20
|
+
/** Maximum turns before the sub-agent is forcibly stopped (doom-loop protection). Default: 10. */
|
|
21
|
+
maxTurns?: number;
|
|
22
|
+
/** Override model for this agent (default: FAST_MODEL_DEFAULTS from same provider). */
|
|
23
|
+
model?: string;
|
|
24
|
+
/** Permission behavior for this agent. */
|
|
25
|
+
permissionMode?: "auto" | "ask_all";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Structured result returned by a sub-agent after completing (or failing) a task.
|
|
29
|
+
* Only this result is injected into the main agent's history — the sub-agent's
|
|
30
|
+
* full conversation is discarded to save context.
|
|
31
|
+
*/
|
|
32
|
+
export interface SubAgentResult {
|
|
33
|
+
/** The agent name from AgentSpec. */
|
|
34
|
+
agentName: string;
|
|
35
|
+
/** The original task description. */
|
|
36
|
+
taskDescription: string;
|
|
37
|
+
/** Outcome status. */
|
|
38
|
+
outcome: "success" | "failure" | "partial";
|
|
39
|
+
/** The final text output from the sub-agent. */
|
|
40
|
+
result: string;
|
|
41
|
+
/** Files created, modified, or deleted during the sub-task. */
|
|
42
|
+
filesModified: string[];
|
|
43
|
+
/** Total tool calls executed. */
|
|
44
|
+
toolCallCount: number;
|
|
45
|
+
/** Approximate token usage. */
|
|
46
|
+
tokenUsage: {
|
|
47
|
+
prompt: number;
|
|
48
|
+
completion: number;
|
|
49
|
+
};
|
|
50
|
+
/** Wall-clock duration in milliseconds. */
|
|
51
|
+
duration: number;
|
|
52
|
+
/** Number of turns the sub-agent ran. */
|
|
53
|
+
turnsUsed: number;
|
|
54
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Specification
|
|
3
|
+
*
|
|
4
|
+
* Defines the shape of a sub-agent: its identity, capabilities, constraints,
|
|
5
|
+
* and tools. This enables decoupled agent development — new agents can be
|
|
6
|
+
* added to the registry without modifying the main agent or harness.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=agentSpec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentSpec.js","sourceRoot":"","sources":["../../src/agents/agentSpec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Agent Specs
|
|
3
|
+
*
|
|
4
|
+
* Pre-configured sub-agents for common coding tasks. Each agent has a
|
|
5
|
+
* purpose-tuned system prompt and restricted tool access. This enables
|
|
6
|
+
* decoupled agent development — new agents are added here without
|
|
7
|
+
* touching the main agent or harness.
|
|
8
|
+
*/
|
|
9
|
+
import { AgentSpec } from "./agentSpec.js";
|
|
10
|
+
import { AgentRegistry } from "./agentRegistry.js";
|
|
11
|
+
export declare const ScriptRunnerAgent: AgentSpec;
|
|
12
|
+
export declare const CodeReviewerAgent: AgentSpec;
|
|
13
|
+
export declare const TestRunnerAgent: AgentSpec;
|
|
14
|
+
export declare const FileAnalystAgent: AgentSpec;
|
|
15
|
+
export declare const SecurityAuditorAgent: AgentSpec;
|
|
16
|
+
export declare const BrowserAgent: AgentSpec;
|
|
17
|
+
/**
|
|
18
|
+
* Creates an AgentRegistry pre-loaded with all built-in agents.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createDefaultAgentRegistry(): AgentRegistry;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Agent Specs
|
|
3
|
+
*
|
|
4
|
+
* Pre-configured sub-agents for common coding tasks. Each agent has a
|
|
5
|
+
* purpose-tuned system prompt and restricted tool access. This enables
|
|
6
|
+
* decoupled agent development — new agents are added here without
|
|
7
|
+
* touching the main agent or harness.
|
|
8
|
+
*/
|
|
9
|
+
import { AgentRegistry } from "./agentRegistry.js";
|
|
10
|
+
// ─── Script Runner ──────────────────────────────────────────────────────────────
|
|
11
|
+
export const ScriptRunnerAgent = {
|
|
12
|
+
name: "script_runner",
|
|
13
|
+
description: "Execute and test scripts, return stdout/stderr and exit codes",
|
|
14
|
+
systemPrompt: `You are a script execution agent. Your task is to run scripts and commands, capturing their output.
|
|
15
|
+
|
|
16
|
+
Rules:
|
|
17
|
+
- Run the commands/scripts as specified in the task
|
|
18
|
+
- Capture ALL stdout and stderr output
|
|
19
|
+
- Report the exit code
|
|
20
|
+
- If the script fails, analyze the error and report the likely cause
|
|
21
|
+
- Do NOT modify any files unless explicitly asked
|
|
22
|
+
- Summarize the results clearly at the end`,
|
|
23
|
+
tools: ["bash", "read_file"],
|
|
24
|
+
maxTurns: 8,
|
|
25
|
+
permissionMode: "auto",
|
|
26
|
+
};
|
|
27
|
+
// ─── Code Reviewer ──────────────────────────────────────────────────────────────
|
|
28
|
+
export const CodeReviewerAgent = {
|
|
29
|
+
name: "code_reviewer",
|
|
30
|
+
description: "Review code changes and suggest improvements",
|
|
31
|
+
systemPrompt: `You are a code review agent. Your task is to analyze code files and provide quality feedback.
|
|
32
|
+
|
|
33
|
+
Rules:
|
|
34
|
+
- Read the specified files and analyze them
|
|
35
|
+
- Look for: bugs, security issues, code smells, missing error handling, performance issues
|
|
36
|
+
- Check style consistency and naming conventions
|
|
37
|
+
- Provide specific, actionable suggestions with line numbers
|
|
38
|
+
- Rate overall quality: 1-5 stars
|
|
39
|
+
- Be constructive and specific — avoid vague feedback`,
|
|
40
|
+
tools: ["read_file", "bash"],
|
|
41
|
+
maxTurns: 6,
|
|
42
|
+
permissionMode: "auto",
|
|
43
|
+
};
|
|
44
|
+
// ─── Test Runner ────────────────────────────────────────────────────────────────
|
|
45
|
+
export const TestRunnerAgent = {
|
|
46
|
+
name: "test_runner",
|
|
47
|
+
description: "Run test suites, diagnose failures, and suggest fixes",
|
|
48
|
+
systemPrompt: `You are a test execution agent. Your task is to run tests and analyze the results.
|
|
49
|
+
|
|
50
|
+
Rules:
|
|
51
|
+
- Execute the specified test command(s)
|
|
52
|
+
- Parse test output to identify passing, failing, and skipped tests
|
|
53
|
+
- For failures: read the relevant source files to diagnose the cause
|
|
54
|
+
- Suggest specific fixes for failing tests
|
|
55
|
+
- Report: total passes, failures, skips, and coverage if available
|
|
56
|
+
- If asked to fix tests, you may write corrected test files`,
|
|
57
|
+
tools: ["bash", "read_file", "write_file"],
|
|
58
|
+
maxTurns: 10,
|
|
59
|
+
permissionMode: "auto",
|
|
60
|
+
};
|
|
61
|
+
// ─── File Analyst ───────────────────────────────────────────────────────────────
|
|
62
|
+
export const FileAnalystAgent = {
|
|
63
|
+
name: "file_analyst",
|
|
64
|
+
description: "Analyze project structure, find patterns, count metrics",
|
|
65
|
+
systemPrompt: `You are a file analysis agent. Your task is to analyze the project structure and report findings.
|
|
66
|
+
|
|
67
|
+
Rules:
|
|
68
|
+
- Use bash commands (find, grep, wc, etc.) to analyze the project
|
|
69
|
+
- Report: file counts by type, line counts, directory structure
|
|
70
|
+
- Identify patterns: naming conventions, common imports, dependency usage
|
|
71
|
+
- Highlight anything unusual or noteworthy
|
|
72
|
+
- Present results in a clear, structured format`,
|
|
73
|
+
tools: ["bash", "read_file"],
|
|
74
|
+
maxTurns: 6,
|
|
75
|
+
permissionMode: "auto",
|
|
76
|
+
};
|
|
77
|
+
// ─── Security Auditor ───────────────────────────────────────────────────────────
|
|
78
|
+
export const SecurityAuditorAgent = {
|
|
79
|
+
name: "security_auditor",
|
|
80
|
+
description: "Run security scans and report vulnerabilities",
|
|
81
|
+
systemPrompt: `You are a security audit agent. Your task is to check for security issues in the codebase.
|
|
82
|
+
|
|
83
|
+
Rules:
|
|
84
|
+
- Check for: hardcoded secrets, SQL injection, XSS, insecure dependencies
|
|
85
|
+
- Run available security scanning tools
|
|
86
|
+
- Read configuration files for security misconfigurations
|
|
87
|
+
- Rate severity: Critical, High, Medium, Low, Info
|
|
88
|
+
- Provide remediation steps for each finding
|
|
89
|
+
- Do NOT expose actual secret values in your report`,
|
|
90
|
+
tools: ["bash", "read_file"],
|
|
91
|
+
maxTurns: 8,
|
|
92
|
+
permissionMode: "auto",
|
|
93
|
+
};
|
|
94
|
+
// ─── Browser Agent ──────────────────────────────────────────────────────────────
|
|
95
|
+
export const BrowserAgent = {
|
|
96
|
+
name: "browser_agent",
|
|
97
|
+
description: "Browse URLs, extract content, analyze web pages",
|
|
98
|
+
systemPrompt: `You are a web browsing agent. Your task is to access URLs and extract information.
|
|
99
|
+
|
|
100
|
+
Rules:
|
|
101
|
+
- Navigate to the specified URL(s)
|
|
102
|
+
- Extract text content, titles, metadata as requested
|
|
103
|
+
- Summarize the page content clearly
|
|
104
|
+
- Report any errors (404, timeouts, etc.)
|
|
105
|
+
- Do NOT submit forms or make purchases unless explicitly instructed
|
|
106
|
+
- If the page requires authentication, report that you cannot access it`,
|
|
107
|
+
tools: ["bash"],
|
|
108
|
+
maxTurns: 6,
|
|
109
|
+
permissionMode: "auto",
|
|
110
|
+
};
|
|
111
|
+
// ─── Registry Factory ───────────────────────────────────────────────────────────
|
|
112
|
+
/**
|
|
113
|
+
* Creates an AgentRegistry pre-loaded with all built-in agents.
|
|
114
|
+
*/
|
|
115
|
+
export function createDefaultAgentRegistry() {
|
|
116
|
+
const registry = new AgentRegistry();
|
|
117
|
+
registry.register(ScriptRunnerAgent);
|
|
118
|
+
registry.register(CodeReviewerAgent);
|
|
119
|
+
registry.register(TestRunnerAgent);
|
|
120
|
+
registry.register(FileAnalystAgent);
|
|
121
|
+
registry.register(SecurityAuditorAgent);
|
|
122
|
+
registry.register(BrowserAgent);
|
|
123
|
+
return registry;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=builtinAgents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtinAgents.js","sourceRoot":"","sources":["../../src/agents/builtinAgents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,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AAQ,EAAE,CAAC;IACX,cAAc,EAAE,MAAM;CACvB,CAAC;AAEF,mFAAmF;AAEnF,MAAM,CAAC,MAAM,YAAY,GAAc;IACrC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,iDAAiD;IAC9D,YAAY,EAAE;;;;;;;;wEAQwD;IACtE,KAAK,EAAE,CAAC,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC;IACX,cAAc,EAAE,MAAM;CACvB,CAAC;AAEF,mFAAmF;AAEnF;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACxC,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;IAErC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACpC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACxC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEhC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/cli/config.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export interface JooneConfig {
|
|
|
26
26
|
langsmithProject?: string;
|
|
27
27
|
/** Tool permission mode: 'auto' (no prompts), 'ask_dangerous' (prompt for destructive tools), 'ask_all' (prompt for everything). */
|
|
28
28
|
permissionMode?: "auto" | "ask_dangerous" | "ask_all";
|
|
29
|
+
/** Override model for context compaction (default: auto-selected fast model from same provider). */
|
|
30
|
+
compactModel?: string;
|
|
31
|
+
/** Override model for sub-agents (default: auto-selected fast model from same provider). */
|
|
32
|
+
subAgentModel?: string;
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
35
|
* Sensible defaults — Anthropic Claude as the default provider.
|
package/dist/cli/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAoClC;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,CAAC;IACd,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,MAAM;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,iBAAiB,GAA2B;IAChD,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,kBAAkB;IAC5B,SAAS,EAAE,mBAAmB;IAC9B,QAAQ,EAAE,kBAAkB;IAC5B,yCAAyC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,UAAkB;IAC3C,IAAI,MAAmB,CAAC;IAExB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACjD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAyB,CAAC;YACvD,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM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QAAgB;IAChD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -20,6 +20,9 @@ import { SessionStore } from "../core/sessionStore.js";
|
|
|
20
20
|
import { SessionResumer } from "../core/sessionResumer.js";
|
|
21
21
|
import { PermissionMiddleware } from "../middleware/permission.js";
|
|
22
22
|
import { AskUserQuestionTool } from "../tools/askUser.js";
|
|
23
|
+
import { createDefaultAgentRegistry } from "../agents/builtinAgents.js";
|
|
24
|
+
import { SubAgentManager } from "../core/subAgent.js";
|
|
25
|
+
import { createSpawnAgentTools } from "../tools/spawnAgent.js";
|
|
23
26
|
const CONFIG_PATH = path.join(os.homedir(), ".joone", "config.json");
|
|
24
27
|
const SUPPORTED_PROVIDERS = [
|
|
25
28
|
{ value: "anthropic", label: "Anthropic", hint: "Claude 4, 3.5 Sonnet, Opus, Haiku" },
|
|
@@ -255,6 +258,17 @@ program
|
|
|
255
258
|
.description("Configure your LLM provider, model, and API key")
|
|
256
259
|
.action(async () => {
|
|
257
260
|
await runOnboarding();
|
|
261
|
+
const startNow = await confirm({
|
|
262
|
+
message: "Would you like to start Joone now?",
|
|
263
|
+
initialValue: true
|
|
264
|
+
});
|
|
265
|
+
if (startNow && !isCancel(startNow)) {
|
|
266
|
+
// Programmatically invoke the start command
|
|
267
|
+
await program.parseAsync(["node", "joone", "start"]);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
console.log(chalk.dim("\n Run `joone` anytime to start an agent session.\n"));
|
|
271
|
+
}
|
|
258
272
|
});
|
|
259
273
|
// ─── joone provider ────────────────────────────────────────────────────────────
|
|
260
274
|
const providerCmd = program.command("provider").description("Manage dynamic LLM provider packages");
|
|
@@ -378,7 +392,17 @@ program
|
|
|
378
392
|
// Advanced tools (search, browser, etc.) will be dynamically loaded by the agent later
|
|
379
393
|
// via the SearchToolsTool when the registry is fully integrated
|
|
380
394
|
const { CORE_TOOLS } = await import("../tools/index.js");
|
|
381
|
-
|
|
395
|
+
let tools = [...CORE_TOOLS, AskUserQuestionTool];
|
|
396
|
+
// Initialize Sub-Agent Orchestration
|
|
397
|
+
const agentRegistry = createDefaultAgentRegistry();
|
|
398
|
+
const subAgentModelName = config.subAgentModel ?? config.model;
|
|
399
|
+
// Use the config to determine sub-agent model, with FAST_MODEL_DEFAULTS fallback
|
|
400
|
+
const { resolveFastModel } = await import("../core/compactor.js");
|
|
401
|
+
const resolvedSubModel = resolveFastModel(config.provider, config.model, config.subAgentModel);
|
|
402
|
+
const subAgentLlm = await createModel({ ...config, model: resolvedSubModel });
|
|
403
|
+
const subAgentManager = new SubAgentManager(agentRegistry, tools, subAgentLlm);
|
|
404
|
+
const spawnAgentTools = createSpawnAgentTools(subAgentManager, agentRegistry);
|
|
405
|
+
tools = [...tools, ...spawnAgentTools];
|
|
382
406
|
let initialState;
|
|
383
407
|
let sessionId = undefined;
|
|
384
408
|
if (options.resume) {
|