linkshell-cli 0.5.42 → 0.6.1

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/dist/cli/src/commands/host.d.ts +30 -0
  2. package/dist/cli/src/commands/host.js +278 -0
  3. package/dist/cli/src/commands/host.js.map +1 -0
  4. package/dist/cli/src/commands/pair.d.ts +1 -0
  5. package/dist/cli/src/commands/pair.js +51 -0
  6. package/dist/cli/src/commands/pair.js.map +1 -0
  7. package/dist/cli/src/index.js +69 -0
  8. package/dist/cli/src/index.js.map +1 -1
  9. package/dist/cli/src/utils/daemon.d.ts +1 -1
  10. package/dist/cli/src/utils/daemon.js +3 -2
  11. package/dist/cli/src/utils/daemon.js.map +1 -1
  12. package/dist/cli/tsconfig.tsbuildinfo +1 -1
  13. package/dist/host/src/drivers/acp/connection.d.ts +61 -0
  14. package/dist/host/src/drivers/acp/connection.js +121 -0
  15. package/dist/host/src/drivers/acp/connection.js.map +1 -0
  16. package/dist/host/src/drivers/acp/driver.d.ts +110 -0
  17. package/dist/host/src/drivers/acp/driver.js +438 -0
  18. package/dist/host/src/drivers/acp/driver.js.map +1 -0
  19. package/dist/host/src/drivers/acp/mapper.d.ts +49 -0
  20. package/dist/host/src/drivers/acp/mapper.js +411 -0
  21. package/dist/host/src/drivers/acp/mapper.js.map +1 -0
  22. package/dist/host/src/drivers/auth.d.ts +7 -0
  23. package/dist/host/src/drivers/auth.js +57 -0
  24. package/dist/host/src/drivers/auth.js.map +1 -0
  25. package/dist/host/src/drivers/claude/driver.d.ts +76 -0
  26. package/dist/host/src/drivers/claude/driver.js +331 -0
  27. package/dist/host/src/drivers/claude/driver.js.map +1 -0
  28. package/dist/host/src/drivers/claude/transcript.d.ts +335 -0
  29. package/dist/host/src/drivers/claude/transcript.js +516 -0
  30. package/dist/host/src/drivers/claude/transcript.js.map +1 -0
  31. package/dist/host/src/drivers/codex/app-server.d.ts +36 -0
  32. package/dist/host/src/drivers/codex/app-server.js +144 -0
  33. package/dist/host/src/drivers/codex/app-server.js.map +1 -0
  34. package/dist/host/src/drivers/codex/driver.d.ts +89 -0
  35. package/dist/host/src/drivers/codex/driver.js +452 -0
  36. package/dist/host/src/drivers/codex/driver.js.map +1 -0
  37. package/dist/host/src/drivers/codex/mapper.d.ts +61 -0
  38. package/dist/host/src/drivers/codex/mapper.js +623 -0
  39. package/dist/host/src/drivers/codex/mapper.js.map +1 -0
  40. package/dist/host/src/drivers/codex/settings.d.ts +51 -0
  41. package/dist/host/src/drivers/codex/settings.js +107 -0
  42. package/dist/host/src/drivers/codex/settings.js.map +1 -0
  43. package/dist/host/src/drivers/images.d.ts +11 -0
  44. package/dist/host/src/drivers/images.js +34 -0
  45. package/dist/host/src/drivers/images.js.map +1 -0
  46. package/dist/host/src/drivers/nesting.d.ts +6 -0
  47. package/dist/host/src/drivers/nesting.js +25 -0
  48. package/dist/host/src/drivers/nesting.js.map +1 -0
  49. package/dist/host/src/drivers/registry.d.ts +21 -0
  50. package/dist/host/src/drivers/registry.js +30 -0
  51. package/dist/host/src/drivers/registry.js.map +1 -0
  52. package/dist/host/src/drivers/types.d.ts +105 -0
  53. package/dist/host/src/drivers/types.js +2 -0
  54. package/dist/host/src/drivers/types.js.map +1 -0
  55. package/dist/host/src/fs.d.ts +69 -0
  56. package/dist/host/src/fs.js +198 -0
  57. package/dist/host/src/fs.js.map +1 -0
  58. package/dist/host/src/gateway.d.ts +55 -0
  59. package/dist/host/src/gateway.js +263 -0
  60. package/dist/host/src/gateway.js.map +1 -0
  61. package/dist/host/src/host.d.ts +51 -0
  62. package/dist/host/src/host.js +133 -0
  63. package/dist/host/src/host.js.map +1 -0
  64. package/dist/host/src/hub.d.ts +89 -0
  65. package/dist/host/src/hub.js +592 -0
  66. package/dist/host/src/hub.js.map +1 -0
  67. package/dist/host/src/index.d.ts +10 -0
  68. package/dist/host/src/index.js +10 -0
  69. package/dist/host/src/index.js.map +1 -0
  70. package/dist/host/src/ports.d.ts +24 -0
  71. package/dist/host/src/ports.js +201 -0
  72. package/dist/host/src/ports.js.map +1 -0
  73. package/dist/host/src/rpc/client.d.ts +9 -0
  74. package/dist/host/src/rpc/client.js +42 -0
  75. package/dist/host/src/rpc/client.js.map +1 -0
  76. package/dist/host/src/rpc/server.d.ts +52 -0
  77. package/dist/host/src/rpc/server.js +293 -0
  78. package/dist/host/src/rpc/server.js.map +1 -0
  79. package/dist/host/src/screen.d.ts +30 -0
  80. package/dist/host/src/screen.js +230 -0
  81. package/dist/host/src/screen.js.map +1 -0
  82. package/dist/host/src/shell-env.d.ts +8 -0
  83. package/dist/host/src/shell-env.js +39 -0
  84. package/dist/host/src/shell-env.js.map +1 -0
  85. package/dist/host/src/store.d.ts +75 -0
  86. package/dist/host/src/store.js +265 -0
  87. package/dist/host/src/store.js.map +1 -0
  88. package/dist/host/src/terminals.d.ts +55 -0
  89. package/dist/host/src/terminals.js +367 -0
  90. package/dist/host/src/terminals.js.map +1 -0
  91. package/dist/shared-protocol/src/index.d.ts +3345 -3345
  92. package/dist/wire/src/crypto.d.ts +65 -0
  93. package/dist/wire/src/crypto.js +253 -0
  94. package/dist/wire/src/crypto.js.map +1 -0
  95. package/dist/wire/src/index.d.ts +8 -0
  96. package/dist/wire/src/index.js +9 -0
  97. package/dist/wire/src/index.js.map +1 -0
  98. package/dist/wire/src/model.d.ts +704 -0
  99. package/dist/wire/src/model.js +163 -0
  100. package/dist/wire/src/model.js.map +1 -0
  101. package/dist/wire/src/peer.d.ts +42 -0
  102. package/dist/wire/src/peer.js +143 -0
  103. package/dist/wire/src/peer.js.map +1 -0
  104. package/dist/wire/src/relay-client.d.ts +82 -0
  105. package/dist/wire/src/relay-client.js +259 -0
  106. package/dist/wire/src/relay-client.js.map +1 -0
  107. package/dist/wire/src/relay.d.ts +481 -0
  108. package/dist/wire/src/relay.js +129 -0
  109. package/dist/wire/src/relay.js.map +1 -0
  110. package/dist/wire/src/rpc.d.ts +4170 -0
  111. package/dist/wire/src/rpc.js +332 -0
  112. package/dist/wire/src/rpc.js.map +1 -0
  113. package/dist/wire/src/shell.d.ts +2 -0
  114. package/dist/wire/src/shell.js +62 -0
  115. package/dist/wire/src/shell.js.map +1 -0
  116. package/dist/wire/src/updates.d.ts +3325 -0
  117. package/dist/wire/src/updates.js +210 -0
  118. package/dist/wire/src/updates.js.map +1 -0
  119. package/package.json +8 -3
  120. package/src/commands/host.ts +297 -0
  121. package/src/commands/pair.ts +52 -0
  122. package/src/index.ts +74 -0
  123. package/src/utils/daemon.ts +4 -3
  124. package/dist/cli/src/commands/hook.d.ts +0 -6
  125. package/dist/cli/src/commands/hook.js +0 -120
  126. package/dist/cli/src/commands/hook.js.map +0 -1
  127. package/dist/cli/src/runtime/acp/agent-workspace-git.d.ts +0 -63
  128. package/dist/cli/src/runtime/acp/agent-workspace-git.js +0 -297
  129. package/dist/cli/src/runtime/acp/agent-workspace-git.js.map +0 -1
  130. package/dist/cli/src/runtime/acp-relay.d.ts +0 -23
  131. package/dist/cli/src/runtime/acp-relay.js +0 -73
  132. package/dist/cli/src/runtime/acp-relay.js.map +0 -1
  133. package/dist/cli/src/runtime/hook-permission-server.d.ts +0 -36
  134. package/dist/cli/src/runtime/hook-permission-server.js +0 -147
  135. package/dist/cli/src/runtime/hook-permission-server.js.map +0 -1
@@ -0,0 +1,51 @@
1
+ import type { SessionConfigOption } from "@linkshell/wire";
2
+ export interface CodexModel {
3
+ id: string;
4
+ model: string;
5
+ displayName: string;
6
+ description?: string;
7
+ hidden?: boolean;
8
+ isDefault?: boolean;
9
+ defaultReasoningEffort?: string;
10
+ supportedReasoningEfforts?: {
11
+ reasoningEffort: string;
12
+ description?: string;
13
+ }[];
14
+ }
15
+ type SandboxPolicy = {
16
+ type: string;
17
+ [key: string]: unknown;
18
+ };
19
+ export interface CodexSettings {
20
+ model?: string;
21
+ effort?: string | null;
22
+ approvalPolicy?: unknown;
23
+ sandbox?: SandboxPolicy;
24
+ }
25
+ /** What the thread should switch to on its next turn. */
26
+ export interface CodexOverrides {
27
+ model?: string;
28
+ effort?: string;
29
+ permissions?: string;
30
+ }
31
+ /** The Codex TUI's `/approvals` presets. */
32
+ export declare const PERMISSION_PRESETS: {
33
+ id: string;
34
+ name: string;
35
+ description: string;
36
+ approvalPolicy: string;
37
+ sandboxPolicy: SandboxPolicy;
38
+ }[];
39
+ export declare function presetOf(settings: CodexSettings): string | undefined;
40
+ export declare function settingsFrom(response: Record<string, unknown>): CodexSettings;
41
+ /** The settings the thread will run with, overrides applied. */
42
+ export declare function effective(settings: CodexSettings, overrides: CodexOverrides, models: CodexModel[]): {
43
+ model: string | undefined;
44
+ info: CodexModel | undefined;
45
+ effort: string | undefined;
46
+ permissions: string | undefined;
47
+ };
48
+ export declare function configOptions(settings: CodexSettings, overrides: CodexOverrides, models: CodexModel[]): SessionConfigOption[];
49
+ /** `turn/start` parameters for the pending overrides. */
50
+ export declare function turnOverrides(overrides: CodexOverrides): Record<string, unknown>;
51
+ export {};
@@ -0,0 +1,107 @@
1
+ /** The Codex TUI's `/approvals` presets. */
2
+ export const PERMISSION_PRESETS = [
3
+ {
4
+ id: "read-only",
5
+ name: "Read only",
6
+ description: "Can read files; asks before editing or running commands",
7
+ approvalPolicy: "on-request",
8
+ sandboxPolicy: { type: "readOnly", networkAccess: false },
9
+ },
10
+ {
11
+ id: "auto",
12
+ name: "Auto",
13
+ description: "Edits and runs commands in the workspace; asks before anything else",
14
+ approvalPolicy: "on-request",
15
+ sandboxPolicy: { type: "workspaceWrite", writableRoots: [], networkAccess: false, excludeTmpdirEnvVar: false, excludeSlashTmp: false },
16
+ },
17
+ {
18
+ id: "full-access",
19
+ name: "Full access",
20
+ description: "Edits and runs anything without asking",
21
+ approvalPolicy: "never",
22
+ sandboxPolicy: { type: "dangerFullAccess" },
23
+ },
24
+ ];
25
+ export function presetOf(settings) {
26
+ switch (settings.sandbox?.type) {
27
+ case "readOnly":
28
+ return "read-only";
29
+ case "workspaceWrite":
30
+ return "auto";
31
+ case "dangerFullAccess":
32
+ return settings.approvalPolicy === "never" ? "full-access" : undefined;
33
+ default:
34
+ return undefined;
35
+ }
36
+ }
37
+ export function settingsFrom(response) {
38
+ return {
39
+ model: typeof response.model === "string" ? response.model : undefined,
40
+ effort: typeof response.reasoningEffort === "string" ? response.reasoningEffort : null,
41
+ approvalPolicy: response.approvalPolicy,
42
+ sandbox: response.sandbox && typeof response.sandbox === "object" ? response.sandbox : undefined,
43
+ };
44
+ }
45
+ function findModel(models, id) {
46
+ if (!id)
47
+ return undefined;
48
+ return models.find((m) => m.model === id || m.id === id);
49
+ }
50
+ /** The settings the thread will run with, overrides applied. */
51
+ export function effective(settings, overrides, models) {
52
+ const model = overrides.model ?? settings.model ?? models.find((m) => m.isDefault)?.model;
53
+ const info = findModel(models, model);
54
+ const supported = info?.supportedReasoningEfforts?.map((e) => e.reasoningEffort) ?? [];
55
+ let effort = overrides.effort ?? settings.effort ?? info?.defaultReasoningEffort;
56
+ if (effort && supported.length > 0 && !supported.includes(effort))
57
+ effort = info?.defaultReasoningEffort;
58
+ const permissions = overrides.permissions ?? presetOf(settings);
59
+ return { model, info, effort, permissions };
60
+ }
61
+ export function configOptions(settings, overrides, models) {
62
+ const { model, info, effort, permissions } = effective(settings, overrides, models);
63
+ const options = [];
64
+ const visible = models.filter((m) => !m.hidden || m.model === model);
65
+ if (model && visible.length > 0) {
66
+ const values = visible.map((m) => ({ value: m.model, name: m.displayName || m.model, description: m.description || undefined }));
67
+ if (!values.some((v) => v.value === model))
68
+ values.unshift({ value: model, name: model, description: undefined });
69
+ options.push({ id: "model", name: "Model", category: "model", current: model, values });
70
+ }
71
+ const efforts = info?.supportedReasoningEfforts ?? [];
72
+ if (effort && efforts.length > 1) {
73
+ options.push({
74
+ id: "effort",
75
+ name: "Reasoning effort",
76
+ category: "effort",
77
+ current: effort,
78
+ values: efforts.map((e) => ({ value: e.reasoningEffort, name: e.reasoningEffort, description: e.description || undefined })),
79
+ });
80
+ }
81
+ options.push({
82
+ id: "permissions",
83
+ name: "Permissions",
84
+ category: "mode",
85
+ current: permissions ?? "custom",
86
+ values: [
87
+ ...(permissions ? [] : [{ value: "custom", name: "Custom", description: "Set in Codex's own config" }]),
88
+ ...PERMISSION_PRESETS.map((p) => ({ value: p.id, name: p.name, description: p.description })),
89
+ ],
90
+ });
91
+ return options;
92
+ }
93
+ /** `turn/start` parameters for the pending overrides. */
94
+ export function turnOverrides(overrides) {
95
+ const params = {};
96
+ if (overrides.model)
97
+ params.model = overrides.model;
98
+ if (overrides.effort)
99
+ params.effort = overrides.effort;
100
+ const preset = PERMISSION_PRESETS.find((p) => p.id === overrides.permissions);
101
+ if (preset) {
102
+ params.approvalPolicy = preset.approvalPolicy;
103
+ params.sandboxPolicy = preset.sandboxPolicy;
104
+ }
105
+ return params;
106
+ }
107
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../../host/src/drivers/codex/settings.ts"],"names":[],"mappings":"AAiCA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,kBAAkB,GAMzB;IACJ;QACE,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,yDAAyD;QACtE,cAAc,EAAE,YAAY;QAC5B,aAAa,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE;KAC1D;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,qEAAqE;QAClF,cAAc,EAAE,YAAY;QAC5B,aAAa,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,aAAa,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;KACvI;IACD;QACE,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,wCAAwC;QACrD,cAAc,EAAE,OAAO;QACvB,aAAa,E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AAQ,EAAE,MAAM;QAChB,OAAO,EAAE,WAAW,IAAI,QAAQ;QAChC,MAAM,EAAE;YACN,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC,CAAC;YACvG,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;SAC9F;KACF,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,aAAa,CAAC,SAAyB;IACrD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,IAAI,SAAS,CAAC,KAAK;QAAE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;IACpD,IAAI,SAAS,CAAC,MAAM;QAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IACvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC,WAAW,CAAC,CAAC;IAC9E,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC9C,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IAC9C,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ContentBlock } from "@linkshell/wire";
2
+ /** Largest image forwarded inline (base64 bytes). */
3
+ export declare const MAX_INLINE_IMAGE: number;
4
+ /** An inline image block, or undefined when the data is missing, too big or not base64. */
5
+ export declare function inlineImage(data: string | undefined, mimeType: string | undefined): Extract<ContentBlock, {
6
+ type: "image";
7
+ }> | undefined;
8
+ /** A local image file, inlined so a client on another device can show it. */
9
+ export declare function imageFromPath(path: string | undefined): Extract<ContentBlock, {
10
+ type: "image";
11
+ }> | undefined;
@@ -0,0 +1,34 @@
1
+ import { readFileSync, statSync } from "node:fs";
2
+ // Images every driver forwards the same way: inline base64, bounded in size so
3
+ // one screenshot can't bloat the event log.
4
+ /** Largest image forwarded inline (base64 bytes). */
5
+ export const MAX_INLINE_IMAGE = 4 * 1024 * 1024;
6
+ const IMAGE_TYPES = {
7
+ png: "image/png",
8
+ jpg: "image/jpeg",
9
+ jpeg: "image/jpeg",
10
+ gif: "image/gif",
11
+ webp: "image/webp",
12
+ heic: "image/heic",
13
+ };
14
+ /** An inline image block, or undefined when the data is missing, too big or not base64. */
15
+ export function inlineImage(data, mimeType) {
16
+ if (!data || data.length > MAX_INLINE_IMAGE || !/^[A-Za-z0-9+/=\s]+$/.test(data.slice(0, 256)))
17
+ return undefined;
18
+ return { type: "image", mimeType: mimeType && mimeType.startsWith("image/") ? mimeType : "image/png", data };
19
+ }
20
+ /** A local image file, inlined so a client on another device can show it. */
21
+ export function imageFromPath(path) {
22
+ const mimeType = path ? IMAGE_TYPES[path.split(".").pop()?.toLowerCase() ?? ""] : undefined;
23
+ if (!path || !mimeType)
24
+ return undefined;
25
+ try {
26
+ if (statSync(path).size * 1.37 > MAX_INLINE_IMAGE)
27
+ return undefined;
28
+ return inlineImage(readFileSync(path).toString("base64"), mimeType);
29
+ }
30
+ catch {
31
+ return undefined;
32
+ }
33
+ }
34
+ //# sourceMappingURL=images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.js","sourceRoot":"","sources":["../../../../../host/src/drivers/images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGjD,+EAA+E;AAC/E,4CAA4C;AAE5C,qD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E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { SessionUpdate } from "@linkshell/wire";
2
+ import type { HistoryItem } from "./types.js";
3
+ /** Marks a sub-agent's update as belonging to `parent`; drops what a sub-agent can't own (its prompt, usage, config…). */
4
+ export declare function nestUnder(update: SessionUpdate, parent: string): SessionUpdate | undefined;
5
+ /** A sub-agent's history items, nested under `parent`, with ids that can't collide with the parent's. */
6
+ export declare function nestHistory(items: HistoryItem[], parent: string): HistoryItem[];
@@ -0,0 +1,25 @@
1
+ // Sub-agents, for every driver: a sub-agent's own messages, tool calls and turn
2
+ // state are carried on the parent session, marked with the tool call that
3
+ // spawned it. Clients nest them under that call.
4
+ /** Marks a sub-agent's update as belonging to `parent`; drops what a sub-agent can't own (its prompt, usage, config…). */
5
+ export function nestUnder(update, parent) {
6
+ switch (update.sessionUpdate) {
7
+ case "agent_message_chunk":
8
+ case "agent_thought_chunk":
9
+ case "tool_call":
10
+ case "tool_call_update":
11
+ case "ls_message_done":
12
+ case "ls_turn":
13
+ return { ...update, parentToolCallId: parent };
14
+ default:
15
+ return undefined;
16
+ }
17
+ }
18
+ /** A sub-agent's history items, nested under `parent`, with ids that can't collide with the parent's. */
19
+ export function nestHistory(items, parent) {
20
+ return items.flatMap((item) => {
21
+ const updates = item.updates.flatMap((update) => nestUnder(update, parent) ?? []);
22
+ return updates.length > 0 ? [{ ...item, itemId: `sub:${parent}:${item.itemId}`, updates }] : [];
23
+ });
24
+ }
25
+ //# sourceMappingURL=nesting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nesting.js","sourceRoot":"","sources":["../../../../../host/src/drivers/nesting.ts"],"names":[],"mappings":"AAGA,gFAAgF;AAChF,0EAA0E;AAC1E,iDAAiD;AAEjD,0HAA0H;AAC1H,MAAM,UAAU,SAAS,CAAC,MAAqB,EAAE,MAAc;IAC7D,QAAQ,MAAM,CAAC,aAAa,EAAE,CAAC;QAC7B,KAAK,qBAAqB,CAAC;QAC3B,KAAK,qBAAqB,CAAC;QAC3B,KAAK,WAAW,CAAC;QACjB,KAAK,kBAAkB,CAAC;QACxB,KAAK,iBAAiB,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,EAAE,GAAG,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,CAAC;QACjD;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,yGAAyG;AACzG,MAAM,UAAU,WAAW,CAAC,KAAoB,EAAE,MAAc;IAC9D,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAClF,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { AgentDriver } from "./types.js";
2
+ import { type AcpAgentSpec } from "./acp/driver.js";
3
+ /**
4
+ * ACP agents LinkShell drives generically. Launch commands are the ones each
5
+ * CLI documents for its ACP server mode; agents that aren't installed are
6
+ * listed as such. Tier "remote": the phone gets full control, the desktop uses
7
+ * LinkShell's own UI rather than the agent's TUI.
8
+ */
9
+ export declare const ACP_AGENTS: AcpAgentSpec[];
10
+ export interface DefaultDriverOptions {
11
+ env?: NodeJS.ProcessEnv;
12
+ hostVersion: string;
13
+ codexSocket: string;
14
+ codexCommand?: string;
15
+ claudeCommand?: string;
16
+ claudeAdapter?: {
17
+ command: string;
18
+ args: string[];
19
+ };
20
+ }
21
+ export declare function defaultDrivers(options: DefaultDriverOptions): AgentDriver[];
@@ -0,0 +1,30 @@
1
+ import { AcpDriver } from "./acp/driver.js";
2
+ import { ClaudeDriver } from "./claude/driver.js";
3
+ import { CodexDriver } from "./codex/driver.js";
4
+ /**
5
+ * ACP agents LinkShell drives generically. Launch commands are the ones each
6
+ * CLI documents for its ACP server mode; agents that aren't installed are
7
+ * listed as such. Tier "remote": the phone gets full control, the desktop uses
8
+ * LinkShell's own UI rather than the agent's TUI.
9
+ */
10
+ export const ACP_AGENTS = [
11
+ { id: "gemini", label: "Gemini", tier: "remote", command: "gemini", args: ["--acp"] },
12
+ // Lists sessions over ACP (including ones made in its own CLI).
13
+ { id: "copilot", label: "Copilot", tier: "remote", command: "copilot", args: ["--acp"], discover: true },
14
+ { id: "grok", label: "Grok", tier: "remote", command: "grok", args: ["agent", "stdio"], discover: true },
15
+ { id: "opencode", label: "OpenCode", tier: "remote", command: "opencode", args: ["acp"] },
16
+ { id: "cursor", label: "Cursor", tier: "remote", command: "cursor-agent", args: ["acp"] },
17
+ ];
18
+ export function defaultDrivers(options) {
19
+ return [
20
+ new CodexDriver({ socketPath: options.codexSocket, command: options.codexCommand, env: options.env, hostVersion: options.hostVersion }),
21
+ new ClaudeDriver({
22
+ env: options.env,
23
+ hostVersion: options.hostVersion,
24
+ claudeCommand: options.claudeCommand,
25
+ adapter: options.claudeAdapter,
26
+ }),
27
+ ...ACP_AGENTS.map((spec) => new AcpDriver(spec, { env: options.env, hostVersion: options.hostVersion })),
28
+ ];
29
+ }
30
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../host/src/drivers/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAqB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,C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CAAC,aAAa;YACpC,OAAO,EAAE,OAAO,CAAC,aAAa;SAC/B,CAAC;QACF,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;KACzG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,105 @@
1
+ import type { AgentAuth, AgentCapabilities, AgentTier, ContentBlock, SessionState, SessionUpdate } from "@linkshell/wire";
2
+ /** A session the agent knows about, however it was created. */
3
+ export interface DiscoveredSession {
4
+ nativeId: string;
5
+ cwd: string;
6
+ title?: string;
7
+ preview?: string;
8
+ model?: string;
9
+ createdAt: number;
10
+ updatedAt: number;
11
+ state?: SessionState;
12
+ }
13
+ /**
14
+ * One completed item of native history (a message, a tool call, …) expressed as
15
+ * the updates that reproduce it. `itemId` lets the host skip items it already
16
+ * logged, so re-attaching after a restart only appends what is new.
17
+ */
18
+ export interface HistoryItem {
19
+ itemId: string;
20
+ updates: SessionUpdate[];
21
+ /** When it happened (ms), if the agent's history records it. */
22
+ ts?: number;
23
+ }
24
+ /** Callbacks a driver uses to report to the host. */
25
+ export interface DriverHost {
26
+ /** A session was created or changed outside of any client request (e.g. in the desktop TUI). */
27
+ sessionSeen(agent: string, session: DiscoveredSession): void;
28
+ /** A live update for an attached session. `itemId` marks the native item it completes, if any. */
29
+ update(agent: string, nativeId: string, update: SessionUpdate, itemId?: string): void;
30
+ /** Asks the host to attach (import history, then follow live) — e.g. a thread the TUI just opened. */
31
+ follow(agent: string, nativeId: string): Promise<void>;
32
+ /** The driver lost its live connection to a session; the host re-attaches on next use. */
33
+ detached(agent: string, nativeId: string): void;
34
+ /** The terminal currently driving a handoff session, if any. */
35
+ desktop(agent: string, nativeId: string): DesktopController | undefined;
36
+ /** Durable per-session values for the driver (survive host restarts). */
37
+ state(agent: string, nativeId: string): {
38
+ get(key: string): string | undefined;
39
+ set(key: string, value: string): void;
40
+ };
41
+ log(message: string): void;
42
+ }
43
+ export interface AttachContext {
44
+ cwd: string;
45
+ }
46
+ /** A terminal running an agent's native UI via `linkshell <agent>`. */
47
+ export interface DesktopController {
48
+ /** Asks the terminal to exit its native UI; resolves once it has (or went away). */
49
+ yield(): Promise<void>;
50
+ /** Shows a line of remote progress in the terminal. */
51
+ activity(line: string): void;
52
+ }
53
+ export interface DesktopLaunchContext {
54
+ cwd?: string;
55
+ env?: Record<string, string>;
56
+ }
57
+ export interface DesktopLaunch extends LaunchSpec {
58
+ /** Handoff agents: the session the terminal now drives. */
59
+ nativeId?: string;
60
+ cwd?: string;
61
+ }
62
+ export interface DriverStatus {
63
+ installed: boolean;
64
+ version?: string;
65
+ problem?: string;
66
+ }
67
+ export interface LaunchSpec {
68
+ command: string;
69
+ args: string[];
70
+ env?: Record<string, string>;
71
+ }
72
+ export interface AgentDriver {
73
+ readonly id: string;
74
+ readonly label: string;
75
+ readonly tier: AgentTier;
76
+ readonly capabilities: AgentCapabilities;
77
+ start(host: DriverHost): Promise<DriverStatus>;
78
+ stop(): Promise<void>;
79
+ status(): DriverStatus;
80
+ /** The agent's own report of how it is logged in. Must not read or return secrets. */
81
+ authStatus?(): Promise<AgentAuth>;
82
+ listSessions(limit: number): Promise<DiscoveredSession[]>;
83
+ createSession(options: {
84
+ cwd: string;
85
+ model?: string;
86
+ }): Promise<DiscoveredSession>;
87
+ /**
88
+ * Starts live updates for a session and returns its full native history.
89
+ * Idempotent: attaching an attached session just returns the history again.
90
+ */
91
+ attach(nativeId: string, context: AttachContext): Promise<HistoryItem[]>;
92
+ detach(nativeId: string): Promise<void>;
93
+ prompt(nativeId: string, content: ContentBlock[], clientMessageId: string): Promise<"started" | "steered" | "queued">;
94
+ cancel(nativeId: string): Promise<void>;
95
+ respondPermission(nativeId: string, requestId: string, optionId: string): Promise<void>;
96
+ setConfig?(nativeId: string, optionId: string, value: string): Promise<void>;
97
+ /** How a desktop terminal launches this agent's native UI attached to the host. */
98
+ desktopLaunch?(args: string[], nativeId: string | undefined, context: DesktopLaunchContext): DesktopLaunch | Promise<DesktopLaunch>;
99
+ /** Handoff agents: a device takes the session over from the desktop. */
100
+ takeover?(nativeId: string): Promise<void>;
101
+ /** Handoff agents: the terminal driving the session disconnected (its native UI exited). */
102
+ desktopDetached?(nativeId: string): void;
103
+ /** Handoff agents: the desktop takes the session back; returns how to relaunch the native UI. */
104
+ reclaim?(nativeId: string, context: DesktopLaunchContext): Promise<LaunchSpec>;
105
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../host/src/drivers/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,69 @@
1
+ export declare function listDirectory(input: {
2
+ path?: string;
3
+ hidden: boolean;
4
+ }): Promise<{
5
+ path: string;
6
+ parent: string | undefined;
7
+ home: string;
8
+ entries: {
9
+ path: string;
10
+ name: string;
11
+ project?: boolean | undefined;
12
+ }[];
13
+ }>;
14
+ /**
15
+ * Breadth-first under the home directory, a few levels deep, within a time
16
+ * budget: good enough to find "claude-remote" or "rtranslate" by typing.
17
+ */
18
+ export declare function searchDirectories(input: {
19
+ query: string;
20
+ limit: number;
21
+ }, budgetMs?: number): Promise<{
22
+ entries: {
23
+ path: string;
24
+ name: string;
25
+ project?: boolean | undefined;
26
+ }[];
27
+ truncated: boolean;
28
+ }>;
29
+ /** Reads a file for the phone's viewer. Text is detected by content, not extension. */
30
+ export declare function readFile(input: {
31
+ path: string;
32
+ maxBytes: number;
33
+ }): Promise<{
34
+ kind: "image";
35
+ data: string;
36
+ mimeType: string;
37
+ path: string;
38
+ size: number;
39
+ modifiedAt: number;
40
+ truncated: boolean;
41
+ } | {
42
+ kind: "binary";
43
+ path: string;
44
+ size: number;
45
+ modifiedAt: number;
46
+ truncated: boolean;
47
+ } | {
48
+ kind: "text";
49
+ text: string;
50
+ path: string;
51
+ size: number;
52
+ modifiedAt: number;
53
+ truncated: boolean;
54
+ }>;
55
+ /** Writes an uploaded file into `dir`, never over an existing one. */
56
+ export declare function uploadFile(input: {
57
+ dir: string;
58
+ name: string;
59
+ data: string;
60
+ }): Promise<{
61
+ path: string;
62
+ size: number;
63
+ }>;
64
+ export declare function makeDirectory(input: {
65
+ parent: string;
66
+ name: string;
67
+ }): Promise<{
68
+ path: string;
69
+ }>;