@platless/axom-cli 0.5.9 → 0.6.36
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 +18 -5
- package/dist/axom-patch/cli/README.md +100 -12
- package/dist/axom-patch/cli/account-limits/generate.py +15 -12
- package/dist/axom-patch/cli/account-limits/kimi-proxy.mjs +20 -3
- package/dist/axom-patch/cli/claude-account-limits.json +9 -9
- package/dist/axom-patch/cli/codex-account-limits.json +11 -11
- package/dist/axom-patch/cli/codex-terminal-output.json +16 -0
- package/dist/axom-patch/cli/commandcode-account-limits.json +9 -9
- package/dist/axom-patch/cli/kimi-quota.mjs +12 -0
- package/dist/axom-patch/cli/kimi-subagents.mjs +173 -0
- package/dist/axom-patch/cli/nightly-task.md +55 -13
- package/dist/axom-patch/cli/probes/codex-terminal-output.mjs +33 -0
- package/dist/axom-patch/cli/probes/kimi-subagent-subwork.mjs +82 -0
- package/dist/axom-patch/cli/qoder/dist/axom-acp-compat.mjs +1591 -0
- package/dist/axom-patch/cli/qoder/releases/1.1.75.json +360 -0
- package/dist/axom-patch/cli/qoder-background-terminal.md +13 -6
- package/dist/axom-patch/cli/qoder-foreground-output.md +14 -8
- package/dist/axom-patch/cli/qoder-native-acp.json +227 -0
- package/dist/axom-patch/cli/qoder-steering.md +20 -25
- package/dist/axom-patch/cli/qoder-subagent-subwork.md +17 -68
- package/dist/axom-patch/cli/runtime.json +16 -18
- package/dist/axom-patch/cli/zcode-account-limits.json +10 -11
- package/dist/axom-patch/cli/zcode-models.json +1 -2
- package/dist/axom-patch/cli/zcode-subagent-subwork.json +9 -10
- package/dist/cli.js +4 -36
- package/dist/commands/knowledge.js +47 -0
- package/dist/commands/update.js +65 -3
- package/dist/commands/workstation.js +73 -7
- package/dist/install/claude/commands.js +13 -13
- package/dist/mcp.js +1 -1
- package/dist/native/darwin-arm64/axom-quic +0 -0
- package/dist/workstation/acp/acpAgents.js +102 -98
- package/dist/workstation/acp/acpClient.js +26 -0
- package/dist/workstation/acp/builds/install/npm.js +99 -10
- package/dist/workstation/acp/initializeResponse.js +6 -1
- package/dist/workstation/acp/managedPatches.js +189 -25
- package/dist/workstation/acp/managedRuntime.js +314 -0
- package/dist/workstation/acp/patchAssets.js +40 -0
- package/dist/workstation/acp/processor/checkpoint.js +25 -34
- package/dist/workstation/acp/processor/control.js +5 -78
- package/dist/workstation/acp/processor/runtime.js +5 -81
- package/dist/workstation/acp/processor/session.js +51 -80
- package/dist/workstation/acp/processor/state.js +6 -13
- package/dist/workstation/acp/processor/step.js +3 -20
- package/dist/workstation/acp/processor/test/fixtureLog.js +9 -16
- package/dist/workstation/acp/processor/updates.js +131 -105
- package/dist/workstation/acp/processorSession.js +8 -172
- package/dist/workstation/acp/registry/catalog.js +65 -39
- package/dist/workstation/acp/registry/launch.js +16 -1
- package/dist/workstation/acp/switching.js +0 -3
- package/dist/workstation/acp/test/fakeAgent.js +13 -0
- package/dist/workstation/acp/test/keeperWorld.js +28 -0
- package/dist/workstation/acp/test/raw/sources.js +16 -130
- package/dist/workstation/acp/test/realAdapter.js +1 -47
- package/dist/workstation/acp/test/scriptAgent.js +11 -3
- package/dist/workstation/agentFlow.js +1 -1
- package/dist/workstation/agentSessions.js +38 -143
- package/dist/workstation/channels/management.js +95 -11
- package/dist/workstation/channels/url.js +1 -1
- package/dist/workstation/config.js +16 -4
- package/dist/workstation/connection/encryptedChannel.js +4 -1
- package/dist/workstation/control/bindingStore.js +200 -0
- package/dist/workstation/control/commands.js +124 -0
- package/dist/workstation/control/daemonIdentity.js +53 -0
- package/dist/workstation/control/enrollment.js +106 -0
- package/dist/workstation/control/inspect.js +71 -0
- package/dist/workstation/control/locks.js +63 -0
- package/dist/workstation/control/protocol.js +40 -0
- package/dist/workstation/control/restartGuard.js +46 -0
- package/dist/workstation/control/runtimeClient.js +97 -0
- package/dist/workstation/control/runtimeHost.js +148 -0
- package/dist/workstation/control/serverIdentity.js +35 -0
- package/dist/workstation/daemon.js +106 -6
- package/dist/workstation/daemonctl.js +77 -14
- package/dist/workstation/desktopControl/audio.js +99 -0
- package/dist/workstation/desktopControl/capabilities.js +92 -0
- package/dist/workstation/desktopControl/captureModes.js +9 -0
- package/dist/workstation/desktopControl/captureTargetLabel.js +9 -0
- package/dist/workstation/desktopControl/deviceSockets.js +246 -0
- package/dist/workstation/desktopControl/helperProcess.js +353 -0
- package/dist/workstation/desktopControl/lobby.js +129 -0
- package/dist/workstation/desktopControl/macProvider.js +155 -0
- package/dist/workstation/desktopControl/media.js +331 -0
- package/dist/workstation/desktopControl/nativeProvider.js +1018 -0
- package/dist/workstation/desktopControl/networkEvidence.js +43 -0
- package/dist/workstation/desktopControl/overview.js +58 -0
- package/dist/workstation/desktopControl/protocol.js +302 -0
- package/dist/workstation/desktopControl/quicMedia.js +240 -0
- package/dist/workstation/desktopControl/rateController.js +226 -0
- package/dist/workstation/desktopControl/supervisor.js +1681 -0
- package/dist/workstation/desktopControl/transport.js +27 -0
- package/dist/workstation/desktopControl/wallpaper.js +78 -0
- package/dist/workstation/files/credentials.js +142 -0
- package/dist/workstation/files/text.js +42 -8
- package/dist/workstation/keepers/kit/bundle.js +21 -17
- package/dist/workstation/keepers/kit/launcher.js +47 -7
- package/dist/workstation/keepers/kit/paths.js +2 -1
- package/dist/workstation/managedInstall.js +57 -0
- package/dist/workstation/protocol/agent.js +2 -15
- package/dist/workstation/protocol/management.js +93 -4
- package/dist/workstation/protocol/runtimeDiagnostics.js +15 -0
- package/dist/workstation/rd/artifact.js +119 -0
- package/dist/workstation/rd/control.js +119 -0
- package/dist/workstation/rd/display.js +29 -0
- package/dist/workstation/rd/provider.js +222 -0
- package/dist/workstation/rd/sessions.js +391 -0
- package/dist/workstation/rd/state.js +45 -0
- package/dist/workstation/rd/update.js +171 -0
- package/dist/workstation/rd/upkeep.js +38 -0
- package/dist/workstation/register.js +27 -37
- package/dist/workstation/service/installer.js +104 -13
- package/dist/workstation/service/launchd.js +1 -0
- package/dist/workstation/storageMetrics.js +118 -0
- package/dist/workstation/systemMetrics.js +44 -92
- package/dist/workstation/toolchain.js +94 -0
- package/dist/workstation/tools/browser.js +28 -4
- package/dist/workstation/update/artifact.js +2 -1
- package/dist/workstation/update/globalInstall.js +116 -0
- package/dist/workstation/update/npmInstaller.js +49 -23
- package/dist/workstation/update/rdRollback.js +145 -0
- package/dist/workstation/update/runUpdate.js +3 -2
- package/dist/workstation/update/watchdog.js +16790 -334
- package/package.json +5 -5
- package/skills/axom/SKILL.md +11 -11
- package/skills/axom-definition/SKILL.md +3 -3
- package/skills/axom-platform/SKILL.md +3 -3
- package/dist/axom-patch/cli/probes/qoder-steering.mjs +0 -89
- package/dist/axom-patch/cli/probes/qoder-subagent-origin.mjs +0 -61
- package/dist/axom-patch/cli/qoder-steering.json +0 -52
- package/dist/axom-patch/cli/qoder-subagent-origin.json +0 -73
- package/dist/commands/guide.js +0 -38
- package/dist/runtime-deps/qoder-sdk/package-lock.json +0 -1189
- package/dist/runtime-deps/qoder-sdk/package.json +0 -8
- package/dist/workstation/acp/delegationMcp.js +0 -24
- package/dist/workstation/acp/processor/sideChannel.js +0 -80
- package/dist/workstation/acp/qoderStartup.js +0 -45
- package/dist/workstation/acp/test/raw/qoderCaptures.js +0 -125
- package/dist/workstation/qoderAdapter/backgroundProcess.js +0 -118
- package/dist/workstation/qoderAdapter/backgroundTerminal.js +0 -193
- package/dist/workstation/qoderAdapter/backgroundTerminalFold.js +0 -372
- package/dist/workstation/qoderAdapter/callbackContext.js +0 -76
- package/dist/workstation/qoderAdapter/completedContinuation.js +0 -139
- package/dist/workstation/qoderAdapter/contract.js +0 -78
- package/dist/workstation/qoderAdapter/foregroundOutput.js +0 -36
- package/dist/workstation/qoderAdapter/history.js +0 -85
- package/dist/workstation/qoderAdapter/identityIndex.js +0 -191
- package/dist/workstation/qoderAdapter/inputQueue.js +0 -42
- package/dist/workstation/qoderAdapter/main.js +0 -95
- package/dist/workstation/qoderAdapter/mapper.js +0 -117
- package/dist/workstation/qoderAdapter/observerPlugin.js +0 -245
- package/dist/workstation/qoderAdapter/observerReceiver.js +0 -187
- package/dist/workstation/qoderAdapter/permissions.js +0 -61
- package/dist/workstation/qoderAdapter/profile.js +0 -93
- package/dist/workstation/qoderAdapter/sdkDriver.js +0 -48
- package/dist/workstation/qoderAdapter/sdkRuntime.js +0 -93
- package/dist/workstation/qoderAdapter/sdkRuntimeInstall.js +0 -145
- package/dist/workstation/qoderAdapter/session.js +0 -319
- package/dist/workstation/qoderAdapter/subagentMeta.js +0 -28
- package/dist/workstation/qoderAdapter/subwork.js +0 -85
- package/dist/workstation/qoderAdapter/taskControl.js +0 -38
- package/dist/workstation/qoderAdapter/taskLedger.js +0 -163
- package/dist/workstation/qoderAdapter/usage.js +0 -37
- /package/dist/workstation/{qoderAdapter/types.js → desktopControl/provider.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platless/axom-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.36",
|
|
4
4
|
"description": "Axomwork CLI - manage Axomwork structures, records and executions over MCP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
"node": ">=24"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "rm -rf dist && tsc && node scripts/
|
|
17
|
+
"build": "rm -rf dist && tsc && node scripts/bundle-watchdog.mjs && node scripts/copy-patches.mjs && node scripts/bundle-keepers.mjs && node scripts/bundle-quic.mjs",
|
|
18
18
|
"pretest": "npm run build",
|
|
19
|
-
"test": "vitest run",
|
|
19
|
+
"test": "vitest run && npm run test:qoder-patch",
|
|
20
|
+
"test:qoder-patch": "vitest run --config ../axom-patch/cli/qoder/vitest.config.ts",
|
|
20
21
|
"typecheck": "tsc --noEmit",
|
|
21
|
-
"prepack": "node scripts/copy-patches.mjs --check && node scripts/
|
|
22
|
+
"prepack": "node scripts/copy-patches.mjs --check && node scripts/bundle-keepers.mjs --check && node scripts/bundle-quic.mjs --check"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
@@ -34,7 +35,6 @@
|
|
|
34
35
|
"zod": "^4.4.3"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@qoder-ai/qoder-agent-sdk": "1.0.50",
|
|
38
38
|
"@types/js-yaml": "^4.0.9",
|
|
39
39
|
"@types/node": "^24.19.2",
|
|
40
40
|
"@types/proper-lockfile": "4.1.4",
|
package/skills/axom/SKILL.md
CHANGED
|
@@ -29,8 +29,8 @@ Start by discovering structure before changing records. Use `axom__app_struct__l
|
|
|
29
29
|
|
|
30
30
|
## Query Criteria
|
|
31
31
|
|
|
32
|
-
For the complete filter, sort, and page contract,
|
|
33
|
-
`agent-integration/mcp/record-query-criteria.md`
|
|
32
|
+
For the complete filter, sort, and page contract, see knowledge page
|
|
33
|
+
`agent-integration/mcp/record-query-criteria.md` (`axom__knowledge__get`).
|
|
34
34
|
|
|
35
35
|
Pass filters and sorts inside `criteria`, with `page` as a separate top-level field:
|
|
36
36
|
|
|
@@ -51,8 +51,8 @@ Filter `op` values are `eq|gt|lt|like|in|and|or`. Use nested `filters` for `and`
|
|
|
51
51
|
## Upserting a Record
|
|
52
52
|
|
|
53
53
|
Use `axom__record_write__upsert_record` when a stable external identifier should select an existing record or create a new one. Supply the canonical fields in this order, and include the identity value inside `record`:
|
|
54
|
-
For create/update/upsert safety,
|
|
55
|
-
`agent-integration/operating-patterns/safe-record-mutations.md`; before deletion,
|
|
54
|
+
For create/update/upsert safety, see knowledge page
|
|
55
|
+
`agent-integration/operating-patterns/safe-record-mutations.md`; before deletion, see knowledge page
|
|
56
56
|
`agent-integration/operating-patterns/destructive-actions.md`.
|
|
57
57
|
|
|
58
58
|
```json
|
|
@@ -70,7 +70,7 @@ For create/update/upsert safety, load guide
|
|
|
70
70
|
## Execution Results
|
|
71
71
|
|
|
72
72
|
`axom__execute__run_operation` and `axom__execute__run_service` return an OperationResult-style payload. Interpret `success` as the primary outcome, `text` as user-facing output, `data` as structured result data, `message` as diagnostic detail, `processing` as whether work continues asynchronously, and `runId` as the related run identifier when one is started.
|
|
73
|
-
For asynchronous continuation,
|
|
73
|
+
For asynchronous continuation, see knowledge pages
|
|
74
74
|
`concepts/execution/synchronous-and-task-execution.md` and
|
|
75
75
|
`agent-integration/operating-patterns/following-runs.md`.
|
|
76
76
|
|
|
@@ -112,10 +112,10 @@ Requires the `setting_user` scope. These tools only ever act on the authenticate
|
|
|
112
112
|
- `axom__setting_user__delete_memory({ factId })` - deletes one of the calling user's memory facts; another user's fact id answers not-found.
|
|
113
113
|
- `axom__setting_user__list_workstations()` - lists the calling user's personal workstations and their status.
|
|
114
114
|
|
|
115
|
-
##
|
|
115
|
+
## Knowledge
|
|
116
116
|
|
|
117
|
-
Axomwork ships an AI-first manual. Call `
|
|
118
|
-
contents, `
|
|
119
|
-
`
|
|
120
|
-
`.md`, for example `script-language/sdk/records.md`. When a tool description
|
|
121
|
-
path,
|
|
117
|
+
Axomwork ships an AI-first manual. Call `axom__knowledge__get` with no arguments for the table of
|
|
118
|
+
contents, `axom__knowledge__get` with `path` (e.g. `script-language/sdk/records.md`) for one page, and
|
|
119
|
+
`axom__knowledge__search` with `query` for ranked snippets. Knowledge page paths omit the locale and
|
|
120
|
+
include `.md`, for example `script-language/sdk/records.md`. When a tool description says "see knowledge
|
|
121
|
+
page `<path>`", read that page first.
|
|
@@ -16,7 +16,7 @@ Call each tool directly with camelCase arguments:
|
|
|
16
16
|
## ETag workflow
|
|
17
17
|
|
|
18
18
|
Read the target resource or its list before a mutation, then send the returned `etag` as `expectedEtag`. Body updates use `expectedBodyEtag`. If a conflict occurs, reread the resource, merge intentionally, and retry. Confirm delete actions with the user.
|
|
19
|
-
|
|
19
|
+
See knowledge pages `agent-integration/operating-patterns/etag-write-workflow.md` and
|
|
20
20
|
`agent-integration/operating-patterns/destructive-actions.md` for the complete safety contract.
|
|
21
21
|
|
|
22
22
|
## Applications
|
|
@@ -65,9 +65,9 @@ Load guides `agent-integration/operating-patterns/etag-write-workflow.md` and
|
|
|
65
65
|
- `axom__app_studio__get_workflow_body` — `applicationName`, `modelName`, `workflowName`
|
|
66
66
|
- `axom__app_studio__update_workflow_body` — `applicationName`, `modelName`, `workflowName`, `content`, `expectedBodyEtag`
|
|
67
67
|
|
|
68
|
-
##
|
|
68
|
+
## Knowledge
|
|
69
69
|
|
|
70
|
-
Before authoring `.axom.kts` bodies,
|
|
70
|
+
Before authoring `.axom.kts` bodies, read the relevant knowledge pages with `axom__knowledge__get`:
|
|
71
71
|
`script-language/sdk/index.md` (script SDK),
|
|
72
72
|
`script-language/workflows/workflow-script.md` (workflow DSL),
|
|
73
73
|
`script-language/patterns/index.md` (sync/task/streaming patterns), and
|
|
@@ -16,7 +16,7 @@ Call each tool directly with camelCase arguments:
|
|
|
16
16
|
## ETag workflow
|
|
17
17
|
|
|
18
18
|
Read the target resource or list before a mutation, then send its `etag` as `expectedEtag`. Prompt and workflow-body updates use `expectedBodyEtag`. On conflict, reread and merge intentionally. Confirm delete actions with the user. Report the returned `requiresRestart` value for every datasource or settings mutation.
|
|
19
|
-
For the full concurrency workflow,
|
|
19
|
+
For the full concurrency workflow, see knowledge page
|
|
20
20
|
`agent-integration/operating-patterns/etag-write-workflow.md`.
|
|
21
21
|
|
|
22
22
|
## Platform skills
|
|
@@ -68,9 +68,9 @@ For the full concurrency workflow, load guide
|
|
|
68
68
|
- `axom__setting_platform__get_settings`
|
|
69
69
|
- `axom__setting_platform__update_settings`
|
|
70
70
|
|
|
71
|
-
##
|
|
71
|
+
## Knowledge
|
|
72
72
|
|
|
73
|
-
Before editing,
|
|
73
|
+
Before editing, read the matching knowledge page with `axom__knowledge__get`:
|
|
74
74
|
`platform-operations/ai-providers-and-profiles.md`,
|
|
75
75
|
`platform-operations/cowork-agent-configuration.md`,
|
|
76
76
|
`platform-operations/datasource-configuration.md`,
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// Exercise the real native ACP methods, without model calls or credentials.
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { readFile } from 'node:fs/promises';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
import { pathToFileURL } from 'node:url';
|
|
6
|
-
|
|
7
|
-
export async function verifyQoderSteering(bundle) {
|
|
8
|
-
const slice = (start, end) => {
|
|
9
|
-
const from = bundle.indexOf(start), to = bundle.indexOf(end, from);
|
|
10
|
-
assert(from >= 0 && to > from, `Native Qoder lacks ${start}`);
|
|
11
|
-
return bundle.slice(from, to);
|
|
12
|
-
};
|
|
13
|
-
class RequestError extends Error {
|
|
14
|
-
static invalidParams(_data, message) { return new this(message); }
|
|
15
|
-
}
|
|
16
|
-
const methods = slice('axomQoderSteer(A){', 'async axomQoderPromptOnce(A,e,t,i,n){');
|
|
17
|
-
const Session = new Function('as', 'mte', `return class {
|
|
18
|
-
axomQoderSteeringMessages=[];active=true;disposed=false;promptRunning=true;
|
|
19
|
-
pendingPrompt=new AbortController;queryEngine={activeAbortController:{},abort:()=>{this.aborts++}};aborts=0;
|
|
20
|
-
${methods}
|
|
21
|
-
}`)(RequestError, () => 'generated-id');
|
|
22
|
-
const request = text => ({ prompt: [{ type: 'text', text }],
|
|
23
|
-
_meta: { steering: { idleBehavior: 'promptRequired', priority: 'now' } } });
|
|
24
|
-
const session = new Session();
|
|
25
|
-
let finishFirst, finishSecond;
|
|
26
|
-
const inputs = [];
|
|
27
|
-
session.axomQoderPromptOnce = async (prompt, signal) => {
|
|
28
|
-
inputs.push(prompt);
|
|
29
|
-
assert.equal(signal, session.pendingPrompt.signal);
|
|
30
|
-
return new Promise(resolve => {
|
|
31
|
-
if (inputs.length === 1) finishFirst = resolve; else finishSecond = resolve;
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
let completed = false;
|
|
35
|
-
const pending = session.promptViaQueryEngine([{ type: 'text', text: 'original' }],
|
|
36
|
-
session.pendingPrompt.signal, 'prompt-id', 'user-id').then(value => { completed = true; return value; });
|
|
37
|
-
assert.deepEqual(session.axomQoderSteer(request('changed')), { outcome: 'injected' });
|
|
38
|
-
assert.equal(session.aborts, 1);
|
|
39
|
-
assert.equal(session.pendingPrompt.signal.aborted, false, 'steering must not cancel the host prompt');
|
|
40
|
-
finishFirst({ stopReason: 'cancelled' });
|
|
41
|
-
await new Promise(resolve => setImmediate(resolve));
|
|
42
|
-
assert.equal(completed, false, 'the interrupted native result must not finish the host turn');
|
|
43
|
-
assert.deepEqual(inputs[1], [{ type: 'text', text: 'changed' }]);
|
|
44
|
-
finishSecond({ stopReason: 'end_turn' });
|
|
45
|
-
assert.equal((await pending).stopReason, 'end_turn');
|
|
46
|
-
assert.equal(session.axomQoderSteeringMessages.length, 0);
|
|
47
|
-
|
|
48
|
-
// Native promptRunning remains true for a microtask after its query iterator finishes.
|
|
49
|
-
// Accepting a message there would report delivery after the wrapper already stopped draining.
|
|
50
|
-
const finished = new Session(); finished.queryEngine.activeAbortController = undefined;
|
|
51
|
-
assert.deepEqual(finished.axomQoderSteer(request('arrived at completion')),
|
|
52
|
-
{ outcome: 'promptRequired', reason: 'noRunningTurn' });
|
|
53
|
-
assert.equal(finished.axomQoderSteeringMessages.length, 0);
|
|
54
|
-
|
|
55
|
-
for (const key of ['active', 'promptRunning']) {
|
|
56
|
-
const idle = new Session(); idle[key] = false;
|
|
57
|
-
assert.deepEqual(idle.axomQoderSteer(request('idle')), { outcome: 'promptRequired', reason: 'noRunningTurn' });
|
|
58
|
-
assert.equal(idle.aborts, 0);
|
|
59
|
-
}
|
|
60
|
-
const invalid = new Session();
|
|
61
|
-
for (const value of [request(' '), request('x'.repeat(131073)),
|
|
62
|
-
{ ...request('x'), prompt: [{ type: 'image', data: 'x', mimeType: 'image/png' }] },
|
|
63
|
-
{ ...request('x'), _meta: { steering: { priority: 'next' } } }]) {
|
|
64
|
-
assert.throws(() => invalid.axomQoderSteer(value));
|
|
65
|
-
}
|
|
66
|
-
assert.equal(invalid.aborts, 0);
|
|
67
|
-
assert.equal(invalid.axomQoderSteeringMessages.length, 0);
|
|
68
|
-
|
|
69
|
-
const stopped = new Session();
|
|
70
|
-
stopped.axomQoderPromptOnce = async () => { stopped.pendingPrompt.abort(); return { stopReason: 'cancelled' }; };
|
|
71
|
-
stopped.axomQoderSteer(request('must not run after Stop'));
|
|
72
|
-
assert.equal((await stopped.promptViaQueryEngine([], stopped.pendingPrompt.signal, 'p', 'u')).stopReason, 'cancelled');
|
|
73
|
-
assert.equal(stopped.axomQoderSteeringMessages.length, 0);
|
|
74
|
-
|
|
75
|
-
const broken = new Session();
|
|
76
|
-
broken.axomQoderPromptOnce = async () => { throw new Error('real failure'); };
|
|
77
|
-
broken.axomQoderSteer(request('cannot hide a failure'));
|
|
78
|
-
await assert.rejects(broken.promptViaQueryEngine([], broken.pendingPrompt.signal, 'p', 'u'), /real failure/);
|
|
79
|
-
assert.equal(broken.axomQoderSteeringMessages.length, 0);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
83
|
-
const directory = process.argv[2];
|
|
84
|
-
if (!directory) throw new Error('Usage: node qoder-steering.mjs <patched-qoder-package>');
|
|
85
|
-
const metadata = JSON.parse(await readFile(join(directory, 'package.json'), 'utf8'));
|
|
86
|
-
assert.equal(metadata.name, '@qoder-ai/qodercli'); assert.equal(metadata.version, '1.1.71');
|
|
87
|
-
await verifyQoderSteering(await readFile(join(directory, 'bundle/qodercli.js'), 'utf8'));
|
|
88
|
-
console.log('Native Qoder steering: host-turn lifetime, interruption, idle, validation, Stop and failure checks passed');
|
|
89
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Run against the hash-verified patched official bundle. Exercises its actual ACP dispatch methods
|
|
2
|
-
// without starting a model or reading credentials. Real model acceptance is separate.
|
|
3
|
-
import { readFile } from 'node:fs/promises';
|
|
4
|
-
import assert from 'node:assert/strict';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
|
-
const directory = process.argv[2];
|
|
7
|
-
if (!directory) throw new Error('Usage: node qoder-subagent-origin.mjs <patched-package-directory>');
|
|
8
|
-
const metadata = JSON.parse(await readFile(join(directory, 'package.json'), 'utf8'));
|
|
9
|
-
assert.equal(metadata.name, '@qoder-ai/qodercli'); assert.equal(metadata.version, '1.1.71');
|
|
10
|
-
const bundle = await readFile(join(directory, 'bundle/qodercli.js'), 'utf8');
|
|
11
|
-
const method = (start, end) => {
|
|
12
|
-
const from = bundle.indexOf(start), to = bundle.indexOf(end, from);
|
|
13
|
-
assert(from >= 0 && to > from, `Missing real ACP method ${start}`);
|
|
14
|
-
return bundle.slice(from, to);
|
|
15
|
-
};
|
|
16
|
-
const helper = method('axomQoderId(value)', 'supportsTerminalOutput(){');
|
|
17
|
-
const dispatch = method('async dispatchSDKMessage(A)', 'createAcpSlashCommandHandler(){');
|
|
18
|
-
// 1.1.71 moved tool-call emission behind a `toolCallPublisher` whose constructor callback is
|
|
19
|
-
// `A => this.sendUpdate(A)` — still the patched sendUpdate, so the meta injection survives; the
|
|
20
|
-
// stub reproduces that wiring. `dkA`/`Fc`/`CtA`/`Y9` are the slice's free variables.
|
|
21
|
-
const Session = new Function('dkA', 'Fc', 'CtA', 'Y9', `return class {
|
|
22
|
-
axomQoderToolOrigins=new Map;toolCallNames=new Map;permissionToolCallIds=new Set;
|
|
23
|
-
toolCallPublisher;
|
|
24
|
-
constructor(connection){this.connection=connection;this.id='root';this.context={toolRegistry:{getTool:()=>({kind:'read'})},config:{isTasksEnabled:()=>false}};
|
|
25
|
-
this.toolCallPublisher={
|
|
26
|
-
declare: async u => this.sendUpdate(u),
|
|
27
|
-
result: async u => this.sendUpdate({ sessionUpdate: 'tool_call_update', toolCallId: u.toolCallId, content: u.content, isError: u.isError }),
|
|
28
|
-
}}
|
|
29
|
-
supportsTerminalOutput(){return false} async sendPlanUpdate(){}
|
|
30
|
-
${helper} ${dispatch}
|
|
31
|
-
}`)(v => ({ sessionUpdate: 'tool_call', toolCallId: v.toolCallId, kind: v.kind, rawInput: v.input, status: v.status }),
|
|
32
|
-
'Plan', new Set(), () => false);
|
|
33
|
-
const events = [];
|
|
34
|
-
const session = new Session({ sessionUpdate: async value => events.push(value) });
|
|
35
|
-
const tool = (id, parent) => ({ type: 'assistant', parent_tool_use_id: parent,
|
|
36
|
-
message: { content: [{ type: 'tool_use', id, name: 'Read', input: { path: '/probe' } }] } });
|
|
37
|
-
await session.dispatchSDKMessage(tool('read-a', 'agent-a'));
|
|
38
|
-
await session.dispatchSDKMessage(tool('read-b', 'agent-b'));
|
|
39
|
-
await session.dispatchSDKMessage({ type: 'user', message: { content: [{ type: 'tool_result', tool_use_id: 'read-b', content: 'B' }] } });
|
|
40
|
-
await session.dispatchSDKMessage({ type: 'user', message: { content: [{ type: 'tool_result', tool_use_id: 'read-a', content: 'A' }] } });
|
|
41
|
-
for (const [id, parent] of [['read-a', 'agent-a'], ['read-b', 'agent-b']]) {
|
|
42
|
-
const owned = events.filter(v => v.update.toolCallId === id);
|
|
43
|
-
assert.equal(owned.length, 2);
|
|
44
|
-
for (const event of owned) assert.equal(event.update._meta.qoder.parentToolUseId, parent);
|
|
45
|
-
}
|
|
46
|
-
await session.dispatchSDKMessage({ type: 'stream_event', parent_tool_use_id: 'agent-b',
|
|
47
|
-
event: { type: 'content_block_delta', delta: { type: 'text_delta', text: 'child B' } } });
|
|
48
|
-
assert.equal(events.at(-1).update._meta.qoder.parentToolUseId, 'agent-b');
|
|
49
|
-
await session.dispatchSDKMessage({ type: 'stream_event', parent_tool_use_id: null,
|
|
50
|
-
event: { type: 'content_block_delta', delta: { type: 'text_delta', text: 'root' } } });
|
|
51
|
-
assert.equal(events.at(-1).update._meta, undefined);
|
|
52
|
-
await session.dispatchSDKMessage(tool('root-read', null));
|
|
53
|
-
assert.equal(events.at(-1).update._meta.qoder.parentToolUseId, undefined);
|
|
54
|
-
// 1.1.61 skipped a re-declared tool id entirely; 1.1.71 re-declares it, so the conflict shows up
|
|
55
|
-
// as a freshly emitted tool_call whose origin was invalidated — the intent (a conflicting parent
|
|
56
|
-
// must not tag the tool as a child) is asserted on whatever the conflict emitted.
|
|
57
|
-
await session.dispatchSDKMessage(tool('read-a', 'wrong-agent'));
|
|
58
|
-
const conflict = events.at(-1).update;
|
|
59
|
-
assert.equal(conflict.toolCallId, 'read-a');
|
|
60
|
-
assert.ok(!conflict._meta?.qoder?.parentToolUseId, 'conflicting re-declare must not carry a parent');
|
|
61
|
-
console.log('Official Qoder 1.1.71 ACP dispatch: parallel tool/result, child text, root and conflict checks passed');
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "qoder-steering",
|
|
3
|
-
"package": "@qoder-ai/qodercli",
|
|
4
|
-
"versions": [
|
|
5
|
-
"1.1.71"
|
|
6
|
-
],
|
|
7
|
-
"bin": "qodercli",
|
|
8
|
-
"edits": [
|
|
9
|
-
{
|
|
10
|
-
"file": "bundle/qodercli.js",
|
|
11
|
-
"before_sha256": "a7ff3d5883231c1add98d266d5f860813c6fa7e498ae075384b7c558e8531c88",
|
|
12
|
-
"after_sha256": "b43037a4df32734a47bd5eb0f937583252bbbe637c36514cc8aba7fced3acfe9",
|
|
13
|
-
"before": "protocolVersion:_vs,authMethods:e,agentInfo:{name:d0,title:Nn,version:t},agentCapabilities:",
|
|
14
|
-
"after": "protocolVersion:xbs,authMethods:e,agentInfo:{name:HQ,title:Hn,version:t},_meta:{steering:{supported:true,timings:[\"now\"]}},agentCapabilities:"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"file": "bundle/qodercli.js",
|
|
18
|
-
"before_sha256": "b43037a4df32734a47bd5eb0f937583252bbbe637c36514cc8aba7fced3acfe9",
|
|
19
|
-
"after_sha256": "f1ec60df59dce8dc241fa504d947e5eb5aad7c098dbaa5e89a28d3fd8bb9000c",
|
|
20
|
-
"before": "async prompt(A){await this.ensureAuthenticated();let e=this.sessions.get(A.sessionId);",
|
|
21
|
-
"after": "async extMethod(method,params){\n if(method !== \"_session/steering\") throw as.methodNotFound(method);\n await this.ensureAuthenticated();\n if(!params || typeof params.sessionId !== \"string\" || !params.sessionId) throw as.invalidParams(undefined,\"Missing sessionId\");\n const session=this.sessions.get(params.sessionId);\n if(!session) throw as.invalidParams(undefined,\"Unknown sessionId\");\n return session.axomQoderSteer(params);\n}\nasync prompt(A){await this.ensureAuthenticated();let e=this.sessions.get(A.sessionId);"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"file": "bundle/qodercli.js",
|
|
25
|
-
"before_sha256": "f1ec60df59dce8dc241fa504d947e5eb5aad7c098dbaa5e89a28d3fd8bb9000c",
|
|
26
|
-
"after_sha256": "ea26b18b8e10d410c6eaf03d9df720d6b061979dd9cbc62ff4a1a98682b2f3e4",
|
|
27
|
-
"before": "promptRunning=!1;pendingMessages=[];",
|
|
28
|
-
"after": "promptRunning=!1;pendingMessages=[];axomQoderSteeringMessages=[];"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"file": "bundle/qodercli.js",
|
|
32
|
-
"before_sha256": "ea26b18b8e10d410c6eaf03d9df720d6b061979dd9cbc62ff4a1a98682b2f3e4",
|
|
33
|
-
"after_sha256": "3660901654aecf58b04ac669f2dc945c8ba16376e204ccef53f499a13d1d69e9",
|
|
34
|
-
"before": "async promptViaQueryEngine(A,e,t,i,n){",
|
|
35
|
-
"after": "axomQoderSteer(A){\n const steering=A._meta?.steering;\n if(steering?.priority !== undefined && steering.priority !== \"now\") throw as.invalidParams(undefined,\"Qoder supports only now steering\");\n if(steering?.idleBehavior !== undefined && steering.idleBehavior !== \"promptRequired\") throw as.invalidParams(undefined,\"Unsupported steering idleBehavior\");\n if(!Array.isArray(A.prompt) || !A.prompt.length || A.prompt.some(block=>!block || block.type !== \"text\" || typeof block.text !== \"string\")) throw as.invalidParams(undefined,\"Qoder steering requires text blocks\");\n const text=A.prompt.map(block=>block.text).join(\"\\n\");\n if(!text.trim() || text.length > 131072) throw as.invalidParams(undefined,\"Invalid steering text length\");\n if(this.disposed || !this.active || !this.promptRunning || !this.queryEngine?.activeAbortController || !this.pendingPrompt || this.pendingPrompt.signal.aborted) return {outcome:\"promptRequired\",reason:\"noRunningTurn\"};\n if(this.axomQoderSteeringMessages.length >= 32) throw as.invalidParams(undefined,\"Too many pending steering messages\");\n const message={prompt:A.prompt.map(block=>({type:\"text\",text:block.text})),id:mte()};\n this.axomQoderSteeringMessages.push(message);\n try{this.queryEngine.abort({source:\"sdk_interrupt\",origin:\"user\"});}\n catch(error){this.axomQoderSteeringMessages.pop();throw error;}\n return {outcome:\"injected\"};\n}\nasync promptViaQueryEngine(A,e,t,i,n){\n let result;\n try{\n result=await this.axomQoderPromptOnce(A,e,t,i,n);\n const originalId=result.userMessageId;\n while(!e.aborted && !this.disposed && this.active && this.axomQoderSteeringMessages.length){\n const message=this.axomQoderSteeringMessages.shift();\n const next=await this.axomQoderPromptOnce(message.prompt,e,mte(),message.id);\n if(result.usage && next.usage){\n const inputTokens=result.usage.inputTokens+next.usage.inputTokens;\n const outputTokens=result.usage.outputTokens+next.usage.outputTokens;\n next.usage={inputTokens,outputTokens,totalTokens:inputTokens+outputTokens};\n const models=new Map;\n for(const item of [...result._meta?.quota?.model_usage??[],...next._meta?.quota?.model_usage??[]]){\n const prior=models.get(item.model)??{input_tokens:0,output_tokens:0};\n models.set(item.model,{input_tokens:prior.input_tokens+item.token_count.input_tokens,output_tokens:prior.output_tokens+item.token_count.output_tokens});\n }\n next._meta={...next._meta,quota:{token_count:{input_tokens:inputTokens,output_tokens:outputTokens},model_usage:Array.from(models,([model,token_count])=>({model,token_count}))}};\n }\n result=next;\n }\n return {...result,...(originalId?{userMessageId:originalId}:{})};\n }finally{this.axomQoderSteeringMessages.length=0;}\n}\nasync axomQoderPromptOnce(A,e,t,i,n){"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"file": "bundle/qodercli.js",
|
|
39
|
-
"before_sha256": "3660901654aecf58b04ac669f2dc945c8ba16376e204ccef53f499a13d1d69e9",
|
|
40
|
-
"after_sha256": "7b031034151e76daccbf26c7dbf08779b3e75a281da97b8a56673efdf8433956",
|
|
41
|
-
"before": "if(!A.includes(\"Operation aborted\"))throw new cs(500,A);",
|
|
42
|
-
"after": "if(!A.includes(\"Operation aborted\")&&!(this.axomQoderSteeringMessages.length&&[\"aborted_tools\",\"aborted_streaming\"].includes(c.terminal_reason)))throw new as(500,A);"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"file": "bundle/qodercli.js",
|
|
46
|
-
"before_sha256": "7b031034151e76daccbf26c7dbf08779b3e75a281da97b8a56673efdf8433956",
|
|
47
|
-
"after_sha256": "a2949de7f397a904753d5d1d838d637cc93b3cf43e8b51af8e58a188d6c2e282",
|
|
48
|
-
"before": "else if(\"error_during_execution\"===A.subtype&&\"refusal\"!==A.stop_reason){let e=A.errors??[];",
|
|
49
|
-
"after": "else if(\"error_during_execution\"===A.subtype&&\"refusal\"!==A.stop_reason&&!(this.axomQoderSteeringMessages.length&&[\"aborted_tools\",\"aborted_streaming\"].includes(A.terminal_reason))){let e=A.errors??[];"
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "qoder-subagent-origin",
|
|
3
|
-
"package": "@qoder-ai/qodercli",
|
|
4
|
-
"versions": [
|
|
5
|
-
"1.1.71"
|
|
6
|
-
],
|
|
7
|
-
"edits": [
|
|
8
|
-
{
|
|
9
|
-
"file": "bundle/qodercli.js",
|
|
10
|
-
"before_sha256": "bbac475858838d609241881d1ee89b26c32a2eae8697672522778b18ed78a94a",
|
|
11
|
-
"after_sha256": "4807a4c1cfdb57a6bd9102ec3924185e3e2649935164fed3e98ca353063ff5f0",
|
|
12
|
-
"before": "toolCallNames=new Map;",
|
|
13
|
-
"after": "toolCallNames=new Map;axomQoderToolOrigins=new Map;"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"file": "bundle/qodercli.js",
|
|
17
|
-
"before_sha256": "4807a4c1cfdb57a6bd9102ec3924185e3e2649935164fed3e98ca353063ff5f0",
|
|
18
|
-
"after_sha256": "6485062df36f164432cfe8d8a7adbf32f0bf85053500c11b61b8fce15bcdcbed",
|
|
19
|
-
"before": "async sendUpdate(A){let e={sessionId:this.id,update:A};await this.connection.sessionUpdate(e)}",
|
|
20
|
-
"after": "axomQoderId(value){return typeof value === \"string\" && value.length > 0 && value.length <= 256 && !/[\\x00-\\x1f\\x7f]/.test(value)}\naxomQoderObserveSdk(message){\n if(message.type !== \"assistant\" || !Array.isArray(message.message?.content)) return;\n const parent=message.parent_tool_use_id;\n if(parent !== null && !this.axomQoderId(parent)) return;\n for(const block of message.message.content){\n if(block?.type !== \"tool_use\" || !this.axomQoderId(block.id) || !this.axomQoderId(block.name)) continue;\n const prior=this.axomQoderToolOrigins.get(block.id);\n if(this.axomQoderToolOrigins.has(block.id)){\n if(prior && (prior.parent !== parent || prior.name !== block.name)) this.axomQoderToolOrigins.set(block.id,null);\n continue;\n }\n if(this.axomQoderToolOrigins.size >= 4096) continue;\n this.axomQoderToolOrigins.set(block.id,{parent,name:block.name});\n }\n}\naxomQoderSdkUpdate(message,update){\n if(this.axomQoderId(message.parent_tool_use_id)) update={...update,_meta:{...update._meta,qoder:{...update._meta?.qoder,version:1,source:\"native-acp-patch\",parentToolUseId:message.parent_tool_use_id,route:\"child\"}}};\n return this.sendUpdate(update);\n}\nasync sendUpdate(A){\n if(A.sessionUpdate === \"tool_call\" || A.sessionUpdate === \"tool_call_update\"){\n const origin=this.axomQoderToolOrigins.get(A.toolCallId);\n if(origin) A={...A,_meta:{...A._meta,qoder:{...A._meta?.qoder,version:1,source:\"native-acp-patch\",toolName:origin.name,...(origin.parent ? {parentToolUseId:origin.parent,route:\"child\"} : {})}}};\n }\n let e={sessionId:this.id,update:A};await this.connection.sessionUpdate(e)\n}"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"file": "bundle/qodercli.js",
|
|
24
|
-
"before_sha256": "6485062df36f164432cfe8d8a7adbf32f0bf85053500c11b61b8fce15bcdcbed",
|
|
25
|
-
"after_sha256": "2acc4d22cf66ca8c2c73543ba6bd1023d64c7730204521444ce2386c724bb0fd",
|
|
26
|
-
"before": "async dispatchSDKMessage(A){switch(A.type){",
|
|
27
|
-
"after": "async dispatchSDKMessage(A){this.axomQoderObserveSdk(A);switch(A.type){"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"file": "bundle/qodercli.js",
|
|
31
|
-
"before_sha256": "2acc4d22cf66ca8c2c73543ba6bd1023d64c7730204521444ce2386c724bb0fd",
|
|
32
|
-
"after_sha256": "7908a80dee46d50fcf8d57ba94c45f52ac3261b358a105719e07c9d4db0b0538",
|
|
33
|
-
"before": "await this.sendUpdate({sessionUpdate:\"agent_message_chunk\",content:{type:\"text\",text:e.delta.text}})",
|
|
34
|
-
"after": "await this.axomQoderSdkUpdate(A,{sessionUpdate:\"agent_message_chunk\",content:{type:\"text\",text:e.delta.text}})"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"file": "bundle/qodercli.js",
|
|
38
|
-
"before_sha256": "7908a80dee46d50fcf8d57ba94c45f52ac3261b358a105719e07c9d4db0b0538",
|
|
39
|
-
"after_sha256": "d01e482a334b7973c40bc61f99482da0ccfda08984c289148cc1ca30866f7286",
|
|
40
|
-
"before": "await this.sendUpdate({sessionUpdate:\"agent_thought_chunk\",content:{type:\"text\",text:e.delta.thinking}})",
|
|
41
|
-
"after": "await this.axomQoderSdkUpdate(A,{sessionUpdate:\"agent_thought_chunk\",content:{type:\"text\",text:e.delta.thinking}})"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"file": "bundle/qodercli.js",
|
|
45
|
-
"before_sha256": "d01e482a334b7973c40bc61f99482da0ccfda08984c289148cc1ca30866f7286",
|
|
46
|
-
"after_sha256": "24113eca8518c82ed990ba68e1728cac9bd55f57fb2026030cfa5be430b85e85",
|
|
47
|
-
"before": "async streamHistory(A){let e=Ocd(A);for(let t of A){",
|
|
48
|
-
"after": "async streamHistory(A){let e=Ocd(A);for(let t of A){this.axomQoderObserveSdk(t);"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"file": "bundle/qodercli.js",
|
|
52
|
-
"before_sha256": "24113eca8518c82ed990ba68e1728cac9bd55f57fb2026030cfa5be430b85e85",
|
|
53
|
-
"after_sha256": "2337caf11a15d6f5f08dd0fade9968d3caaf2c4f4d370df4b86b28d7e8838bd2",
|
|
54
|
-
"before": "await this.sendUpdate({sessionUpdate:\"user_message_chunk\",content:{type:\"text\",text:A},messageId:t.uuid})",
|
|
55
|
-
"after": "await this.axomQoderSdkUpdate(t,{sessionUpdate:\"user_message_chunk\",content:{type:\"text\",text:A},messageId:t.uuid})"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"file": "bundle/qodercli.js",
|
|
59
|
-
"before_sha256": "2337caf11a15d6f5f08dd0fade9968d3caaf2c4f4d370df4b86b28d7e8838bd2",
|
|
60
|
-
"after_sha256": "628db161081afd5a44573e916de1afc096c0f2451c0f62f774f5116ecbfd414a",
|
|
61
|
-
"before": "await this.sendUpdate({sessionUpdate:\"agent_message_chunk\",content:{type:\"text\",text:A},messageId:t.uuid})",
|
|
62
|
-
"after": "await this.axomQoderSdkUpdate(t,{sessionUpdate:\"agent_message_chunk\",content:{type:\"text\",text:A},messageId:t.uuid})"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"file": "bundle/qodercli.js",
|
|
66
|
-
"before_sha256": "628db161081afd5a44573e916de1afc096c0f2451c0f62f774f5116ecbfd414a",
|
|
67
|
-
"after_sha256": "a7ff3d5883231c1add98d266d5f860813c6fa7e498ae075384b7c558e8531c88",
|
|
68
|
-
"before": "await this.sendUpdate({sessionUpdate:\"agent_thought_chunk\",content:{type:\"text\",text:A.thinking},messageId:t.uuid})",
|
|
69
|
-
"after": "await this.axomQoderSdkUpdate(t,{sessionUpdate:\"agent_thought_chunk\",content:{type:\"text\",text:A.thinking},messageId:t.uuid})"
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
"bin": "qodercli"
|
|
73
|
-
}
|
package/dist/commands/guide.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { loadConfig, resolveServer } from '../config.js';
|
|
2
|
-
import { callAxomTool } from '../mcp.js';
|
|
3
|
-
import { printOutcome, runCommand } from '../output.js';
|
|
4
|
-
export function registerGuideCommands(program) {
|
|
5
|
-
const guide = program.command('guide').description('Read and search the Axomwork Guide');
|
|
6
|
-
const serverOption = () => program.opts().server;
|
|
7
|
-
guide
|
|
8
|
-
.command('load')
|
|
9
|
-
.description('Load a guide page, or the table of contents when no path is given')
|
|
10
|
-
.argument('[path]', 'guide page path, e.g. script-language/sdk/records')
|
|
11
|
-
.option('--locale <locale>', 'guide locale (en|zh)')
|
|
12
|
-
.action((path, options) => runCommand(() => guideLoadAction({ path, locale: options.locale, server: serverOption() })));
|
|
13
|
-
guide
|
|
14
|
-
.command('search')
|
|
15
|
-
.description('Search the guide with keywords or a question')
|
|
16
|
-
.argument('<query>')
|
|
17
|
-
.option('--locale <locale>', 'guide locale (en|zh)')
|
|
18
|
-
.option('--limit <n>', 'maximum hits')
|
|
19
|
-
.action((query, options) => runCommand(() => guideSearchAction({ query, locale: options.locale, limit: options.limit, server: serverOption() })));
|
|
20
|
-
}
|
|
21
|
-
export async function guideLoadAction(options) {
|
|
22
|
-
const server = resolveServer(await loadConfig(), options.server);
|
|
23
|
-
const args = {};
|
|
24
|
-
if (options.path !== undefined)
|
|
25
|
-
args.path = options.path;
|
|
26
|
-
if (options.locale !== undefined)
|
|
27
|
-
args.locale = options.locale;
|
|
28
|
-
printOutcome(await callAxomTool(server, 'axom__guide__load', args));
|
|
29
|
-
}
|
|
30
|
-
export async function guideSearchAction(options) {
|
|
31
|
-
const server = resolveServer(await loadConfig(), options.server);
|
|
32
|
-
const args = { query: options.query };
|
|
33
|
-
if (options.locale !== undefined)
|
|
34
|
-
args.locale = options.locale;
|
|
35
|
-
if (options.limit !== undefined)
|
|
36
|
-
args.limit = Number(options.limit);
|
|
37
|
-
printOutcome(await callAxomTool(server, 'axom__guide__search', args));
|
|
38
|
-
}
|