@namzu/cli 0.5.1 → 0.7.0
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/dist/__tests__/permission-rules-reach-the-turn.test.d.ts +31 -0
- package/dist/__tests__/permission-rules-reach-the-turn.test.d.ts.map +1 -0
- package/dist/__tests__/permission-rules-reach-the-turn.test.js +132 -0
- package/dist/__tests__/permission-rules-reach-the-turn.test.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -3
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.js +7 -1
- package/dist/cli.test.js.map +1 -1
- package/dist/commands/__tests__/resume.test.d.ts +15 -0
- package/dist/commands/__tests__/resume.test.d.ts.map +1 -0
- package/dist/commands/__tests__/resume.test.js +116 -0
- package/dist/commands/__tests__/resume.test.js.map +1 -0
- package/dist/commands/__tests__/run-flags.test.d.ts +11 -0
- package/dist/commands/__tests__/run-flags.test.d.ts.map +1 -0
- package/dist/commands/__tests__/run-flags.test.js +189 -0
- package/dist/commands/__tests__/run-flags.test.js.map +1 -0
- package/dist/commands/__tests__/run-stream-flags.test.js +160 -11
- package/dist/commands/__tests__/run-stream-flags.test.js.map +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/resume.d.ts +60 -0
- package/dist/commands/resume.d.ts.map +1 -0
- package/dist/commands/resume.js +107 -0
- package/dist/commands/resume.js.map +1 -0
- package/dist/commands/run-flags.d.ts +76 -0
- package/dist/commands/run-flags.d.ts.map +1 -0
- package/dist/commands/run-flags.js +163 -0
- package/dist/commands/run-flags.js.map +1 -0
- package/dist/commands/run-stream.d.ts +3 -39
- package/dist/commands/run-stream.d.ts.map +1 -1
- package/dist/commands/run-stream.js +74 -101
- package/dist/commands/run-stream.js.map +1 -1
- package/dist/commands/run.d.ts +25 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +189 -16
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/stubs.d.ts +10 -0
- package/dist/commands/stubs.d.ts.map +1 -1
- package/dist/commands/stubs.js +12 -2
- package/dist/commands/stubs.js.map +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +20 -4
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +9 -12
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/doctor/checks/credentials.d.ts +20 -0
- package/dist/doctor/checks/credentials.d.ts.map +1 -0
- package/dist/doctor/checks/credentials.js +58 -0
- package/dist/doctor/checks/credentials.js.map +1 -0
- package/dist/doctor/checks/credentials.test.d.ts +10 -0
- package/dist/doctor/checks/credentials.test.d.ts.map +1 -0
- package/dist/doctor/checks/credentials.test.js +47 -0
- package/dist/doctor/checks/credentials.test.js.map +1 -0
- package/dist/doctor/checks/index.d.ts +2 -1
- package/dist/doctor/checks/index.d.ts.map +1 -1
- package/dist/doctor/checks/index.js +3 -1
- package/dist/doctor/checks/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/providers/discover.d.ts +3 -8
- package/dist/integrations/providers/discover.d.ts.map +1 -1
- package/dist/integrations/providers/discover.js +2 -12
- package/dist/integrations/providers/discover.js.map +1 -1
- package/dist/integrations/providers/discover.test.js +1 -28
- package/dist/integrations/providers/discover.test.js.map +1 -1
- package/dist/integrations/providers/index.d.ts +0 -1
- package/dist/integrations/providers/index.d.ts.map +1 -1
- package/dist/integrations/providers/index.js +0 -1
- package/dist/integrations/providers/index.js.map +1 -1
- package/dist/integrations/providers/oauth.d.ts +1 -1
- package/dist/integrations/providers/oauth.js +1 -1
- package/dist/integrations/providers/preferences.d.ts +2 -2
- package/dist/integrations/providers/preferences.js +2 -2
- package/dist/integrations/sessions/store.js +1 -1
- package/dist/integrations/sessions/store.js.map +1 -1
- package/dist/integrations/updates.d.ts +4 -12
- package/dist/integrations/updates.d.ts.map +1 -1
- package/dist/integrations/updates.js +6 -53
- package/dist/integrations/updates.js.map +1 -1
- package/dist/permissions/__tests__/mode.test.d.ts +10 -0
- package/dist/permissions/__tests__/mode.test.d.ts.map +1 -0
- package/dist/permissions/__tests__/mode.test.js +115 -0
- package/dist/permissions/__tests__/mode.test.js.map +1 -0
- package/dist/permissions/__tests__/rules.test.d.ts +10 -0
- package/dist/permissions/__tests__/rules.test.d.ts.map +1 -0
- package/dist/permissions/__tests__/rules.test.js +196 -0
- package/dist/permissions/__tests__/rules.test.js.map +1 -0
- package/dist/permissions/mode.d.ts +64 -0
- package/dist/permissions/mode.d.ts.map +1 -0
- package/dist/permissions/mode.js +32 -0
- package/dist/permissions/mode.js.map +1 -0
- package/dist/permissions/rules.d.ts +105 -0
- package/dist/permissions/rules.d.ts.map +1 -0
- package/dist/permissions/rules.js +163 -0
- package/dist/permissions/rules.js.map +1 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +29 -133
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Picker.d.ts +4 -4
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/Picker.js +6 -8
- package/dist/tui/Picker.js.map +1 -1
- package/dist/tui/__tests__/deferred-tool-discovery.test.d.ts +24 -0
- package/dist/tui/__tests__/deferred-tool-discovery.test.d.ts.map +1 -0
- package/dist/tui/__tests__/deferred-tool-discovery.test.js +111 -0
- package/dist/tui/__tests__/deferred-tool-discovery.test.js.map +1 -0
- package/dist/tui/__tests__/to-agent-event.test.js +88 -0
- package/dist/tui/__tests__/to-agent-event.test.js.map +1 -1
- package/dist/tui/__tests__/working-directory.test.d.ts +13 -0
- package/dist/tui/__tests__/working-directory.test.d.ts.map +1 -0
- package/dist/tui/__tests__/working-directory.test.js +109 -0
- package/dist/tui/__tests__/working-directory.test.js.map +1 -0
- package/dist/tui/agent.d.ts +46 -5
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +140 -43
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +0 -6
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +1 -21
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/types.d.ts +12 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/package.json +4 -5
- package/dist/commands/tools.d.ts +0 -16
- package/dist/commands/tools.d.ts.map +0 -1
- package/dist/commands/tools.js +0 -161
- package/dist/commands/tools.js.map +0 -1
- package/dist/integrations/clawtool/agents.d.ts +0 -31
- package/dist/integrations/clawtool/agents.d.ts.map +0 -1
- package/dist/integrations/clawtool/agents.js +0 -30
- package/dist/integrations/clawtool/agents.js.map +0 -1
- package/dist/integrations/clawtool/agents.test.d.ts +0 -2
- package/dist/integrations/clawtool/agents.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/agents.test.js +0 -79
- package/dist/integrations/clawtool/agents.test.js.map +0 -1
- package/dist/integrations/clawtool/auth.d.ts +0 -26
- package/dist/integrations/clawtool/auth.d.ts.map +0 -1
- package/dist/integrations/clawtool/auth.js +0 -56
- package/dist/integrations/clawtool/auth.js.map +0 -1
- package/dist/integrations/clawtool/auth.test.d.ts +0 -2
- package/dist/integrations/clawtool/auth.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/auth.test.js +0 -40
- package/dist/integrations/clawtool/auth.test.js.map +0 -1
- package/dist/integrations/clawtool/binary.d.ts +0 -25
- package/dist/integrations/clawtool/binary.d.ts.map +0 -1
- package/dist/integrations/clawtool/binary.js +0 -50
- package/dist/integrations/clawtool/binary.js.map +0 -1
- package/dist/integrations/clawtool/binary.test.d.ts +0 -2
- package/dist/integrations/clawtool/binary.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/binary.test.js +0 -50
- package/dist/integrations/clawtool/binary.test.js.map +0 -1
- package/dist/integrations/clawtool/daemon.d.ts +0 -37
- package/dist/integrations/clawtool/daemon.d.ts.map +0 -1
- package/dist/integrations/clawtool/daemon.js +0 -109
- package/dist/integrations/clawtool/daemon.js.map +0 -1
- package/dist/integrations/clawtool/daemon.test.d.ts +0 -11
- package/dist/integrations/clawtool/daemon.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/daemon.test.js +0 -118
- package/dist/integrations/clawtool/daemon.test.js.map +0 -1
- package/dist/integrations/clawtool/dispatch.d.ts +0 -33
- package/dist/integrations/clawtool/dispatch.d.ts.map +0 -1
- package/dist/integrations/clawtool/dispatch.js +0 -155
- package/dist/integrations/clawtool/dispatch.js.map +0 -1
- package/dist/integrations/clawtool/dispatch.test.d.ts +0 -2
- package/dist/integrations/clawtool/dispatch.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/dispatch.test.js +0 -138
- package/dist/integrations/clawtool/dispatch.test.js.map +0 -1
- package/dist/integrations/clawtool/index.d.ts +0 -11
- package/dist/integrations/clawtool/index.d.ts.map +0 -1
- package/dist/integrations/clawtool/index.js +0 -10
- package/dist/integrations/clawtool/index.js.map +0 -1
- package/dist/integrations/clawtool/mcp.d.ts +0 -51
- package/dist/integrations/clawtool/mcp.d.ts.map +0 -1
- package/dist/integrations/clawtool/mcp.js +0 -174
- package/dist/integrations/clawtool/mcp.js.map +0 -1
- package/dist/integrations/clawtool/mcp.test.d.ts +0 -2
- package/dist/integrations/clawtool/mcp.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/mcp.test.js +0 -126
- package/dist/integrations/clawtool/mcp.test.js.map +0 -1
- package/dist/integrations/clawtool/paths.d.ts +0 -8
- package/dist/integrations/clawtool/paths.d.ts.map +0 -1
- package/dist/integrations/clawtool/paths.js +0 -19
- package/dist/integrations/clawtool/paths.js.map +0 -1
- package/dist/integrations/clawtool/peers.d.ts +0 -67
- package/dist/integrations/clawtool/peers.d.ts.map +0 -1
- package/dist/integrations/clawtool/peers.js +0 -150
- package/dist/integrations/clawtool/peers.js.map +0 -1
- package/dist/integrations/clawtool/plugin.d.ts +0 -42
- package/dist/integrations/clawtool/plugin.d.ts.map +0 -1
- package/dist/integrations/clawtool/plugin.js +0 -38
- package/dist/integrations/clawtool/plugin.js.map +0 -1
- package/dist/integrations/clawtool/state.d.ts +0 -11
- package/dist/integrations/clawtool/state.d.ts.map +0 -1
- package/dist/integrations/clawtool/state.js +0 -41
- package/dist/integrations/clawtool/state.js.map +0 -1
- package/dist/integrations/clawtool/state.test.d.ts +0 -2
- package/dist/integrations/clawtool/state.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/state.test.js +0 -38
- package/dist/integrations/clawtool/state.test.js.map +0 -1
- package/dist/integrations/clawtool/tooling.d.ts +0 -52
- package/dist/integrations/clawtool/tooling.d.ts.map +0 -1
- package/dist/integrations/clawtool/tooling.js +0 -91
- package/dist/integrations/clawtool/tooling.js.map +0 -1
- package/dist/integrations/clawtool/tooling.test.d.ts +0 -2
- package/dist/integrations/clawtool/tooling.test.d.ts.map +0 -1
- package/dist/integrations/clawtool/tooling.test.js +0 -58
- package/dist/integrations/clawtool/tooling.test.js.map +0 -1
- package/dist/integrations/clawtool/types.d.ts +0 -41
- package/dist/integrations/clawtool/types.d.ts.map +0 -1
- package/dist/integrations/clawtool/types.js +0 -9
- package/dist/integrations/clawtool/types.js.map +0 -1
- package/dist/integrations/providers/secrets.d.ts +0 -37
- package/dist/integrations/providers/secrets.d.ts.map +0 -1
- package/dist/integrations/providers/secrets.js +0 -69
- package/dist/integrations/providers/secrets.js.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `search_tools` is mounted where there is something to find, and not where
|
|
3
|
+
* there is not.
|
|
4
|
+
*
|
|
5
|
+
* The two registries come from the same builder, so "does the CLI register
|
|
6
|
+
* search_tools" has one answer from one call site and a different correct
|
|
7
|
+
* answer from the other — the shape that hides behind a green suite. The
|
|
8
|
+
* session passes a `taskStore`, so `query()` registers the task tools deferred
|
|
9
|
+
* and the search has a roster of three. A sub-agent is built with no task
|
|
10
|
+
* store, so nothing in its registry is deferred and the tool could only ever
|
|
11
|
+
* answer "no deferred tools matching X" — a capability advertised every turn
|
|
12
|
+
* that costs a turn to discover it is unusable.
|
|
13
|
+
*
|
|
14
|
+
* Removing the peer-daemon catalog is what created the asymmetry: that catalog
|
|
15
|
+
* used to supply BOTH registries, so both were justified in mounting the tool.
|
|
16
|
+
* Only one lost its supplier, and from the side that still works the loss is
|
|
17
|
+
* invisible.
|
|
18
|
+
*
|
|
19
|
+
* So this asserts the CONTRAST, not either half: a test that only checked the
|
|
20
|
+
* session would pass with the tool wrongly mounted on the sub-agent, which is
|
|
21
|
+
* exactly the state this file was written against.
|
|
22
|
+
*/
|
|
23
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
24
|
+
import { tmpdir } from 'node:os';
|
|
25
|
+
import { join } from 'node:path';
|
|
26
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
27
|
+
vi.mock('@namzu/sdk', async (importOriginal) => {
|
|
28
|
+
const actual = await importOriginal();
|
|
29
|
+
return {
|
|
30
|
+
...actual,
|
|
31
|
+
query: () => (async function* () { })(),
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
// The sub-agent's registry is built by a callback the session hands to this
|
|
35
|
+
// factory, so capturing the callback is the only way to see what a sub-agent
|
|
36
|
+
// would actually get — and it is the real wiring, not a re-derivation of it.
|
|
37
|
+
let capturedBuildTools = null;
|
|
38
|
+
vi.mock('../../integrations/subagents/runtime.js', () => ({
|
|
39
|
+
createSubagentRuntime: async (opts) => {
|
|
40
|
+
capturedBuildTools = opts.buildTools;
|
|
41
|
+
return {
|
|
42
|
+
gateway: {},
|
|
43
|
+
agentTool: {
|
|
44
|
+
name: 'Agent',
|
|
45
|
+
description: 'stub',
|
|
46
|
+
inputSchema: { type: 'object', properties: {} },
|
|
47
|
+
execute: async () => ({ success: true, output: '' }),
|
|
48
|
+
},
|
|
49
|
+
allowedAgentIds: [],
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
}));
|
|
53
|
+
let workDir;
|
|
54
|
+
beforeEach(() => {
|
|
55
|
+
capturedBuildTools = null;
|
|
56
|
+
workDir = mkdtempSync(join(tmpdir(), 'namzu-deferred-'));
|
|
57
|
+
});
|
|
58
|
+
afterEach(() => {
|
|
59
|
+
rmSync(workDir, { recursive: true, force: true });
|
|
60
|
+
});
|
|
61
|
+
const prefs = {
|
|
62
|
+
version: 2,
|
|
63
|
+
provider: 'anthropic',
|
|
64
|
+
subagents: { active: [] },
|
|
65
|
+
};
|
|
66
|
+
function detectedAnthropic() {
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
entry: {
|
|
70
|
+
id: 'anthropic',
|
|
71
|
+
label: 'Anthropic',
|
|
72
|
+
defaultModel: 'claude-sonnet-4-5',
|
|
73
|
+
requiresApiKey: true,
|
|
74
|
+
envVars: ['ANTHROPIC_API_KEY'],
|
|
75
|
+
},
|
|
76
|
+
source: 'env',
|
|
77
|
+
apiKey: 'sk-ant-not-a-real-key',
|
|
78
|
+
alternatives: [],
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
describe('search_tools is mounted only where a deferred roster exists', () => {
|
|
83
|
+
it('the session offers it and a sub-agent does not', async () => {
|
|
84
|
+
const { createAgentSession } = await import('../agent.js');
|
|
85
|
+
const session = await createAgentSession(prefs, detectedAnthropic(), { cwd: workDir });
|
|
86
|
+
expect(session.hasProvider).toBe(true);
|
|
87
|
+
// The session opens a task store, so query() defers the task tools and
|
|
88
|
+
// the search has a roster.
|
|
89
|
+
expect(session.toolNames).toContain('search_tools');
|
|
90
|
+
expect(capturedBuildTools, 'the session must hand the sub-agent factory a tool builder').not.toBeNull();
|
|
91
|
+
const subagentTools = capturedBuildTools();
|
|
92
|
+
const subagentNames = subagentTools.listNames();
|
|
93
|
+
// The whole point: same builder, and this side must NOT have it.
|
|
94
|
+
expect(subagentNames).not.toContain('search_tools');
|
|
95
|
+
// And the sub-agent is not stripped of everything else in the process —
|
|
96
|
+
// an assertion that would still hold if `buildTools` returned an empty
|
|
97
|
+
// registry, which would "pass" the line above for the wrong reason.
|
|
98
|
+
expect(subagentNames).toContain('bash');
|
|
99
|
+
expect(subagentNames).toContain('read');
|
|
100
|
+
});
|
|
101
|
+
it('leaves the sub-agent nothing deferred, which is why the tool is withheld', async () => {
|
|
102
|
+
const { createAgentSession } = await import('../agent.js');
|
|
103
|
+
await createAgentSession(prefs, detectedAnthropic(), { cwd: workDir });
|
|
104
|
+
const subagentTools = capturedBuildTools();
|
|
105
|
+
const deferred = subagentTools
|
|
106
|
+
.listNames()
|
|
107
|
+
.filter((n) => subagentTools.getAvailability(n) === 'deferred');
|
|
108
|
+
expect(deferred).toEqual([]);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=deferred-tool-discovery.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred-tool-discovery.test.js","sourceRoot":"","sources":["../../../src/tui/__tests__/deferred-tool-discovery.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAMxE,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IAC9C,MAAM,MAAM,GAAG,MAAM,cAAc,EAA+B,CAAA;IAClE,OAAO;QACN,GAAG,MAAM;QACT,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,MAAK,CAAC,CAAC,EAAE;KACtC,CAAA;AACF,CAAC,CAAC,CAAA;AAEF,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7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E,iBAAiB,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAA;QACtE,MAAM,aAAa,GAAI,kBAA4D,EAAE,CAAA;QAErF,MAAM,QAAQ,GAAG,aAAa;aAC5B,SAAS,EAAE;aACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAA;QAChE,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -46,4 +46,92 @@ describe('toAgentEvent carries the stop reason across', () => {
|
|
|
46
46
|
expect(mapped).toEqual({ kind: 'error', message: 'boom' });
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
|
+
describe('compaction is reported, not silent', () => {
|
|
50
|
+
// Compaction deletes messages irrecoverably. The kernel emits both outcomes
|
|
51
|
+
// specifically so a host can surface the loss; this host used to drop them
|
|
52
|
+
// at `default: return null`, one function from the screen.
|
|
53
|
+
it('says which counts became which, and nothing it cannot substantiate', () => {
|
|
54
|
+
const mapped = toAgentEvent({
|
|
55
|
+
type: 'compaction_completed',
|
|
56
|
+
runId: 'run_1',
|
|
57
|
+
iteration: 3,
|
|
58
|
+
messagesBefore: 42,
|
|
59
|
+
messagesAfter: 9,
|
|
60
|
+
tokensBefore: 120_000,
|
|
61
|
+
tokensAfter: 38_000,
|
|
62
|
+
measuredBy: 'provider',
|
|
63
|
+
contextWindowTokens: 200_000,
|
|
64
|
+
windowSource: 'model-table',
|
|
65
|
+
reachedResetThreshold: true,
|
|
66
|
+
});
|
|
67
|
+
expect(mapped).toMatchObject({ kind: 'context', shed: true });
|
|
68
|
+
const text = mapped.text;
|
|
69
|
+
expect(text).toContain('42');
|
|
70
|
+
expect(text).toContain('9');
|
|
71
|
+
expect(text).toContain('120k');
|
|
72
|
+
// It must NOT claim to know what was lost — only the counts are checkable.
|
|
73
|
+
expect(text).not.toMatch(/turns? \d+-\d+|removed the/i);
|
|
74
|
+
});
|
|
75
|
+
it('marks an estimate as an estimate', () => {
|
|
76
|
+
// Quoting an estimate as a measurement is the same lie as quoting a
|
|
77
|
+
// summary as an enumeration, in miniature.
|
|
78
|
+
const mapped = toAgentEvent({
|
|
79
|
+
type: 'compaction_completed',
|
|
80
|
+
runId: 'run_1',
|
|
81
|
+
iteration: 3,
|
|
82
|
+
messagesBefore: 10,
|
|
83
|
+
messagesAfter: 4,
|
|
84
|
+
tokensBefore: 9000,
|
|
85
|
+
tokensAfter: 3000,
|
|
86
|
+
measuredBy: 'estimate',
|
|
87
|
+
contextWindowTokens: 200_000,
|
|
88
|
+
windowSource: 'default',
|
|
89
|
+
reachedResetThreshold: false,
|
|
90
|
+
});
|
|
91
|
+
expect(mapped.text).toContain('estimated');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
describe('the three decline causes get three sentences', () => {
|
|
95
|
+
// Collapsing them into "compaction failed" puts the reader back where the
|
|
96
|
+
// silence did — the same reason a rule denial had to quote the rule.
|
|
97
|
+
function failure(cause, error) {
|
|
98
|
+
const mapped = toAgentEvent({
|
|
99
|
+
type: 'compaction_failed',
|
|
100
|
+
runId: 'run_1',
|
|
101
|
+
iteration: 2,
|
|
102
|
+
cause,
|
|
103
|
+
messages: 31,
|
|
104
|
+
...(error ? { error } : {}),
|
|
105
|
+
});
|
|
106
|
+
expect(mapped).toMatchObject({ kind: 'context', shed: false });
|
|
107
|
+
return mapped.text;
|
|
108
|
+
}
|
|
109
|
+
it('a thrown reducer may work next time, and carries its own error', () => {
|
|
110
|
+
const text = failure('reducer_threw', 'provider returned 400');
|
|
111
|
+
expect(text).toContain('provider returned 400');
|
|
112
|
+
expect(text).toContain('a later pass may succeed');
|
|
113
|
+
});
|
|
114
|
+
it('shedding nothing is a fact, not an error, and will not change', () => {
|
|
115
|
+
const text = failure('shed_nothing');
|
|
116
|
+
expect(text).toContain('later passes will answer the same');
|
|
117
|
+
// Not dressed as a failure: an irreducible history is a true statement
|
|
118
|
+
// about the conversation, and calling it one sends someone hunting a
|
|
119
|
+
// bug that is not there.
|
|
120
|
+
expect(text).not.toMatch(/failed|error/i);
|
|
121
|
+
});
|
|
122
|
+
it('a split tool pair is a reducer bug and suggests no user action', () => {
|
|
123
|
+
const text = failure('split_tool_pair');
|
|
124
|
+
expect(text).toContain('bug in the reducer');
|
|
125
|
+
expect(text).not.toMatch(/try again|later pass|retry/i);
|
|
126
|
+
});
|
|
127
|
+
it('every cause states the history is unchanged', () => {
|
|
128
|
+
for (const cause of ['reducer_threw', 'shed_nothing', 'split_tool_pair']) {
|
|
129
|
+
expect(failure(cause)).toContain('31 messages unchanged');
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
it('no two causes produce the same sentence', () => {
|
|
133
|
+
const texts = ['reducer_threw', 'shed_nothing', 'split_tool_pair'].map((c) => failure(c));
|
|
134
|
+
expect(new Set(texts).size).toBe(3);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
49
137
|
//# sourceMappingURL=to-agent-event.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-agent-event.test.js","sourceRoot":"","sources":["../../../src/tui/__tests__/to-agent-event.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAI7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C;;;;;;;;;GASG;AAEH,MAAM,KAAK,GAAG,UAAmB,CAAA;AAEjC,QAAQ,CAAC,6CAA6C,EAAE,GAAG,EAAE;IAC5D,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC7D,MAAM,MAAM,GAAG,YAAY,CAAC;YAC3B,IAAI,EAAE,eAAe;YACrB,KAAK;YACL,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,kBAAkB;SAClB,CAAC,CAAA;QAEd,MAA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,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The directory the agent actually works in.
|
|
3
|
+
*
|
|
4
|
+
* `--cwd` was parsed, and reached the session store and the skill search, and
|
|
5
|
+
* stopped there: the agent run itself was started with the PROCESS's directory,
|
|
6
|
+
* so a run pointed at another checkout globbed this one and reported finding
|
|
7
|
+
* nothing — which reads as "the file isn't there" rather than "I looked in the
|
|
8
|
+
* wrong place". Nothing caught it because no test ran a file tool against a
|
|
9
|
+
* directory that was not the process's own, so both directories were the same
|
|
10
|
+
* string in every assertion. These two do.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=working-directory.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working-directory.test.d.ts","sourceRoot":"","sources":["../../../src/tui/__tests__/working-directory.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The directory the agent actually works in.
|
|
3
|
+
*
|
|
4
|
+
* `--cwd` was parsed, and reached the session store and the skill search, and
|
|
5
|
+
* stopped there: the agent run itself was started with the PROCESS's directory,
|
|
6
|
+
* so a run pointed at another checkout globbed this one and reported finding
|
|
7
|
+
* nothing — which reads as "the file isn't there" rather than "I looked in the
|
|
8
|
+
* wrong place". Nothing caught it because no test ran a file tool against a
|
|
9
|
+
* directory that was not the process's own, so both directories were the same
|
|
10
|
+
* string in every assertion. These two do.
|
|
11
|
+
*/
|
|
12
|
+
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
13
|
+
import { tmpdir } from 'node:os';
|
|
14
|
+
import { join } from 'node:path';
|
|
15
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
16
|
+
import { getBuiltinTools } from '@namzu/sdk';
|
|
17
|
+
// Only `query` is replaced; everything else the module under test imports —
|
|
18
|
+
// the tool registry, the disk stores, the provider registry the vendor package
|
|
19
|
+
// registers into — stays real, because a fake of those would not be able to
|
|
20
|
+
// tell us which directory the real ones were handed.
|
|
21
|
+
const queryCalls = [];
|
|
22
|
+
vi.mock('@namzu/sdk', async (importOriginal) => {
|
|
23
|
+
const actual = await importOriginal();
|
|
24
|
+
return {
|
|
25
|
+
...actual,
|
|
26
|
+
query: (params) => {
|
|
27
|
+
queryCalls.push(params);
|
|
28
|
+
return (async function* () { })();
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
let workDir;
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
queryCalls.length = 0;
|
|
35
|
+
workDir = mkdtempSync(join(tmpdir(), 'namzu-cwd-'));
|
|
36
|
+
writeFileSync(join(workDir, 'notes.txt'), 'a file that only exists in the --cwd\n');
|
|
37
|
+
});
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
rmSync(workDir, { recursive: true, force: true });
|
|
40
|
+
});
|
|
41
|
+
function toolContext(workingDirectory) {
|
|
42
|
+
return {
|
|
43
|
+
runId: 'run_test',
|
|
44
|
+
workingDirectory,
|
|
45
|
+
abortSignal: new AbortController().signal,
|
|
46
|
+
env: {},
|
|
47
|
+
log: () => { },
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
describe('a file tool resolves against the working directory it is given', () => {
|
|
51
|
+
it('finds a file that exists only outside the process directory', async () => {
|
|
52
|
+
const glob = getBuiltinTools().find((t) => t.name === 'glob');
|
|
53
|
+
expect(glob, 'the glob builtin is what the reported run called').toBeDefined();
|
|
54
|
+
const found = await glob?.execute({ pattern: '**/notes.txt' }, toolContext(workDir));
|
|
55
|
+
expect(found?.success).toBe(true);
|
|
56
|
+
expect(found?.data).toMatchObject({ count: 1 });
|
|
57
|
+
// The same call in the process's own directory is the reported failure:
|
|
58
|
+
// the file is real, and the answer is that there is no file. Asserted on
|
|
59
|
+
// the count, because the "no files found" text quotes the pattern back
|
|
60
|
+
// and so contains the filename either way.
|
|
61
|
+
const missed = await glob?.execute({ pattern: '**/notes.txt' }, toolContext(process.cwd()));
|
|
62
|
+
expect(missed?.data).toMatchObject({ count: 0 });
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
describe('createAgentSession runs where it is told to', () => {
|
|
66
|
+
const prefs = {
|
|
67
|
+
version: 2,
|
|
68
|
+
provider: 'anthropic',
|
|
69
|
+
subagents: { active: [] },
|
|
70
|
+
};
|
|
71
|
+
function detectedAnthropic() {
|
|
72
|
+
return [
|
|
73
|
+
{
|
|
74
|
+
entry: {
|
|
75
|
+
id: 'anthropic',
|
|
76
|
+
label: 'Anthropic',
|
|
77
|
+
defaultModel: 'claude-sonnet-4-5',
|
|
78
|
+
requiresApiKey: true,
|
|
79
|
+
envVars: ['ANTHROPIC_API_KEY'],
|
|
80
|
+
},
|
|
81
|
+
source: 'env',
|
|
82
|
+
apiKey: 'sk-ant-not-a-real-key',
|
|
83
|
+
alternatives: [],
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
}
|
|
87
|
+
it('passes the caller-supplied cwd to the run, not the process directory', async () => {
|
|
88
|
+
const { createAgentSession } = await import('../agent.js');
|
|
89
|
+
const session = await createAgentSession(prefs, detectedAnthropic(), { cwd: workDir });
|
|
90
|
+
expect(session.hasProvider).toBe(true);
|
|
91
|
+
for await (const _ of session.send([
|
|
92
|
+
{ role: 'user', content: 'read notes.txt', timestamp: 0 },
|
|
93
|
+
])) {
|
|
94
|
+
// drained; the assertion is on what `query` was handed
|
|
95
|
+
}
|
|
96
|
+
expect(queryCalls).toHaveLength(1);
|
|
97
|
+
expect(queryCalls[0].workingDirectory).toBe(workDir);
|
|
98
|
+
expect(queryCalls[0].workingDirectory).not.toBe(process.cwd());
|
|
99
|
+
});
|
|
100
|
+
it('falls back to the process directory when no cwd is supplied', async () => {
|
|
101
|
+
const { createAgentSession } = await import('../agent.js');
|
|
102
|
+
const session = await createAgentSession(prefs, detectedAnthropic());
|
|
103
|
+
for await (const _ of session.send([{ role: 'user', content: 'hello', timestamp: 0 }])) {
|
|
104
|
+
// drained
|
|
105
|
+
}
|
|
106
|
+
expect(queryCalls[0].workingDirectory).toBe(process.cwd());
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=working-directory.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working-directory.test.js","sourceRoot":"","sources":["../../../src/tui/__tests__/working-directory.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAK5C,4EAA4E;AAC5E,+EAA+E;AAC/E,4EAA4E;AAC5E,qDAAqD;AACrD,MAAM,UAAU,GAA8B,EAAE,CAAA;AAChD,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IAC9C,MAAM,MAAM,GAAG,MAAM,cAAc,EAA+B,CAAA;IAClE,OAAO;QACN,GAAG,MAAM;QACT,KAAK,EAAE,CAAC,MAA+B,EAAE,EAAE;YAC1C,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACvB,OAAO,CAAC,KAAK,SAAS,CAAC,MAAK,CAAC,CAAC,EAAE,CAAA;QACjC,CAAC;KACD,CAAA;AACF,CAAC,CAAC,CAAA;AAEF,IAAI,OAAe,CAAA;AAEnB,UAAU,CAAC,GAAG,EAAE;IACf,UAAU,CAAC,MAAM,GAAG,CAAC,CAAA;IACrB,OA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AC,EAAE;SACzD,CAAC,EAAE,CAAC;YACJ,uDAAuD;QACxD,CAAC;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAClC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACpD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC5E,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAA;QAC1D,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAA;QAEpE,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACxF,UAAU;QACX,CAAC;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAC3D,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
|
package/dist/tui/agent.d.ts
CHANGED
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
* `emptySession()` whose `send()` yields a single error event so the UI
|
|
21
21
|
* renders an actionable hint rather than crashing.
|
|
22
22
|
*/
|
|
23
|
-
import { type Message, type ProjectId, type ResumeHandler, type RunEvent, type SessionId, type StopReason, type TenantId, type ThreadId, type ToolCallSummary } from '@namzu/sdk';
|
|
23
|
+
import { type Message, type ProjectId, type ResumeHandler, type RunEvent, type SessionId, type StopReason, type TenantId, type ThreadId, type ToolCallSummary, type VerificationRule } from '@namzu/sdk';
|
|
24
24
|
import { type DetectedProvider, type Preferences, type ProviderId } from '../integrations/providers/index.js';
|
|
25
|
+
import type { PermissionMode } from '../permissions/mode.js';
|
|
25
26
|
export type AgentEvent = {
|
|
26
27
|
readonly kind: 'delta';
|
|
27
28
|
readonly text: string;
|
|
@@ -45,6 +46,22 @@ export type AgentEvent = {
|
|
|
45
46
|
readonly kind: 'usage';
|
|
46
47
|
readonly totalTokens: number;
|
|
47
48
|
readonly costUsd: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Context was discarded, or an attempt to discard it declined.
|
|
52
|
+
*
|
|
53
|
+
* Everything else this session fixed was the run quietly not doing what the
|
|
54
|
+
* operator asked. This is the same class with the opposite sign: the run
|
|
55
|
+
* quietly doing something they did not ask for. Compaction deletes messages
|
|
56
|
+
* irrecoverably, and the first time a user learned it existed was when the
|
|
57
|
+
* agent had forgotten something they were relying on — which reads as the
|
|
58
|
+
* model being stupid rather than the harness dropping context.
|
|
59
|
+
*/
|
|
60
|
+
| {
|
|
61
|
+
readonly kind: 'context';
|
|
62
|
+
readonly text: string;
|
|
63
|
+
/** False when the compaction declined and the history is unchanged. */
|
|
64
|
+
readonly shed: boolean;
|
|
48
65
|
} | {
|
|
49
66
|
readonly kind: 'task';
|
|
50
67
|
readonly subject: string;
|
|
@@ -107,8 +124,6 @@ export interface AgentSession {
|
|
|
107
124
|
readonly providerSummary: string | null;
|
|
108
125
|
readonly modelSummary: string | null;
|
|
109
126
|
readonly toolNames: readonly string[];
|
|
110
|
-
/** Count of clawtool tools registered deferred (loadable via search_tools). */
|
|
111
|
-
readonly deferredToolCount: number;
|
|
112
127
|
readonly errorHint: string | null;
|
|
113
128
|
send(messages: readonly Message[], opts?: SendOptions): AsyncIterable<AgentEvent>;
|
|
114
129
|
}
|
|
@@ -122,7 +137,33 @@ export interface AgentSessionContext {
|
|
|
122
137
|
* App's lifecycle decision: ready / picker / unhealthy.
|
|
123
138
|
*/
|
|
124
139
|
export declare function probeAgentSession(): Promise<AgentSessionContext>;
|
|
125
|
-
export
|
|
140
|
+
export interface AgentSessionOptions {
|
|
141
|
+
/** Session/thread/project/tenant identity for this run. Minted when absent. */
|
|
142
|
+
readonly scope?: RunScope;
|
|
143
|
+
/**
|
|
144
|
+
* The directory the agent works in: what every filesystem tool resolves a
|
|
145
|
+
* relative path against, where sub-agents run, and where the task and
|
|
146
|
+
* memory stores put `.namzu`. Defaults to the process's own directory.
|
|
147
|
+
*
|
|
148
|
+
* Taken as an argument rather than read from `process.cwd()` at each of
|
|
149
|
+
* those four points, which is what let `--cwd` reach the session store and
|
|
150
|
+
* the skill search and stop there: the caller parsed a directory, the agent
|
|
151
|
+
* globbed a different one, and the run reported finding nothing rather than
|
|
152
|
+
* having looked in the wrong place.
|
|
153
|
+
*/
|
|
154
|
+
readonly cwd?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Operator-authored tool rules, already compiled to the kernel's vocabulary.
|
|
157
|
+
*
|
|
158
|
+
* Absent means an empty rule list, which is what the CLI passed for the
|
|
159
|
+
* gate's whole existence: every mutating call fell through to the prompt.
|
|
160
|
+
* That stays the behaviour for anyone who writes no config.
|
|
161
|
+
*/
|
|
162
|
+
readonly rules?: readonly VerificationRule[];
|
|
163
|
+
/** How calls no rule decided are resolved. Defaults to prompt/auto by TTY. */
|
|
164
|
+
readonly permissionMode?: PermissionMode;
|
|
165
|
+
}
|
|
166
|
+
export declare function createAgentSession(prefs: Preferences, detected: readonly DetectedProvider[], options?: AgentSessionOptions): Promise<AgentSession>;
|
|
126
167
|
/**
|
|
127
168
|
* Best-effort live model list for a detected provider, for host-UI pickers (the
|
|
128
169
|
* desktop Namzu tab). Instantiates the provider (only the drivers that
|
|
@@ -150,7 +191,7 @@ export interface RunScope {
|
|
|
150
191
|
*/
|
|
151
192
|
export declare function makeResumeHandler(approval: {
|
|
152
193
|
all: boolean;
|
|
153
|
-
}, onPermission: PermissionFn | undefined): ResumeHandler;
|
|
194
|
+
}, onPermission: PermissionFn | undefined, mode?: PermissionMode): ResumeHandler;
|
|
154
195
|
/**
|
|
155
196
|
* A batch needs explicit approval when any call mutates state: flagged
|
|
156
197
|
* destructive by the SDK, or simply not on the read-only allowlist.
|
package/dist/tui/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tui/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAKN,KAAK,OAAO,EACZ,KAAK,SAAS,EAEd,KAAK,aAAa,EAClB,KAAK,QAAQ,EAGb,KAAK,SAAS,EACd,KAAK,UAAU,EAGf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tui/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAKN,KAAK,OAAO,EACZ,KAAK,SAAS,EAEd,KAAK,aAAa,EAClB,KAAK,QAAQ,EAGb,KAAK,SAAS,EACd,KAAK,UAAU,EAGf,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EAIrB,MAAM,YAAY,CAAA;AAGnB,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,WAAW,EAChB,KAAK,UAAU,EAOf,MAAM,oCAAoC,CAAA;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,MAAM,MAAM,UAAU,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjD;IACA,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,4EAA4E;IAC5E,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