@namzu/cli 12.1.0 → 14.0.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/README.md +35 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +119 -60
- package/dist/cli.js.map +1 -1
- package/dist/commands/acp.d.ts +24 -8
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/acp.js +221 -80
- package/dist/commands/acp.js.map +1 -1
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/drain.js +45 -9
- package/dist/commands/drain.js.map +1 -1
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +79 -21
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/prior-messages.d.ts +11 -0
- package/dist/commands/prior-messages.d.ts.map +1 -0
- package/dist/commands/prior-messages.js +280 -0
- package/dist/commands/prior-messages.js.map +1 -0
- package/dist/commands/resume.d.ts.map +1 -1
- package/dist/commands/resume.js +21 -19
- package/dist/commands/resume.js.map +1 -1
- package/dist/commands/run-stream.d.ts +5 -3
- package/dist/commands/run-stream.d.ts.map +1 -1
- package/dist/commands/run-stream.js +66 -62
- package/dist/commands/run-stream.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +50 -37
- package/dist/commands/run.js.map +1 -1
- package/dist/config/debug.d.ts +55 -0
- package/dist/config/debug.d.ts.map +1 -0
- package/dist/config/debug.js +126 -0
- package/dist/config/debug.js.map +1 -0
- package/dist/config/load.d.ts +88 -4
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +386 -56
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +87 -5
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +5 -5
- package/dist/config/schema.js.map +1 -1
- package/dist/config/trusted-project-context.d.ts +11 -0
- package/dist/config/trusted-project-context.d.ts.map +1 -0
- package/dist/config/trusted-project-context.js +28 -0
- package/dist/config/trusted-project-context.js.map +1 -0
- package/dist/context/project-path.d.ts +3 -0
- package/dist/context/project-path.d.ts.map +1 -0
- package/dist/context/project-path.js +16 -0
- package/dist/context/project-path.js.map +1 -0
- package/dist/context/project-tracker.d.ts +30 -0
- package/dist/context/project-tracker.d.ts.map +1 -0
- package/dist/context/project-tracker.js +217 -0
- package/dist/context/project-tracker.js.map +1 -0
- package/dist/context/sandbox.d.ts +29 -9
- package/dist/context/sandbox.d.ts.map +1 -1
- package/dist/context/sandbox.js +8 -0
- package/dist/context/sandbox.js.map +1 -1
- package/dist/doctor/checks/credentials.d.ts.map +1 -1
- package/dist/doctor/checks/credentials.js +7 -1
- package/dist/doctor/checks/credentials.js.map +1 -1
- package/dist/exit-codes.d.ts +5 -4
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +5 -4
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/integrations/clipboard/text.d.ts +43 -0
- package/dist/integrations/clipboard/text.d.ts.map +1 -0
- package/dist/integrations/clipboard/text.js +43 -0
- package/dist/integrations/clipboard/text.js.map +1 -0
- package/dist/integrations/mcp/servers.d.ts +9 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/mcp/servers.js +11 -4
- package/dist/integrations/mcp/servers.js.map +1 -1
- package/dist/integrations/notifications/terminal.d.ts +32 -0
- package/dist/integrations/notifications/terminal.d.ts.map +1 -0
- package/dist/integrations/notifications/terminal.js +46 -0
- package/dist/integrations/notifications/terminal.js.map +1 -0
- package/dist/integrations/plugins/runtime.d.ts +17 -0
- package/dist/integrations/plugins/runtime.d.ts.map +1 -0
- package/dist/integrations/plugins/runtime.js +100 -0
- package/dist/integrations/plugins/runtime.js.map +1 -0
- package/dist/integrations/providers/codex-device-login.d.ts +27 -0
- package/dist/integrations/providers/codex-device-login.d.ts.map +1 -0
- package/dist/integrations/providers/codex-device-login.js +195 -0
- package/dist/integrations/providers/codex-device-login.js.map +1 -0
- package/dist/integrations/providers/codex-oauth.d.ts +10 -0
- package/dist/integrations/providers/codex-oauth.d.ts.map +1 -0
- package/dist/integrations/providers/codex-oauth.js +95 -0
- package/dist/integrations/providers/codex-oauth.js.map +1 -0
- package/dist/integrations/providers/credential-store.d.ts +40 -4
- package/dist/integrations/providers/credential-store.d.ts.map +1 -1
- package/dist/integrations/providers/credential-store.js +236 -18
- package/dist/integrations/providers/credential-store.js.map +1 -1
- package/dist/integrations/providers/discover.d.ts +25 -13
- package/dist/integrations/providers/discover.d.ts.map +1 -1
- package/dist/integrations/providers/discover.js +98 -44
- package/dist/integrations/providers/discover.js.map +1 -1
- package/dist/integrations/providers/harness-credentials.d.ts +36 -0
- package/dist/integrations/providers/harness-credentials.d.ts.map +1 -0
- package/dist/integrations/providers/harness-credentials.js +146 -0
- package/dist/integrations/providers/harness-credentials.js.map +1 -0
- package/dist/integrations/providers/identity.d.ts +8 -15
- package/dist/integrations/providers/identity.d.ts.map +1 -1
- package/dist/integrations/providers/identity.js +8 -15
- package/dist/integrations/providers/identity.js.map +1 -1
- package/dist/integrations/providers/index.d.ts +7 -4
- package/dist/integrations/providers/index.d.ts.map +1 -1
- package/dist/integrations/providers/index.js +6 -3
- package/dist/integrations/providers/index.js.map +1 -1
- package/dist/integrations/providers/keychain.d.ts +0 -13
- package/dist/integrations/providers/keychain.d.ts.map +1 -1
- package/dist/integrations/providers/keychain.js +0 -76
- package/dist/integrations/providers/keychain.js.map +1 -1
- package/dist/integrations/providers/oauth.d.ts +46 -17
- package/dist/integrations/providers/oauth.d.ts.map +1 -1
- package/dist/integrations/providers/oauth.js +175 -45
- package/dist/integrations/providers/oauth.js.map +1 -1
- package/dist/integrations/providers/register.d.ts.map +1 -1
- package/dist/integrations/providers/register.js +9 -1
- package/dist/integrations/providers/register.js.map +1 -1
- package/dist/integrations/providers/registry.d.ts +8 -1
- package/dist/integrations/providers/registry.d.ts.map +1 -1
- package/dist/integrations/providers/registry.js +29 -0
- package/dist/integrations/providers/registry.js.map +1 -1
- package/dist/integrations/providers/subscription-login.d.ts +2 -0
- package/dist/integrations/providers/subscription-login.d.ts.map +1 -1
- package/dist/integrations/providers/subscription-login.js +117 -14
- package/dist/integrations/providers/subscription-login.js.map +1 -1
- package/dist/integrations/sessions/store.d.ts +111 -1
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/store.js +400 -7
- package/dist/integrations/sessions/store.js.map +1 -1
- package/dist/integrations/sessions/transcript-export.d.ts +25 -0
- package/dist/integrations/sessions/transcript-export.d.ts.map +1 -0
- package/dist/integrations/sessions/transcript-export.js +441 -0
- package/dist/integrations/sessions/transcript-export.js.map +1 -0
- package/dist/integrations/sessions/turn-evidence.d.ts +138 -0
- package/dist/integrations/sessions/turn-evidence.d.ts.map +1 -0
- package/dist/integrations/sessions/turn-evidence.js +506 -0
- package/dist/integrations/sessions/turn-evidence.js.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +7 -12
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +19 -10
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/integrations/trust/store.d.ts.map +1 -1
- package/dist/integrations/trust/store.js +27 -13
- package/dist/integrations/trust/store.js.map +1 -1
- package/dist/permissions/canonical-project.d.ts +9 -0
- package/dist/permissions/canonical-project.d.ts.map +1 -0
- package/dist/permissions/canonical-project.js +13 -0
- package/dist/permissions/canonical-project.js.map +1 -0
- package/dist/permissions/checks.d.ts +65 -0
- package/dist/permissions/checks.d.ts.map +1 -0
- package/dist/permissions/checks.js +122 -0
- package/dist/permissions/checks.js.map +1 -0
- package/dist/permissions/headless-trust.d.ts +9 -5
- package/dist/permissions/headless-trust.d.ts.map +1 -1
- package/dist/permissions/headless-trust.js +18 -4
- package/dist/permissions/headless-trust.js.map +1 -1
- package/dist/permissions/rules.d.ts +16 -7
- package/dist/permissions/rules.d.ts.map +1 -1
- package/dist/permissions/rules.js +78 -13
- package/dist/permissions/rules.js.map +1 -1
- package/dist/tui/App.d.ts +5 -2
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +1621 -196
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Composer.d.ts +14 -3
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/Composer.js +53 -15
- package/dist/tui/Composer.js.map +1 -1
- package/dist/tui/EditPromptPicker.d.ts +8 -0
- package/dist/tui/EditPromptPicker.d.ts.map +1 -0
- package/dist/tui/EditPromptPicker.js +18 -0
- package/dist/tui/EditPromptPicker.js.map +1 -0
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/LiveActivity.js +2 -1
- package/dist/tui/LiveActivity.js.map +1 -1
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/Markdown.js +2 -1
- package/dist/tui/Markdown.js.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.js +7 -1
- package/dist/tui/PermissionOverlay.js.map +1 -1
- package/dist/tui/Picker.d.ts +8 -6
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/Picker.js +145 -18
- package/dist/tui/Picker.js.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/ResumePicker.js +1 -1
- package/dist/tui/ResumePicker.js.map +1 -1
- package/dist/tui/Transcript.d.ts +4 -2
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/Transcript.js +31 -5
- package/dist/tui/Transcript.js.map +1 -1
- package/dist/tui/agent.d.ts +123 -19
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +757 -144
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/compact-transcript.d.ts +24 -0
- package/dist/tui/compact-transcript.d.ts.map +1 -0
- package/dist/tui/compact-transcript.js +46 -0
- package/dist/tui/compact-transcript.js.map +1 -0
- package/dist/tui/conversation-history.d.ts +33 -0
- package/dist/tui/conversation-history.d.ts.map +1 -0
- package/dist/tui/conversation-history.js +42 -0
- package/dist/tui/conversation-history.js.map +1 -0
- package/dist/tui/edit-prompts.d.ts +23 -0
- package/dist/tui/edit-prompts.d.ts.map +1 -0
- package/dist/tui/edit-prompts.js +35 -0
- package/dist/tui/edit-prompts.js.map +1 -0
- package/dist/tui/live-window.d.ts +3 -1
- package/dist/tui/live-window.d.ts.map +1 -1
- package/dist/tui/live-window.js +20 -8
- package/dist/tui/live-window.js.map +1 -1
- package/dist/tui/login-prompt.d.ts +5 -0
- package/dist/tui/login-prompt.d.ts.map +1 -1
- package/dist/tui/login-prompt.js +14 -0
- package/dist/tui/login-prompt.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +178 -9
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +340 -16
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/terminal-display.d.ts +12 -0
- package/dist/tui/terminal-display.d.ts.map +1 -0
- package/dist/tui/terminal-display.js +65 -0
- package/dist/tui/terminal-display.js.map +1 -0
- package/dist/tui/types.d.ts +14 -2
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/workspace-diff.d.ts +40 -0
- package/dist/tui/workspace-diff.d.ts.map +1 -0
- package/dist/tui/workspace-diff.js +101 -0
- package/dist/tui/workspace-diff.js.map +1 -0
- package/package.json +8 -8
|
@@ -36,7 +36,7 @@ export const credentialSourcesCheck = {
|
|
|
36
36
|
return {
|
|
37
37
|
status: 'warn',
|
|
38
38
|
message: 'no LLM credential found',
|
|
39
|
-
remediation: '
|
|
39
|
+
remediation: 'Namzu no longer reads the secrets file. It first reuses current Claude and Codex sessions on this device, then subscriptions signed in with `namzu login claude|codex`. API keys remain optional alternatives through ANTHROPIC_API_KEY or OPENAI_API_KEY; local Ollama and LM Studio servers are also detected.',
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
const lines = detected.map((d) => {
|
|
@@ -45,10 +45,16 @@ export const credentialSourcesCheck = {
|
|
|
45
45
|
return `${d.entry.id} (env · ${d.source.envName})`;
|
|
46
46
|
case 'keychain':
|
|
47
47
|
return `${d.entry.id} (keychain · ${d.source.service})`;
|
|
48
|
+
case 'claude-file':
|
|
49
|
+
return `${d.entry.id} (Claude session · ${d.source.path})`;
|
|
50
|
+
case 'codex-file':
|
|
51
|
+
return `${d.entry.id} (Codex session · ${d.source.path})`;
|
|
48
52
|
case 'stored':
|
|
49
53
|
return `${d.entry.id} (signed in · ${d.source.path})`;
|
|
50
54
|
case 'probe':
|
|
51
55
|
return `${d.entry.id} (local · ${d.source.url.replace(/^https?:\/\//, '')})`;
|
|
56
|
+
case 'session':
|
|
57
|
+
return `${d.entry.id} (typed · current session)`;
|
|
52
58
|
}
|
|
53
59
|
});
|
|
54
60
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/doctor/checks/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAE5E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAgB;IAClD,EAAE,EAAE,uBAAuB;IAC3B,QAAQ,EAAE,WAAW;IACrB,GAAG,EAAE,KAAK,IAAgC,EAAE;QAC3C,IAAI,QAAuD,CAAA;QAC3D,IAAI,CAAC;YACJ,QAAQ,GAAG,MAAM,iBAAiB,EAAE,CAAA;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,oEAAoE;YACpE,sEAAsE;YACtE,OAAO;gBACN,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,gCAAgC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;aAC3F,CAAA;QACF,CAAC;QAED,IAAI,QAAQ,CAAC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AC,EAAE,gBAAgB,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,CAAA;gBACxD,KAAK,aAAa;oBACjB,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAA;gBAC3D,KAAK,YAAY;oBAChB,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,qBAAqB,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAA;gBAC1D,KAAK,QAAQ;oBACZ,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAA;gBACtD,KAAK,OAAO;oBACX,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,GAAG,CAAA;gBAC7E,KAAK,SAAS;oBACb,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,4BAA4B,CAAA;YAClD,CAAC;QACF,CAAC,CAAC,CAAA;QACF,OAAO;YACN,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,GAAG,QAAQ,CAAC,MAAM,kCAAkC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAC/E,CAAA;IACF,CAAC;CACD,CAAA"}
|
package/dist/exit-codes.d.ts
CHANGED
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
* nothing else is. A caller who cannot tell them
|
|
38
38
|
* apart matches on the message string, and then
|
|
39
39
|
* the message can never be reworded.
|
|
40
|
-
* 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config source is present
|
|
41
|
+
* and cannot be read or contains a known setting
|
|
42
|
+
* with an invalid value, so the run refuses rather
|
|
43
|
+
* than silently substituting another setting.
|
|
44
|
+
* Distinct from 2 for
|
|
44
45
|
* the reason 2 is distinct from 0: "namzu is not
|
|
45
46
|
* configured here" and "your configuration is
|
|
46
47
|
* unreadable" are fixed by opposite actions, and a
|
package/dist/exit-codes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,OAAO,IAAI,CAAA;AACxB,eAAO,MAAM,SAAS,IAAI,CAAA;AAC1B,eAAO,MAAM,cAAc,IAAI,CAAA;AAC/B,eAAO,MAAM,UAAU,KAAK,CAAA;AAC5B,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,eAAO,MAAM,cAAc,KAAK,CAAA;AAChC,eAAO,MAAM,eAAe,KAAK,CAAA;AAEjC,MAAM,MAAM,WAAW,GACpB,OAAO,OAAO,GACd,OAAO,SAAS,GAChB,OAAO,cAAc,GACrB,OAAO,UAAU,GACjB,OAAO,gBAAgB,GACvB,OAAO,mBAAmB,GAC1B,OAAO,cAAc,GACrB,OAAO,eAAe,CAAA"}
|
package/dist/exit-codes.js
CHANGED
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
* nothing else is. A caller who cannot tell them
|
|
38
38
|
* apart matches on the message string, and then
|
|
39
39
|
* the message can never be reworded.
|
|
40
|
-
* 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config source is present
|
|
41
|
+
* and cannot be read or contains a known setting
|
|
42
|
+
* with an invalid value, so the run refuses rather
|
|
43
|
+
* than silently substituting another setting.
|
|
44
|
+
* Distinct from 2 for
|
|
44
45
|
* the reason 2 is distinct from 0: "namzu is not
|
|
45
46
|
* configured here" and "your configuration is
|
|
46
47
|
* unreadable" are fixed by opposite actions, and a
|
package/dist/exit-codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../src/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAA;AACxB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAC1B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAC/B,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAA;AAC5B,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAA;AAChC,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export { runCli, type RunCliOptions } from './cli.js';
|
|
|
12
12
|
export type { CommandContext, CommandDef, CommandHandler, CommandHandlerArgs, } from './commands/types.js';
|
|
13
13
|
export { registerAll, registerCommand, type RegisterOptions, } from './commands/registry.js';
|
|
14
14
|
export { createFormatter, type FormatName, type Formatter, type FormatterOptions, isFormatName, } from './output/index.js';
|
|
15
|
-
export { ConfigLoadError, loadConfig, loadConfigWithProvenance, type ConfigProvenance, type ConfigSource, type LoadConfigOptions, } from './config/load.js';
|
|
16
|
-
export { DEFAULT_CONFIG, type NamzuCliConfig } from './config/schema.js';
|
|
15
|
+
export { ConfigLoadError, ConfigValueError, loadConfig, loadConfigWithProvenance, type ConfigProvenance, type ConfigSource, type ConfigValueSource, type LoadConfigOptions, } from './config/load.js';
|
|
16
|
+
export { DEFAULT_CONFIG, type NamzuCliConfig, type PluginConfig, type PluginScope, type TerminalNotificationEvent, type TerminalNotificationMethod, type TuiConfig, } from './config/schema.js';
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACN,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,SAAS,GACT,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACN,KAAK,eAAe,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,GACpB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAGvD,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AACrD,YAAY,EACX,cAAc,EACd,UAAU,EACV,cAAc,EACd,kBAAkB,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACN,WAAW,EACX,eAAe,EACf,KAAK,eAAe,GACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACN,eAAe,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,YAAY,GACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACN,eAAe,EACf,UAAU,EACV,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACN,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,SAAS,GACT,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACN,KAAK,eAAe,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,GACpB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAGvD,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AACrD,YAAY,EACX,cAAc,EACd,UAAU,EACV,cAAc,EACd,kBAAkB,GAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACN,WAAW,EACX,eAAe,EACf,KAAK,eAAe,GACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACN,eAAe,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,YAAY,GACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,SAAS,GACd,MAAM,oBAAoB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,6 @@ export { runDoctorCommand } from './commands/doctor.js';
|
|
|
12
12
|
export { runCli } from './cli.js';
|
|
13
13
|
export { registerAll, registerCommand, } from './commands/registry.js';
|
|
14
14
|
export { createFormatter, isFormatName, } from './output/index.js';
|
|
15
|
-
export { ConfigLoadError, loadConfig, loadConfigWithProvenance, } from './config/load.js';
|
|
16
|
-
export { DEFAULT_CONFIG } from './config/schema.js';
|
|
15
|
+
export { ConfigLoadError, ConfigValueError, loadConfig, loadConfigWithProvenance, } from './config/load.js';
|
|
16
|
+
export { DEFAULT_CONFIG, } from './config/schema.js';
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iEAAiE;AACjE,OAAO,EACN,oBAAoB,EACpB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,SAAS,GACT,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAEN,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,GACpB,MAAM,2BAA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* Ask an interactive terminal to place text on its clipboard via OSC 52.
|
|
3
|
+
*
|
|
4
|
+
* This deliberately does not spawn a platform clipboard command. `/copy` is a
|
|
5
|
+
* TUI operation, not permission to run arbitrary host code outside the agent's
|
|
6
|
+
* sandbox and approval path. The escape payload is base64, so model-authored
|
|
7
|
+
* control characters cannot terminate the sequence and inject another one.
|
|
8
|
+
*
|
|
9
|
+
* OSC 52 has no portable acknowledgement. A successful write proves only that
|
|
10
|
+
* the complete request reached Ink's stdout; a terminal, multiplexer or remote
|
|
11
|
+
* hop may still ignore it. The result therefore says `request-sent`, never
|
|
12
|
+
* `copied`, and the caller must preserve that distinction in its message.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Bound the raw UTF-8 text before base64 expands it by roughly one third.
|
|
16
|
+
*
|
|
17
|
+
* Terminal limits vary and cannot be negotiated. Refusing above a stated cap
|
|
18
|
+
* is honest; truncating would put something on the clipboard that is not the
|
|
19
|
+
* answer the operator asked for.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MAX_CLIPBOARD_TEXT_BYTES = 100000;
|
|
22
|
+
export interface TerminalClipboardOutput {
|
|
23
|
+
/** Whether Ink is attached to an interactive terminal. */
|
|
24
|
+
readonly isTTY?: boolean;
|
|
25
|
+
/** Ink's stdout writer, which preserves the frame around out-of-band output. */
|
|
26
|
+
readonly write: (data: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export type ClipboardWriteResult = {
|
|
29
|
+
readonly kind: 'request-sent';
|
|
30
|
+
readonly bytes: number;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'unavailable';
|
|
33
|
+
readonly detail: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: 'too-large';
|
|
36
|
+
readonly bytes: number;
|
|
37
|
+
readonly limit: number;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: 'write-failed';
|
|
40
|
+
readonly detail: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function writeClipboardText(text: string, output: TerminalClipboardOutput): ClipboardWriteResult;
|
|
43
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/integrations/clipboard/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,SAAU,CAAA;AAE/C,MAAM,WAAW,uBAAuB;IACvC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC;AAED,MAAM,MAAM,oBAAoB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9E;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7D,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,uBAAuB,GAC7B,oBAAoB,CAqBtB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ask an interactive terminal to place text on its clipboard via OSC 52.
|
|
3
|
+
*
|
|
4
|
+
* This deliberately does not spawn a platform clipboard command. `/copy` is a
|
|
5
|
+
* TUI operation, not permission to run arbitrary host code outside the agent's
|
|
6
|
+
* sandbox and approval path. The escape payload is base64, so model-authored
|
|
7
|
+
* control characters cannot terminate the sequence and inject another one.
|
|
8
|
+
*
|
|
9
|
+
* OSC 52 has no portable acknowledgement. A successful write proves only that
|
|
10
|
+
* the complete request reached Ink's stdout; a terminal, multiplexer or remote
|
|
11
|
+
* hop may still ignore it. The result therefore says `request-sent`, never
|
|
12
|
+
* `copied`, and the caller must preserve that distinction in its message.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Bound the raw UTF-8 text before base64 expands it by roughly one third.
|
|
16
|
+
*
|
|
17
|
+
* Terminal limits vary and cannot be negotiated. Refusing above a stated cap
|
|
18
|
+
* is honest; truncating would put something on the clipboard that is not the
|
|
19
|
+
* answer the operator asked for.
|
|
20
|
+
*/
|
|
21
|
+
export const MAX_CLIPBOARD_TEXT_BYTES = 100_000;
|
|
22
|
+
export function writeClipboardText(text, output) {
|
|
23
|
+
if (!output.isTTY) {
|
|
24
|
+
return { kind: 'unavailable', detail: 'stdout is not an interactive terminal' };
|
|
25
|
+
}
|
|
26
|
+
const bytes = Buffer.byteLength(text, 'utf8');
|
|
27
|
+
if (bytes > MAX_CLIPBOARD_TEXT_BYTES) {
|
|
28
|
+
return { kind: 'too-large', bytes, limit: MAX_CLIPBOARD_TEXT_BYTES };
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const encoded = Buffer.from(text, 'utf8').toString('base64');
|
|
32
|
+
// `c` selects the clipboard; BEL terminates the OSC control sequence.
|
|
33
|
+
output.write(`\x1b]52;c;${encoded}\x07`);
|
|
34
|
+
return { kind: 'request-sent', bytes };
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
return {
|
|
38
|
+
kind: 'write-failed',
|
|
39
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/integrations/clipboard/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAA;AAe/C,MAAM,UAAU,kBAAkB,CACjC,IAAY,EACZ,MAA+B;IAE/B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,uCAAuC,EAAE,CAAA;IAChF,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC7C,IAAI,KAAK,GAAG,wBAAwB,EAAE,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACrE,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC5D,sEAAsE;QACtE,MAAM,CAAC,KAAK,CAAC,aAAa,OAAO,MAAM,CAAC,CAAA;QACxC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO;YACN,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAA;IACF,CAAC;AACF,CAAC"}
|
|
@@ -78,6 +78,15 @@ export type McpServersConfig = Readonly<Record<string, McpServerSpec>>;
|
|
|
78
78
|
export interface ConnectedMcpServer {
|
|
79
79
|
readonly name: string;
|
|
80
80
|
readonly toolCount: number;
|
|
81
|
+
/**
|
|
82
|
+
* What this server actually contributes, by tool name.
|
|
83
|
+
*
|
|
84
|
+
* Carried from the listing rather than recovered later. The names arrive
|
|
85
|
+
* prefixed with the server's own (`mcp_tickets_create`), so a caller COULD
|
|
86
|
+
* split them back apart — but that turns an encoding this file owns into a
|
|
87
|
+
* format two places have to agree about, and the list is free right here.
|
|
88
|
+
*/
|
|
89
|
+
readonly tools: readonly string[];
|
|
81
90
|
}
|
|
82
91
|
export interface FailedMcpServer {
|
|
83
92
|
readonly name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../../src/integrations/mcp/servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEnB,MAAM,YAAY,CAAA;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,QAAS,CAAA;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,OAAQ,CAAA;AAErC,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC/C;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,gEAAgE;IAChE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,mCAAmC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACnD;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ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MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CACjC;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAA;IACzC,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAA;IACjD,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAC3C;;;;;;;OAOG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,MAAM,CAwBhG;AAkBD,wBAAsB,iBAAiB,CACtC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,OAAO,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B,OAAO,CAAC,aAAa,CAAC,CA0ExB"}
|
|
@@ -118,10 +118,17 @@ export async function connectMcpServers(config, options) {
|
|
|
118
118
|
try {
|
|
119
119
|
await withDeadline(client.connect(), CONNECT_TIMEOUT_MS, `server "${name}"`);
|
|
120
120
|
const listed = await withDeadline(client.listTools(), CONNECT_TIMEOUT_MS, `server "${name}" listing its tools`);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
// Adapted once, then read twice. Adapting a second time to collect
|
|
122
|
+
// the names would build a parallel set of definitions bound to the
|
|
123
|
+
// same client — cheap today and exactly the kind of duplicate a
|
|
124
|
+
// future adapter with a side effect turns into a bug.
|
|
125
|
+
const adapted = listed.map((tool) => mcpToolToToolDefinition(tool, client, name));
|
|
126
|
+
tools.push(...adapted);
|
|
127
|
+
connected.push({
|
|
128
|
+
name,
|
|
129
|
+
toolCount: adapted.length,
|
|
130
|
+
tools: adapted.map((tool) => tool.name),
|
|
131
|
+
});
|
|
125
132
|
clients.push(client);
|
|
126
133
|
}
|
|
127
134
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../src/integrations/mcp/servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EACN,SAAS,EAGT,uBAAuB,GACvB,MAAM,YAAY,CAAA;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../src/integrations/mcp/servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EACN,SAAS,EAGT,uBAAuB,GACvB,MAAM,YAAY,CAAA;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAA;AAiErC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,IAAmB,EAAE,UAAkB;IACnE,MAAM,UAAU,GAAG,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAA;IACrF,MAAM,MAAM,GAAG,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,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ACN,KAAK;QACL,SAAS;QACT,MAAM;QACN,KAAK,EAAE,KAAK,IAAI,EAAE;YACjB,MAAM,OAAO,CAAC,GAAG,CAChB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACjB,YAAY,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,gBAAgB,EAAE,uBAAuB,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBAClF,8DAA8D;gBAC9D,8DAA8D;gBAC9D,0DAA0D;gBAC1D,iDAAiD;YAClD,CAAC,CAAC,CACF,CACD,CAAA;QACF,CAAC;KACD,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TerminalNotificationEvent, TerminalNotificationMethod } from '../../config/schema.js';
|
|
2
|
+
/** A semantic TUI moment, before it is rendered for a terminal protocol. */
|
|
3
|
+
export type TerminalNotification = {
|
|
4
|
+
readonly kind: 'approval-required';
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: 'turn-settled';
|
|
7
|
+
readonly outcome: 'completed' | 'stopped' | 'failed';
|
|
8
|
+
};
|
|
9
|
+
export interface TerminalNotificationOutput {
|
|
10
|
+
readonly isTTY?: boolean;
|
|
11
|
+
readonly write: (data: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export type TerminalNotificationResult = {
|
|
14
|
+
readonly kind: 'request-sent';
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'unavailable';
|
|
17
|
+
readonly detail: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: 'write-failed';
|
|
20
|
+
readonly detail: string;
|
|
21
|
+
};
|
|
22
|
+
/** Whether one configured setting includes this semantic event. */
|
|
23
|
+
export declare function terminalNotificationEnabled(setting: boolean | readonly TerminalNotificationEvent[] | undefined, notification: TerminalNotification): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Send one fixed, content-free notification request through Ink's stdout.
|
|
26
|
+
*
|
|
27
|
+
* Neither protocol acknowledges that a terminal displayed anything. Success
|
|
28
|
+
* therefore means only that the request was written, never that a desktop
|
|
29
|
+
* notification appeared or a bell was audible.
|
|
30
|
+
*/
|
|
31
|
+
export declare function writeTerminalNotification(notification: TerminalNotification, method: TerminalNotificationMethod, output: TerminalNotificationOutput): TerminalNotificationResult;
|
|
32
|
+
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/integrations/notifications/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAEnG,4EAA4E;AAC5E,MAAM,MAAM,oBAAoB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;CAAE,GACtC;IACA,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAA;CACnD,CAAA;AAEJ,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC;AAED,MAAM,MAAM,0BAA0B,GACnC;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GACjC;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7D,mEAAmE;AACnE,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,OAAO,GAAG,SAAS,yBAAyB,EAAE,GAAG,SAAS,EACnE,YAAY,EAAE,oBAAoB,GAChC,OAAO,CAIT;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACxC,YAAY,EAAE,oBAAoB,EAClC,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,0BAA0B,GAChC,0BAA0B,CAe5B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Whether one configured setting includes this semantic event. */
|
|
2
|
+
export function terminalNotificationEnabled(setting, notification) {
|
|
3
|
+
if (setting === true)
|
|
4
|
+
return true;
|
|
5
|
+
if (!Array.isArray(setting))
|
|
6
|
+
return false;
|
|
7
|
+
return setting.includes(notification.kind);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Send one fixed, content-free notification request through Ink's stdout.
|
|
11
|
+
*
|
|
12
|
+
* Neither protocol acknowledges that a terminal displayed anything. Success
|
|
13
|
+
* therefore means only that the request was written, never that a desktop
|
|
14
|
+
* notification appeared or a bell was audible.
|
|
15
|
+
*/
|
|
16
|
+
export function writeTerminalNotification(notification, method, output) {
|
|
17
|
+
if (!output.isTTY) {
|
|
18
|
+
return { kind: 'unavailable', detail: 'stdout is not an interactive terminal' };
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
if (method === 'bel')
|
|
22
|
+
output.write('\x07');
|
|
23
|
+
else
|
|
24
|
+
output.write(`\x1b]9;${notificationText(notification)}\x07`);
|
|
25
|
+
return { kind: 'request-sent' };
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
return {
|
|
29
|
+
kind: 'write-failed',
|
|
30
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function notificationText(notification) {
|
|
35
|
+
if (notification.kind === 'approval-required')
|
|
36
|
+
return 'Namzu: approval required';
|
|
37
|
+
switch (notification.outcome) {
|
|
38
|
+
case 'completed':
|
|
39
|
+
return 'Namzu: turn completed';
|
|
40
|
+
case 'stopped':
|
|
41
|
+
return 'Namzu: turn needs attention';
|
|
42
|
+
case 'failed':
|
|
43
|
+
return 'Namzu: turn failed';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../../src/integrations/notifications/terminal.ts"],"names":[],"mappings":"AAoBA,mEAAmE;AACnE,MAAM,UAAU,2BAA2B,CAC1C,OAAmE,EACnE,YAAkC;IAElC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAA;IACzC,OAAO,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACxC,YAAkC,EAClC,MAAkC,EAClC,MAAkC;IAElC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,uCAAuC,EAAE,CAAA;IAChF,CAAC;IAED,IAAI,CAAC;QACJ,IAAI,MAAM,KAAK,KAAK;YAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;;YACrC,MAAM,CAAC,KAAK,CAAC,UAAU,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;QACjE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAA;IAChC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO;YACN,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAA;IACF,CAAC;AACF,CAAC;AAED,SAAS,gBAAgB,CAAC,YAAkC;IAC3D,IAAI,YAAY,CAAC,IAAI,KAAK,mBAAmB;QAAE,OAAO,0BAA0B,CAAA;IAChF,QAAQ,YAAY,CAAC,OAAO,EAAE,CAAC;QAC9B,KAAK,WAAW;YACf,OAAO,uBAAuB,CAAA;QAC/B,KAAK,SAAS;YACb,OAAO,6BAA6B,CAAA;QACrC,KAAK,QAAQ;YACZ,OAAO,oBAAoB,CAAA;IAC7B,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PluginLifecycleManager, SkillRegistry, type ToolRegistry } from '@namzu/sdk';
|
|
2
|
+
import type { PluginConfig } from '../../config/schema.js';
|
|
3
|
+
export interface CliPluginRuntime {
|
|
4
|
+
readonly manager: PluginLifecycleManager;
|
|
5
|
+
readonly skills: SkillRegistry;
|
|
6
|
+
readonly pluginCount: number;
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Build the executable extension runtime owned by one agent session.
|
|
11
|
+
*
|
|
12
|
+
* The exact `enabled === true` check is the default-off boundary. Nothing in
|
|
13
|
+
* the plugin directories is discovered, read, or imported on every other
|
|
14
|
+
* value. Callers invoke this only after project trust has pinned `cwd`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createCliPluginRuntime(config: PluginConfig | undefined, tools: ToolRegistry, cwd: string): Promise<CliPluginRuntime | undefined>;
|
|
17
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/integrations/plugins/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,sBAAsB,EAEtB,aAAa,EAEb,KAAK,YAAY,EAEjB,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,wBAAwB,CAAA;AAGvE,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAA;IACxC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAMD;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAmFvC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { PluginLifecycleManager, PluginRegistry, SkillRegistry, SkillTool, discoverAllPluginDirs, } from '@namzu/sdk';
|
|
3
|
+
import { cliLogger } from '../../logging.js';
|
|
4
|
+
function message(error) {
|
|
5
|
+
return error instanceof Error ? error.message : String(error);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Build the executable extension runtime owned by one agent session.
|
|
9
|
+
*
|
|
10
|
+
* The exact `enabled === true` check is the default-off boundary. Nothing in
|
|
11
|
+
* the plugin directories is discovered, read, or imported on every other
|
|
12
|
+
* value. Callers invoke this only after project trust has pinned `cwd`.
|
|
13
|
+
*/
|
|
14
|
+
export async function createCliPluginRuntime(config, tools, cwd) {
|
|
15
|
+
if (config?.enabled !== true)
|
|
16
|
+
return undefined;
|
|
17
|
+
const log = cliLogger();
|
|
18
|
+
const plugins = new PluginRegistry();
|
|
19
|
+
const skills = new SkillRegistry(log);
|
|
20
|
+
const manager = new PluginLifecycleManager({
|
|
21
|
+
pluginRegistry: plugins,
|
|
22
|
+
toolRegistry: tools,
|
|
23
|
+
skillRegistry: skills,
|
|
24
|
+
scopeRoots: { project: cwd, user: homedir() },
|
|
25
|
+
log,
|
|
26
|
+
...(config.hookTimeoutMs !== undefined ? { hookTimeoutMs: config.hookTimeoutMs } : {}),
|
|
27
|
+
});
|
|
28
|
+
const allowedScopes = config.allowedScopes ?? ['project', 'user'];
|
|
29
|
+
const discovered = await discoverAllPluginDirs(cwd, {
|
|
30
|
+
enabled: true,
|
|
31
|
+
autoDiscovery: config.autoDiscovery ?? true,
|
|
32
|
+
allowedScopes,
|
|
33
|
+
log,
|
|
34
|
+
});
|
|
35
|
+
const installed = [];
|
|
36
|
+
let ownsSkillTool = false;
|
|
37
|
+
try {
|
|
38
|
+
for (const scope of allowedScopes) {
|
|
39
|
+
const dirs = [...discovered[scope]].sort((a, b) => a.localeCompare(b));
|
|
40
|
+
for (const dir of dirs) {
|
|
41
|
+
const plugin = await manager.install(dir, scope);
|
|
42
|
+
installed.push(plugin);
|
|
43
|
+
await manager.enable(plugin.id);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (skills.size > 0 && !tools.has(SkillTool.name)) {
|
|
47
|
+
tools.register(SkillTool);
|
|
48
|
+
ownsSkillTool = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (ownsSkillTool)
|
|
53
|
+
tools.unregister(SkillTool.name);
|
|
54
|
+
const cleanupErrors = [];
|
|
55
|
+
for (const plugin of [...installed].reverse()) {
|
|
56
|
+
try {
|
|
57
|
+
await manager.uninstall(plugin.id);
|
|
58
|
+
}
|
|
59
|
+
catch (cleanupError) {
|
|
60
|
+
cleanupErrors.push(cleanupError);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const cleanupSuffix = cleanupErrors.length === 0
|
|
64
|
+
? ''
|
|
65
|
+
: ` Cleanup also failed: ${cleanupErrors.map(message).join('; ')}`;
|
|
66
|
+
throw new Error(`Plugin runtime could not start: ${message(error)}.${cleanupSuffix}`, {
|
|
67
|
+
cause: error,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
let closePromise;
|
|
71
|
+
return {
|
|
72
|
+
manager,
|
|
73
|
+
skills,
|
|
74
|
+
pluginCount: installed.length,
|
|
75
|
+
close() {
|
|
76
|
+
if (closePromise)
|
|
77
|
+
return closePromise;
|
|
78
|
+
closePromise = (async () => {
|
|
79
|
+
const errors = [];
|
|
80
|
+
if (ownsSkillTool) {
|
|
81
|
+
tools.unregister(SkillTool.name);
|
|
82
|
+
ownsSkillTool = false;
|
|
83
|
+
}
|
|
84
|
+
for (const plugin of [...installed].reverse()) {
|
|
85
|
+
try {
|
|
86
|
+
await manager.uninstall(plugin.id);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
errors.push(error);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (errors.length > 0) {
|
|
93
|
+
throw new AggregateError(errors, 'One or more plugins could not be uninstalled.');
|
|
94
|
+
}
|
|
95
|
+
})();
|
|
96
|
+
return closePromise;
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/integrations/plugins/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,OAAO,EACN,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,SAAS,EAET,qBAAqB,GACrB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAS5C,SAAS,OAAO,CAAC,KAAc;IAC9B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC9D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,MAAgC,EAChC,KAAmB,EACnB,GAAW;IAEX,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IAE9C,MAAM,GAAG,GAAG,SAAS,EAAE,CAAA;IACvB,MAAM,OAAO,GAAG,IAAI,cAAc,EAAE,CAAA;IACpC,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,GAAG,CAAC,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AAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;oBAChC,aAAa,GAAG,KAAK,CAAA;gBACtB,CAAC;gBACD,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC/C,IAAI,CAAC;wBACJ,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;oBACnC,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBAChB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;oBACnB,CAAC;gBACF,CAAC;gBACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACvB,MAAM,IAAI,cAAc,CAAC,MAAM,EAAE,+CAA+C,CAAC,CAAA;gBAClF,CAAC;YACF,CAAC,CAAC,EAAE,CAAA;YACJ,OAAO,YAAY,CAAA;QACpB,CAAC;KACD,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Namzu-owned ChatGPT/Codex device authorization for machines without Codex installed. */
|
|
2
|
+
import { type CodexOAuthCredential } from './harness-credentials.js';
|
|
3
|
+
export declare const CODEX_OAUTH_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
|
|
4
|
+
export declare const CODEX_AUTH_ORIGIN = "https://auth.openai.com";
|
|
5
|
+
export type CodexDeviceLoginOutcome = {
|
|
6
|
+
readonly ok: true;
|
|
7
|
+
readonly credential: CodexOAuthCredential;
|
|
8
|
+
readonly storedAt: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly ok: false;
|
|
11
|
+
readonly reason: string;
|
|
12
|
+
};
|
|
13
|
+
export interface CodexDeviceLogin {
|
|
14
|
+
readonly url: string;
|
|
15
|
+
readonly userCode: string;
|
|
16
|
+
waitForCompletion(): Promise<CodexDeviceLoginOutcome>;
|
|
17
|
+
cancel(): void;
|
|
18
|
+
}
|
|
19
|
+
export interface CodexDeviceLoginOptions {
|
|
20
|
+
readonly home?: string;
|
|
21
|
+
readonly fetch?: typeof fetch;
|
|
22
|
+
readonly signal?: AbortSignal;
|
|
23
|
+
readonly authOrigin?: string;
|
|
24
|
+
readonly pollTimeoutMs?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function beginCodexDeviceLogin(options?: CodexDeviceLoginOptions): Promise<CodexDeviceLogin>;
|
|
27
|
+
//# sourceMappingURL=codex-device-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-device-login.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/codex-device-login.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAG3F,OAAO,EAAE,KAAK,oBAAoB,EAA6B,MAAM,0BAA0B,CAAA;AAE/F,eAAO,MAAM,qBAAqB,iCAAiC,CAAA;AACnE,eAAO,MAAM,iBAAiB,4BAA4B,CAAA;AAE1D,MAAM,MAAM,uBAAuB,GAChC;IACA,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;IACjB,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAA;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACxB,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAElD,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,iBAAiB,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAA;IACrD,MAAM,IAAI,IAAI,CAAA;CACd;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAC/B;AAyMD,wBAAsB,qBAAqB,CAC1C,OAAO,GAAE,uBAA4B,GACnC,OAAO,CAAC,gBAAgB,CAAC,CA2B3B"}
|