@chances-ai/cli 3.1.1 → 3.2.2
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.
|
@@ -6,7 +6,13 @@ import type { AppContext } from "./load-runtime.js";
|
|
|
6
6
|
* the AppContext's `selection` (mutable model preference) through so a later
|
|
7
7
|
* `/model` slash command can mutate it without rebuilding the engine. The
|
|
8
8
|
* config-supplied `agent.maxTurns` is forwarded as-is; the engine falls back
|
|
9
|
-
* to its own default when it's undefined.
|
|
9
|
+
* to its own default when it's undefined.
|
|
10
|
+
*
|
|
11
|
+
* Also (re-)registers the `task` (subagent) built-in here, **not** at app
|
|
12
|
+
* boot. The factory closes over this engine's `gate`, `bus`, and `router`,
|
|
13
|
+
* so a stale closure from boot would leak the wrong dependencies after a
|
|
14
|
+
* `/resume`-driven engine rebuild. The shared `ToolRegistry` overwrites by
|
|
15
|
+
* name, so the prior closure becomes garbage immediately. */
|
|
10
16
|
export declare function buildEngine(ctx: AppContext, session: SessionManager, resolver: PermissionResolver): AgentEngine;
|
|
11
17
|
/** Auto-resolver for non-interactive modes: approve only when --yes was passed. */
|
|
12
18
|
export declare function autoResolver(approve: boolean): PermissionResolver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/boot/create-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/boot/create-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;6DAU6D;AAC7D,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,GAAG,WAAW,CA6B/G;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,kBAAkB,CAEjE"}
|
package/dist/boot/create-app.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
import { AgentEngine } from "@chances-ai/core";
|
|
1
|
+
import { AgentEngine, createTaskTool } from "@chances-ai/core";
|
|
2
2
|
import { PermissionGate } from "@chances-ai/tools";
|
|
3
3
|
/** Wires an AgentEngine for a given session and permission resolver. Passes
|
|
4
4
|
* the AppContext's `selection` (mutable model preference) through so a later
|
|
5
5
|
* `/model` slash command can mutate it without rebuilding the engine. The
|
|
6
6
|
* config-supplied `agent.maxTurns` is forwarded as-is; the engine falls back
|
|
7
|
-
* to its own default when it's undefined.
|
|
7
|
+
* to its own default when it's undefined.
|
|
8
|
+
*
|
|
9
|
+
* Also (re-)registers the `task` (subagent) built-in here, **not** at app
|
|
10
|
+
* boot. The factory closes over this engine's `gate`, `bus`, and `router`,
|
|
11
|
+
* so a stale closure from boot would leak the wrong dependencies after a
|
|
12
|
+
* `/resume`-driven engine rebuild. The shared `ToolRegistry` overwrites by
|
|
13
|
+
* name, so the prior closure becomes garbage immediately. */
|
|
8
14
|
export function buildEngine(ctx, session, resolver) {
|
|
9
15
|
const gate = new PermissionGate(ctx.config.permissions, resolver);
|
|
10
16
|
// Expose the gate so slash commands (notably `/mcp restart` / `/mcp remove`)
|
|
11
17
|
// can invalidate cached positive decisions when tool implementations may
|
|
12
18
|
// have changed. Last engine wins — re-build replaces the reference.
|
|
13
19
|
ctx.gate = gate;
|
|
20
|
+
ctx.tools.register(createTaskTool({
|
|
21
|
+
parentTools: ctx.tools,
|
|
22
|
+
bus: ctx.bus,
|
|
23
|
+
router: ctx.router,
|
|
24
|
+
gate,
|
|
25
|
+
memory: ctx.memory,
|
|
26
|
+
workspaceRoot: ctx.workspaceRoot,
|
|
27
|
+
maxTurns: ctx.config.agent?.maxTurns,
|
|
28
|
+
}));
|
|
14
29
|
return new AgentEngine({
|
|
15
30
|
bus: ctx.bus,
|
|
16
31
|
router: ctx.router,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app.js","sourceRoot":"","sources":["../../src/boot/create-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/
|
|
1
|
+
{"version":3,"file":"create-app.js","sourceRoot":"","sources":["../../src/boot/create-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAA2B,MAAM,mBAAmB,CAAC;AAI5E;;;;;;;;;;6DAU6D;AAC7D,MAAM,UAAU,WAAW,CAAC,GAAe,EAAE,OAAuB,EAAE,QAA4B;IAChG,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAClE,6EAA6E;IAC7E,yEAAyE;IACzE,oEAAoE;IACpE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;IAChB,GAAG,CAAC,KAAK,CAAC,QAAQ,CAChB,cAAc,CAAC;QACb,WAAW,EAAE,GAAG,CAAC,KAAK;QACtB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,IAAI;QACJ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ;KACrC,CAAC,CACH,CAAC;IACF,OAAO,IAAI,WAAW,CAAC;QACrB,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,IAAI;QACJ,OAAO;QACP,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ;KACrC,CAAC,CAAC;AACL,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,OAAO,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC;AAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chances-ai/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"chances": "./dist/entrypoints/cli-node.js",
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
"@ai-sdk/google": "^1.2.0",
|
|
15
15
|
"@ai-sdk/openai": "^1.3.0",
|
|
16
16
|
"@ai-sdk/openai-compatible": "^0.2.0",
|
|
17
|
-
"@chances-ai/ai": "3.
|
|
18
|
-
"@chances-ai/config": "3.
|
|
19
|
-
"@chances-ai/core": "3.
|
|
20
|
-
"@chances-ai/mcp": "3.
|
|
21
|
-
"@chances-ai/memory": "3.
|
|
22
|
-
"@chances-ai/native": "3.
|
|
23
|
-
"@chances-ai/plugin-api": "3.
|
|
24
|
-
"@chances-ai/plugin-logger": "3.
|
|
25
|
-
"@chances-ai/runtime": "3.
|
|
26
|
-
"@chances-ai/session": "3.
|
|
27
|
-
"@chances-ai/telemetry": "3.
|
|
28
|
-
"@chances-ai/tools": "3.
|
|
29
|
-
"@chances-ai/tui": "3.
|
|
17
|
+
"@chances-ai/ai": "3.2.2",
|
|
18
|
+
"@chances-ai/config": "3.2.2",
|
|
19
|
+
"@chances-ai/core": "3.2.2",
|
|
20
|
+
"@chances-ai/mcp": "3.2.2",
|
|
21
|
+
"@chances-ai/memory": "3.2.2",
|
|
22
|
+
"@chances-ai/native": "3.2.2",
|
|
23
|
+
"@chances-ai/plugin-api": "3.2.2",
|
|
24
|
+
"@chances-ai/plugin-logger": "3.2.2",
|
|
25
|
+
"@chances-ai/runtime": "3.2.2",
|
|
26
|
+
"@chances-ai/session": "3.2.2",
|
|
27
|
+
"@chances-ai/telemetry": "3.2.2",
|
|
28
|
+
"@chances-ai/tools": "3.2.2",
|
|
29
|
+
"@chances-ai/tui": "3.2.2",
|
|
30
30
|
"ai": "^4.3.0",
|
|
31
31
|
"ink": "^5.0.1",
|
|
32
32
|
"react": "^18.3.1",
|