neoctl 0.2.27 → 0.2.29

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.
Files changed (135) hide show
  1. package/README.md +35 -47
  2. package/dist/agents/agent-definition.js +1 -1
  3. package/dist/agents/agent-definition.js.map +1 -1
  4. package/dist/agents/agent-tool.js +1 -1
  5. package/dist/agents/agent-tool.js.map +1 -1
  6. package/dist/agents/smoke-agents.js +2 -2
  7. package/dist/agents/smoke-agents.js.map +1 -1
  8. package/dist/context/compaction.js +8 -5
  9. package/dist/context/compaction.js.map +1 -1
  10. package/dist/context/context-manager.d.ts +8 -9
  11. package/dist/context/context-manager.js +33 -41
  12. package/dist/context/context-manager.js.map +1 -1
  13. package/dist/context/prompts.js +1 -1
  14. package/dist/context/prompts.js.map +1 -1
  15. package/dist/context/smoke-context.js +30 -8
  16. package/dist/context/smoke-context.js.map +1 -1
  17. package/dist/core/context-metrics.d.ts +1 -1
  18. package/dist/core/context-metrics.js +5 -3
  19. package/dist/core/context-metrics.js.map +1 -1
  20. package/dist/core/message-pipeline.js +13 -21
  21. package/dist/core/message-pipeline.js.map +1 -1
  22. package/dist/core/prompt-cache-key.d.ts +10 -0
  23. package/dist/core/prompt-cache-key.js +34 -0
  24. package/dist/core/prompt-cache-key.js.map +1 -0
  25. package/dist/core/prompt-cache-telemetry.d.ts +2 -1
  26. package/dist/core/prompt-cache-telemetry.js +23 -1
  27. package/dist/core/prompt-cache-telemetry.js.map +1 -1
  28. package/dist/core/query-engine.d.ts +6 -5
  29. package/dist/core/query-engine.js +18 -18
  30. package/dist/core/query-engine.js.map +1 -1
  31. package/dist/core/query.d.ts +0 -1
  32. package/dist/core/query.js +22 -14
  33. package/dist/core/query.js.map +1 -1
  34. package/dist/core/run-agent.d.ts +0 -1
  35. package/dist/core/run-agent.js +0 -1
  36. package/dist/core/run-agent.js.map +1 -1
  37. package/dist/core/smoke-core-loop.js +27 -3
  38. package/dist/core/smoke-core-loop.js.map +1 -1
  39. package/dist/core/state.d.ts +0 -2
  40. package/dist/core/state.js +0 -1
  41. package/dist/core/state.js.map +1 -1
  42. package/dist/index.d.ts +1 -2
  43. package/dist/index.js +1 -2
  44. package/dist/index.js.map +1 -1
  45. package/dist/model/config.d.ts +2 -9
  46. package/dist/model/config.js +3 -31
  47. package/dist/model/config.js.map +1 -1
  48. package/dist/model/env.js +2 -10
  49. package/dist/model/env.js.map +1 -1
  50. package/dist/model/model-gateway.d.ts +0 -6
  51. package/dist/model/model-gateway.js.map +1 -1
  52. package/dist/model/model-metadata.json +0 -40
  53. package/dist/model/openai-adapter.d.ts +2 -1
  54. package/dist/model/openai-adapter.js +19 -0
  55. package/dist/model/openai-adapter.js.map +1 -1
  56. package/dist/model/openai-chat-mapper.d.ts +0 -1
  57. package/dist/model/openai-chat-mapper.js +13 -9
  58. package/dist/model/openai-chat-mapper.js.map +1 -1
  59. package/dist/model/openai-mappers.d.ts +4 -4
  60. package/dist/model/openai-mappers.js +23 -17
  61. package/dist/model/openai-mappers.js.map +1 -1
  62. package/dist/model/openai-responses-mapper.js +76 -35
  63. package/dist/model/openai-responses-mapper.js.map +1 -1
  64. package/dist/model/provider-factory.js +1 -22
  65. package/dist/model/provider-factory.js.map +1 -1
  66. package/dist/model/smoke-responses-mapper.js +82 -3
  67. package/dist/model/smoke-responses-mapper.js.map +1 -1
  68. package/dist/repl/commands.js +5 -2
  69. package/dist/repl/commands.js.map +1 -1
  70. package/dist/repl/index.js +85 -129
  71. package/dist/repl/index.js.map +1 -1
  72. package/dist/repl/run-command.d.ts +37 -0
  73. package/dist/repl/run-command.js +167 -0
  74. package/dist/repl/run-command.js.map +1 -0
  75. package/dist/repl/smoke-run-command.js +43 -0
  76. package/dist/repl/smoke-run-command.js.map +1 -0
  77. package/dist/secrets/smoke-secrets.js +5 -4
  78. package/dist/secrets/smoke-secrets.js.map +1 -1
  79. package/dist/session/session-export.d.ts +0 -1
  80. package/dist/session/session-export.js +0 -1
  81. package/dist/session/session-export.js.map +1 -1
  82. package/dist/session/smoke-session.js +6 -2
  83. package/dist/session/smoke-session.js.map +1 -1
  84. package/dist/tools/builtins/exec-process-manager.d.ts +78 -0
  85. package/dist/tools/builtins/exec-process-manager.js +394 -0
  86. package/dist/tools/builtins/exec-process-manager.js.map +1 -0
  87. package/dist/tools/builtins/exec-pty-host.d.ts +1 -0
  88. package/dist/tools/builtins/exec-pty-host.js +70 -0
  89. package/dist/tools/builtins/exec-pty-host.js.map +1 -0
  90. package/dist/tools/builtins/exec-tool.d.ts +16 -27
  91. package/dist/tools/builtins/exec-tool.js +153 -324
  92. package/dist/tools/builtins/exec-tool.js.map +1 -1
  93. package/dist/tools/builtins/image-generation-tool.d.ts +0 -4
  94. package/dist/tools/builtins/image-generation-tool.js +59 -185
  95. package/dist/tools/builtins/image-generation-tool.js.map +1 -1
  96. package/dist/tools/smoke-exec-process.d.ts +1 -0
  97. package/dist/tools/smoke-exec-process.js +42 -0
  98. package/dist/tools/smoke-exec-process.js.map +1 -0
  99. package/dist/tools/smoke-tool-system.js +28 -36
  100. package/dist/tools/smoke-tool-system.js.map +1 -1
  101. package/dist/types/events.d.ts +8 -0
  102. package/dist/types/messages.d.ts +5 -0
  103. package/dist/types/messages.js +14 -0
  104. package/dist/types/messages.js.map +1 -1
  105. package/dist/web/html.js +76 -29
  106. package/dist/web/html.js.map +1 -1
  107. package/dist/web/index.d.ts +94 -37
  108. package/dist/web/index.js +345 -117
  109. package/dist/web/index.js.map +1 -1
  110. package/dist/web/plan-payload.d.ts +14 -0
  111. package/dist/web/plan-payload.js +27 -0
  112. package/dist/web/plan-payload.js.map +1 -0
  113. package/dist/web/runtime-context-protocol.d.ts +46 -0
  114. package/dist/web/runtime-context-protocol.js +72 -0
  115. package/dist/web/runtime-context-protocol.js.map +1 -0
  116. package/dist/web/smoke-plan-payload.d.ts +1 -0
  117. package/dist/web/smoke-plan-payload.js +30 -0
  118. package/dist/web/smoke-plan-payload.js.map +1 -0
  119. package/dist/web/smoke-runtime-context-protocol.d.ts +1 -0
  120. package/dist/web/smoke-runtime-context-protocol.js +31 -0
  121. package/dist/web/smoke-runtime-context-protocol.js.map +1 -0
  122. package/dist/web/smoke-web-queue.d.ts +1 -0
  123. package/dist/web/smoke-web-queue.js +7 -0
  124. package/dist/web/smoke-web-queue.js.map +1 -0
  125. package/package.json +7 -2
  126. package/scripts/verify-ripgrep.cjs +8 -8
  127. package/dist/model/anthropic-adapter.d.ts +0 -30
  128. package/dist/model/anthropic-adapter.js +0 -106
  129. package/dist/model/anthropic-adapter.js.map +0 -1
  130. package/dist/model/anthropic-mapper.d.ts +0 -13
  131. package/dist/model/anthropic-mapper.js +0 -508
  132. package/dist/model/anthropic-mapper.js.map +0 -1
  133. package/dist/model/smoke-anthropic-mapper.js +0 -89
  134. package/dist/model/smoke-anthropic-mapper.js.map +0 -1
  135. /package/dist/{model/smoke-anthropic-mapper.d.ts → repl/smoke-run-command.d.ts} +0 -0
@@ -0,0 +1,46 @@
1
+ import type { SessionPromptExportSnapshot } from "../session/session-export.js";
2
+ import type { JsonSchema } from "../tools/tool.js";
3
+ export declare const WEB_RUNTIME_CONTEXT_PROTOCOL_VERSION: 1;
4
+ export interface WebRuntimePromptSection {
5
+ name: string;
6
+ content: string;
7
+ cacheStable: boolean;
8
+ chars: number;
9
+ }
10
+ export interface WebRuntimeToolDefinition {
11
+ name: string;
12
+ description: string;
13
+ inputSchema: JsonSchema;
14
+ strict: boolean;
15
+ }
16
+ export interface WebRuntimeContextPayload {
17
+ protocolVersion: typeof WEB_RUNTIME_CONTEXT_PROTOCOL_VERSION;
18
+ revision: number;
19
+ generatedAt: string;
20
+ sessionId?: string;
21
+ model?: string;
22
+ reasoning?: unknown;
23
+ prompt: {
24
+ systemPrompt: string;
25
+ chars: number;
26
+ stableSections: number;
27
+ dynamicSections: number;
28
+ sections: WebRuntimePromptSection[];
29
+ appPrompt?: unknown;
30
+ userContext?: unknown;
31
+ systemContext?: unknown;
32
+ userContextPrompt?: string;
33
+ };
34
+ tools: WebRuntimeToolDefinition[];
35
+ capabilities: {
36
+ commands: string[];
37
+ agents: string[];
38
+ skills: string[];
39
+ plugins: string[];
40
+ };
41
+ }
42
+ export declare function createWebRuntimeContextPayload(snapshot: SessionPromptExportSnapshot, options: {
43
+ revision: number;
44
+ sessionId?: string;
45
+ generatedAt?: string;
46
+ }): WebRuntimeContextPayload;
@@ -0,0 +1,72 @@
1
+ export const WEB_RUNTIME_CONTEXT_PROTOCOL_VERSION = 1;
2
+ export function createWebRuntimeContextPayload(snapshot, options) {
3
+ const sections = normalizePromptSections(snapshot.promptSections);
4
+ const systemPrompt = typeof snapshot.systemPrompt === "string" ? snapshot.systemPrompt : "";
5
+ return {
6
+ protocolVersion: WEB_RUNTIME_CONTEXT_PROTOCOL_VERSION,
7
+ revision: options.revision,
8
+ generatedAt: options.generatedAt ?? new Date().toISOString(),
9
+ sessionId: options.sessionId,
10
+ model: snapshot.model,
11
+ reasoning: snapshot.reasoning,
12
+ prompt: {
13
+ systemPrompt,
14
+ chars: systemPrompt.length,
15
+ stableSections: sections.filter((section) => section.cacheStable).length,
16
+ dynamicSections: sections.filter((section) => !section.cacheStable).length,
17
+ sections,
18
+ appPrompt: snapshot.appPrompt,
19
+ userContext: snapshot.userContext,
20
+ systemContext: snapshot.systemContext,
21
+ userContextPrompt: snapshot.userContextPrompt,
22
+ },
23
+ tools: normalizeToolDefinitions(snapshot.toolDefinitions),
24
+ capabilities: {
25
+ commands: normalizeStringArray(snapshot.commands),
26
+ agents: normalizeStringArray(snapshot.agents),
27
+ skills: normalizeStringArray(snapshot.skills),
28
+ plugins: normalizeStringArray(snapshot.plugins),
29
+ },
30
+ };
31
+ }
32
+ function normalizePromptSections(value) {
33
+ if (!Array.isArray(value))
34
+ return [];
35
+ return value.flatMap((section) => {
36
+ if (!isRecord(section) || typeof section.name !== "string" || typeof section.content !== "string")
37
+ return [];
38
+ return [{
39
+ name: section.name,
40
+ content: section.content,
41
+ cacheStable: section.cacheStable !== false,
42
+ chars: section.content.length,
43
+ }];
44
+ });
45
+ }
46
+ function normalizeToolDefinitions(value) {
47
+ if (!Array.isArray(value))
48
+ return [];
49
+ return value.flatMap((tool) => {
50
+ if (!isToolDefinition(tool))
51
+ return [];
52
+ return [{
53
+ name: tool.name,
54
+ description: tool.description,
55
+ inputSchema: tool.inputSchema,
56
+ strict: tool.strict === true,
57
+ }];
58
+ });
59
+ }
60
+ function isToolDefinition(value) {
61
+ return isRecord(value)
62
+ && typeof value.name === "string"
63
+ && typeof value.description === "string"
64
+ && isRecord(value.inputSchema);
65
+ }
66
+ function normalizeStringArray(value) {
67
+ return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
68
+ }
69
+ function isRecord(value) {
70
+ return typeof value === "object" && value !== null && !Array.isArray(value);
71
+ }
72
+ //# sourceMappingURL=runtime-context-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-context-protocol.js","sourceRoot":"","sources":["../../src/web/runtime-context-protocol.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAU,CAAC;AA2C/D,MAAM,UAAU,8BAA8B,CAC5C,QAAqC,EACrC,OAAuE;IAEvE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAClE,MAAM,YAAY,GAAG,OAAO,QAAQ,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,OAAO;QACL,eAAe,EAAE,oCAAoC;QACrD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC5D,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,MAAM,EAAE;YACN,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 -0,0 +1,30 @@
1
+ import assert from "node:assert/strict";
2
+ import { isWebPlanPayload, serializeWebPlanPayload } from "./plan-payload.js";
3
+ const plan = {
4
+ title: "Nested plan",
5
+ summary: "2/6 completed",
6
+ total: 6,
7
+ completed: 2,
8
+ items: [
9
+ { description: "Top-level complete", status: "completed" },
10
+ {
11
+ description: "Generate images",
12
+ status: "in_progress",
13
+ subitems: [
14
+ { description: "Image one", status: "completed" },
15
+ { description: "Image two", status: "in_progress" },
16
+ { description: "Image three", status: "pending" },
17
+ ],
18
+ },
19
+ { description: "Publish", status: "pending" },
20
+ ],
21
+ };
22
+ assert.equal(isWebPlanPayload(plan), true);
23
+ if (!isWebPlanPayload(plan))
24
+ throw new Error("nested plan payload was rejected");
25
+ const restored = JSON.parse(serializeWebPlanPayload(plan));
26
+ assert.equal(restored.items.length, 3);
27
+ assert.equal(restored.items[1].subitems.length, 3);
28
+ assert.equal(restored.items[1].subitems[1].description, "Image two");
29
+ console.log("web plan payload smoke ok");
30
+ //# sourceMappingURL=smoke-plan-payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoke-plan-payload.js","sourceRoot":"","sources":["../../src/web/smoke-plan-payload.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,CAAC;IACR,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE;QACL,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE;QAC1D;YACE,WAAW,EAAE,iBAAiB;YAC9B,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE;gBACR,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE;gBACjD,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE;gBACnD,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE;aAClD;SACF;QACD,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE;KAC9C;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;IAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACjF,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3D,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACvC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AACnD,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAErE,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ import assert from "node:assert/strict";
2
+ import { createWebRuntimeContextPayload, WEB_RUNTIME_CONTEXT_PROTOCOL_VERSION } from "./runtime-context-protocol.js";
3
+ const payload = createWebRuntimeContextPayload({
4
+ model: "gpt-5.6-sol",
5
+ systemPrompt: "stable\n__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__\ndynamic",
6
+ promptSections: [
7
+ { name: "Agent Scaffold", content: "stable", cacheStable: true },
8
+ { name: "Runtime", content: "dynamic", cacheStable: false },
9
+ ],
10
+ toolDefinitions: [{
11
+ name: "read",
12
+ description: "Read a file",
13
+ inputSchema: { type: "object", properties: { path: { type: "string" } }, required: ["path"] },
14
+ strict: false,
15
+ }],
16
+ commands: ["/help"],
17
+ agents: [],
18
+ skills: ["documents"],
19
+ plugins: [],
20
+ userContext: { currentDate: "2026-08-31" },
21
+ systemContext: { cwd: "C:/workspace", platform: "win32" },
22
+ }, { revision: 3, sessionId: "session-1", generatedAt: "2026-08-31T00:00:00.000Z" });
23
+ assert.equal(payload.protocolVersion, WEB_RUNTIME_CONTEXT_PROTOCOL_VERSION);
24
+ assert.equal(payload.revision, 3);
25
+ assert.equal(payload.prompt.stableSections, 1);
26
+ assert.equal(payload.prompt.dynamicSections, 1);
27
+ assert.equal(payload.prompt.sections[1].content, "dynamic");
28
+ assert.equal(payload.tools[0].inputSchema.properties?.path.type, "string");
29
+ assert.deepEqual(payload.capabilities.skills, ["documents"]);
30
+ console.log("runtime context protocol smoke ok");
31
+ //# sourceMappingURL=smoke-runtime-context-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoke-runtime-context-protocol.js","sourceRoot":"","sources":["../../src/web/smoke-runtime-context-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,8BAA8B,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AAErH,MAAM,OAAO,GAAG,8BAA8B,CAAC;IAC7C,KAAK,EAAE,aAAa;IACpB,YAAY,EAAE,qDAAqD;IACnE,cAAc,EAAE;QACd,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE;QAChE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE;KAC5D;IACD,eAAe,EAAE,CAAC;YAChB,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAA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@@ -0,0 +1,7 @@
1
+ import assert from "node:assert/strict";
2
+ import { mergeWebQueuedInput } from "./index.js";
3
+ assert.equal(mergeWebQueuedInput(undefined, "first"), "first");
4
+ assert.equal(mergeWebQueuedInput("first", "second"), "first\nsecond");
5
+ assert.equal(mergeWebQueuedInput("first\n", " second "), "first\nsecond");
6
+ console.log("web queue smoke ok");
7
+ //# sourceMappingURL=smoke-web-queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoke-web-queue.js","sourceRoot":"","sources":["../../src/web/smoke-web-queue.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAC/D,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC;AACtE,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,eAAe,CAAC,CAAC;AAE5E,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neoctl",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "description": "TypeScript scaffold for a streaming agent runtime with a REPL UI layer.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,13 +43,17 @@
43
43
  "dev:web": "tsx src/web/index.ts",
44
44
  "smoke:core": "tsx src/core/smoke-core-loop.ts",
45
45
  "smoke:tools": "tsx src/tools/smoke-tool-system.ts",
46
+ "smoke:exec": "tsx src/tools/smoke-exec-process.ts",
46
47
  "smoke:context": "tsx src/context/smoke-context.ts",
47
48
  "smoke:session": "tsx src/session/smoke-session.ts",
48
49
  "smoke:agents": "tsx src/agents/smoke-agents.ts",
49
50
  "smoke:skills": "tsx src/skills/smoke-skills.ts",
50
51
  "smoke:secrets": "tsx src/secrets/smoke-secrets.ts",
51
52
  "smoke:responses": "tsx src/model/smoke-responses-mapper.ts",
52
- "smoke:anthropic": "tsx src/model/smoke-anthropic-mapper.ts",
53
+ "smoke:cli": "tsx src/repl/smoke-run-command.ts",
54
+ "smoke:web-plan": "tsx src/web/smoke-plan-payload.ts",
55
+ "smoke:web-context": "tsx src/web/smoke-runtime-context-protocol.ts",
56
+ "smoke:web-queue": "tsx src/web/smoke-web-queue.ts",
53
57
  "smoke:openai": "tsx src/model/smoke-openai.ts"
54
58
  },
55
59
  "devDependencies": {
@@ -60,6 +64,7 @@
60
64
  },
61
65
  "dependencies": {
62
66
  "@highlightjs/cdn-assets": "^11.11.1",
67
+ "@lydell/node-pty": "1.2.0-beta.14",
63
68
  "@types/react": "^19.2.4",
64
69
  "chalk": "^5.6.2",
65
70
  "figures": "^6.1.0",
@@ -28,14 +28,14 @@ for (const [platformKey, executable, format] of TARGETS) {
28
28
  }
29
29
 
30
30
  const executablePath = path.join(VENDOR_ROOT, platformKey, executable);
31
- // Packages published from Windows can lose POSIX executable mode bits in the
32
- // generated tarball. Restore them during postinstall before validating.
33
- if (process.platform !== "win32" && format !== "pe" && (fs.statSync(executablePath).mode & 0o111) === 0) {
34
- fs.chmodSync(executablePath, fs.statSync(executablePath).mode | 0o755);
35
- if ((fs.statSync(executablePath).mode & 0o111) === 0) {
36
- throw new Error(`Required ripgrep binary is not executable: ${path.relative(PROJECT_ROOT, executablePath)}`);
37
- }
38
- }
31
+ // Packages published from Windows can lose POSIX executable mode bits in the
32
+ // generated tarball. Restore them during postinstall before validating.
33
+ if (process.platform !== "win32" && format !== "pe" && (fs.statSync(executablePath).mode & 0o111) === 0) {
34
+ fs.chmodSync(executablePath, fs.statSync(executablePath).mode | 0o755);
35
+ if ((fs.statSync(executablePath).mode & 0o111) === 0) {
36
+ throw new Error(`Required ripgrep binary is not executable: ${path.relative(PROJECT_ROOT, executablePath)}`);
37
+ }
38
+ }
39
39
  assertBinaryFormat(executablePath, format, platformKey);
40
40
  const manifestPath = path.join(VENDOR_ROOT, platformKey, "manifest.json");
41
41
  const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
@@ -1,30 +0,0 @@
1
- import type { CredentialProvider } from "./credentials.js";
2
- import type { ModelGateway, ModelRequest, ModelStreamEvent, ReasoningConfig } from "./model-gateway.js";
3
- import type { ProviderAdapter, ProviderCapabilities } from "./provider-adapter.js";
4
- export interface AnthropicAdapterOptions {
5
- apiKey?: string;
6
- apiKeyEnvName?: string;
7
- credentialProvider?: CredentialProvider;
8
- baseUrl?: string;
9
- model: string;
10
- fallbackModel?: string;
11
- anthropicVersion?: string;
12
- timeoutMs?: number;
13
- streamIdleTimeoutMs?: number;
14
- maxRetries?: number;
15
- defaultMaxOutputTokens?: number;
16
- defaultReasoning?: ReasoningConfig | null;
17
- }
18
- export declare class AnthropicAdapter implements ProviderAdapter, ModelGateway {
19
- private readonly options;
20
- readonly name = "anthropic";
21
- readonly capabilities: ProviderCapabilities;
22
- private readonly credentialProvider;
23
- private readonly transport;
24
- private readonly baseUrl;
25
- constructor(options: AnthropicAdapterOptions);
26
- stream(request: ModelRequest): AsyncIterable<ModelStreamEvent>;
27
- private streamMessages;
28
- private assertRequestCapabilities;
29
- private authHeaders;
30
- }
@@ -1,106 +0,0 @@
1
- import { EnvCredentialProvider, StaticCredentialProvider } from "./credentials.js";
2
- import { ModelAPIError } from "./errors.js";
3
- import { HttpTransport } from "./http-transport.js";
4
- import { supportsImageInput } from "./context-window.js";
5
- import { streamWithRetry } from "./retry-runner.js";
6
- import { buildAnthropicRequest, normalizeAnthropicObject, normalizeAnthropicStream } from "./anthropic-mapper.js";
7
- const DEFAULT_ANTHROPIC_VERSION = "2023-06-01";
8
- export class AnthropicAdapter {
9
- options;
10
- name = "anthropic";
11
- capabilities = {
12
- streaming: true,
13
- functionTools: true,
14
- parallelToolCalls: false,
15
- structuredOutput: false,
16
- previousResponseId: false,
17
- imageInput: true,
18
- fileInput: false,
19
- reasoningConfig: true,
20
- builtInTools: false,
21
- };
22
- credentialProvider;
23
- transport = new HttpTransport(this.name);
24
- baseUrl;
25
- constructor(options) {
26
- this.options = options;
27
- this.credentialProvider =
28
- options.credentialProvider ??
29
- (options.apiKey ? new StaticCredentialProvider(options.apiKey) : new EnvCredentialProvider(options.apiKeyEnvName ?? "ANTHROPIC_API_KEY"));
30
- this.baseUrl = stripTrailingSlash(options.baseUrl ?? "https://api.anthropic.com");
31
- }
32
- async *stream(request) {
33
- this.assertRequestCapabilities(request);
34
- yield* streamWithRetry((attempt) => this.streamMessages(request, attempt), {
35
- provider: this.name,
36
- maxRetries: this.options.maxRetries ?? 2,
37
- delayMs: 3000,
38
- });
39
- }
40
- async *streamMessages(request, attempt) {
41
- const body = buildAnthropicRequest(request, this.options);
42
- const headers = await this.authHeaders();
43
- const timeoutMs = request.timeoutMs ?? this.options.timeoutMs ?? 120000;
44
- if (attempt > 0)
45
- yield { type: "provider_event", event: { type: "anthropic_retry_attempt", attempt } };
46
- if (request.stream !== false) {
47
- const response = await this.transport.sendStream({
48
- method: "POST",
49
- url: `${this.baseUrl}/v1/messages`,
50
- headers,
51
- body: { ...body, stream: true },
52
- timeoutMs,
53
- signal: request.cancellation,
54
- });
55
- yield* normalizeAnthropicStream(response.body, this.options);
56
- return;
57
- }
58
- const response = await this.transport.sendJson({
59
- method: "POST",
60
- url: `${this.baseUrl}/v1/messages`,
61
- headers,
62
- body: { ...body, stream: false },
63
- timeoutMs,
64
- signal: request.cancellation,
65
- });
66
- yield* normalizeAnthropicObject(response);
67
- }
68
- assertRequestCapabilities(request) {
69
- const model = request.model ?? this.options.model;
70
- const supported = supportsImageInput(model);
71
- if (supported === false && hasImageInput(request)) {
72
- throw new ModelAPIError({
73
- category: "unsupported_image_input",
74
- provider: this.name,
75
- message: `Model ${model} does not support image input according to static model metadata`,
76
- retryable: false,
77
- });
78
- }
79
- }
80
- async authHeaders() {
81
- const credential = await this.credentialProvider.getCredential();
82
- if (!credential) {
83
- throw new ModelAPIError({
84
- category: "auth_unavailable",
85
- provider: this.name,
86
- message: "Anthropic API key is not configured",
87
- retryable: false,
88
- });
89
- }
90
- return {
91
- "x-api-key": credential,
92
- "anthropic-version": this.options.anthropicVersion ?? DEFAULT_ANTHROPIC_VERSION,
93
- Accept: "application/json, text/event-stream",
94
- };
95
- }
96
- }
97
- function hasImageInput(request) {
98
- return request.messages.some((message) => message.blocks.some((block) => {
99
- const type = block.type;
100
- return type === "image" || type === "input_image" || (block.type === "text" && /!\[[^\]]*\]\([^\)]+\)/.test(block.text));
101
- }));
102
- }
103
- function stripTrailingSlash(value) {
104
- return value.replace(/\/+$/, "");
105
- }
106
- //# sourceMappingURL=anthropic-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"anthropic-adapter.js","sourceRoot":"","sources":["../../src/model/anthropic-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAElH,MAAM,yBAAyB,GAAG,YAAY,CAAC;AAiB/C,MAAM,OAAO,gBAAgB;IAkBE;IAjBpB,IAAI,GAAG,WAAW,CAAC;IACnB,YAAY,GAAyB;QAC5C,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE,KAAK;QACxB,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,KAAK;QACzB,UAAU,EAA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HttpJsonResponse } from "./http-transport.js";
2
- import { ModelAPIError } from "./errors.js";
3
- import type { ModelRequest, ModelStreamEvent, ReasoningConfig } from "./model-gateway.js";
4
- export interface AnthropicMapperOptions {
5
- model: string;
6
- defaultMaxOutputTokens?: number;
7
- defaultReasoning?: ReasoningConfig | null;
8
- streamIdleTimeoutMs?: number;
9
- }
10
- export declare function buildAnthropicRequest(request: ModelRequest, options: AnthropicMapperOptions): Record<string, unknown>;
11
- export declare function normalizeAnthropicStream(stream: ReadableStream<Uint8Array>, options: AnthropicMapperOptions): AsyncGenerator<ModelStreamEvent>;
12
- export declare function normalizeAnthropicObject(response: HttpJsonResponse<Record<string, unknown>>): Generator<ModelStreamEvent>;
13
- export declare function normalizeAnthropicStreamError(event: Record<string, unknown>): ModelAPIError;