hoomanjs 1.16.0 → 1.16.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/package.json +1 -1
- package/src/acp/acp-agent.ts +2 -0
- package/src/cli.ts +3 -3
- package/src/core/index.ts +5 -7
- package/src/core/prompts/system.ts +1 -1
package/package.json
CHANGED
package/src/acp/acp-agent.ts
CHANGED
|
@@ -334,6 +334,7 @@ export class AcpAgent implements AgentContract {
|
|
|
334
334
|
agent,
|
|
335
335
|
mcp: { manager },
|
|
336
336
|
} = await bootstrap(
|
|
337
|
+
"acp",
|
|
337
338
|
{
|
|
338
339
|
userId: bootstrapUserId,
|
|
339
340
|
sessionId,
|
|
@@ -432,6 +433,7 @@ export class AcpAgent implements AgentContract {
|
|
|
432
433
|
agent,
|
|
433
434
|
mcp: { manager },
|
|
434
435
|
} = await bootstrap(
|
|
436
|
+
"acp",
|
|
435
437
|
{
|
|
436
438
|
userId: bootstrapUserId,
|
|
437
439
|
sessionId: params.sessionId,
|
package/src/cli.ts
CHANGED
|
@@ -55,7 +55,7 @@ program
|
|
|
55
55
|
const {
|
|
56
56
|
agent,
|
|
57
57
|
mcp: { manager },
|
|
58
|
-
} = await bootstrap({ sessionId }, true);
|
|
58
|
+
} = await bootstrap("default", { sessionId }, true);
|
|
59
59
|
agent.addHook(
|
|
60
60
|
BeforeToolCallEvent,
|
|
61
61
|
createToolApprovalHandler({ yolo: Boolean(options.yolo) }),
|
|
@@ -86,7 +86,7 @@ program
|
|
|
86
86
|
agent,
|
|
87
87
|
mcp: { manager },
|
|
88
88
|
registry,
|
|
89
|
-
} = await bootstrap({ sessionId }, false);
|
|
89
|
+
} = await bootstrap("default", { sessionId }, false);
|
|
90
90
|
|
|
91
91
|
try {
|
|
92
92
|
await chat({
|
|
@@ -129,10 +129,10 @@ program
|
|
|
129
129
|
agent,
|
|
130
130
|
mcp: { manager },
|
|
131
131
|
} = await bootstrap(
|
|
132
|
+
"daemon",
|
|
132
133
|
{
|
|
133
134
|
sessionId: session,
|
|
134
135
|
userId: session,
|
|
135
|
-
mode: "daemon",
|
|
136
136
|
},
|
|
137
137
|
true,
|
|
138
138
|
);
|
package/src/core/index.ts
CHANGED
|
@@ -21,16 +21,18 @@ import {
|
|
|
21
21
|
export type BootstrapMeta = {
|
|
22
22
|
userId?: string;
|
|
23
23
|
sessionId?: string;
|
|
24
|
-
mode?: "default" | "daemon";
|
|
25
24
|
acp?: AcpMeta;
|
|
26
25
|
};
|
|
27
26
|
|
|
27
|
+
export type BootstrapMode = "default" | "daemon" | "acp";
|
|
28
|
+
|
|
28
29
|
export type AcpMeta = {
|
|
29
30
|
systemPrompt?: string;
|
|
30
31
|
mcpServers?: NamedMcpTransport[];
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
export async function bootstrap(
|
|
35
|
+
mode: BootstrapMode,
|
|
34
36
|
meta: BootstrapMeta,
|
|
35
37
|
print: boolean = false,
|
|
36
38
|
): Promise<{
|
|
@@ -43,16 +45,12 @@ export async function bootstrap(
|
|
|
43
45
|
const mcpConfig = createMcpConfig(mcpJsonPath());
|
|
44
46
|
const mcpManager = createMcpManager(
|
|
45
47
|
mcpConfig,
|
|
46
|
-
|
|
48
|
+
mode === "acp",
|
|
47
49
|
meta.acp?.mcpServers ?? [],
|
|
48
50
|
);
|
|
49
51
|
const mcp = { config: mcpConfig, manager: mcpManager };
|
|
50
52
|
const registry = createSkillsRegistry(basePath());
|
|
51
|
-
const system = await createSystemPrompt(
|
|
52
|
-
instructionsMdPath(),
|
|
53
|
-
config,
|
|
54
|
-
meta.mode ?? "default",
|
|
55
|
-
);
|
|
53
|
+
const system = await createSystemPrompt(instructionsMdPath(), config, mode);
|
|
56
54
|
const agent = await createAgent(config, system, registry, mcp, print, {
|
|
57
55
|
userId: meta?.userId ?? meta?.sessionId,
|
|
58
56
|
sessionId: meta?.sessionId,
|