@linkshell/host 0.4.68 → 0.4.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/host/src/drivers/acp/antigravity.d.ts +13 -0
- package/dist/host/src/drivers/acp/antigravity.js +13 -0
- package/dist/host/src/drivers/acp/antigravity.js.map +1 -1
- package/dist/host/src/drivers/acp/driver.d.ts +23 -2
- package/dist/host/src/drivers/acp/driver.js +89 -5
- package/dist/host/src/drivers/acp/driver.js.map +1 -1
- package/dist/host/src/drivers/acp/mapper.d.ts +2 -0
- package/dist/host/src/drivers/acp/mapper.js +6 -1
- package/dist/host/src/drivers/acp/mapper.js.map +1 -1
- package/dist/host/src/drivers/claude/app-sessions.d.ts +58 -0
- package/dist/host/src/drivers/claude/app-sessions.js +183 -0
- package/dist/host/src/drivers/claude/app-sessions.js.map +1 -0
- package/dist/host/src/drivers/claude/driver.d.ts +37 -1
- package/dist/host/src/drivers/claude/driver.js +199 -9
- package/dist/host/src/drivers/claude/driver.js.map +1 -1
- package/dist/host/src/drivers/claude/holders.d.ts +3 -1
- package/dist/host/src/drivers/claude/holders.js +4 -0
- package/dist/host/src/drivers/claude/holders.js.map +1 -1
- package/dist/host/src/drivers/claude/routing.d.ts +19 -0
- package/dist/host/src/drivers/claude/routing.js +145 -0
- package/dist/host/src/drivers/claude/routing.js.map +1 -0
- package/dist/host/src/drivers/claude/transcript.d.ts +10 -0
- package/dist/host/src/drivers/claude/transcript.js +97 -22
- package/dist/host/src/drivers/claude/transcript.js.map +1 -1
- package/dist/host/src/drivers/codex/driver.d.ts +45 -2
- package/dist/host/src/drivers/codex/driver.js +288 -18
- package/dist/host/src/drivers/codex/driver.js.map +1 -1
- package/dist/host/src/drivers/codex/mapper.d.ts +41 -7
- package/dist/host/src/drivers/codex/mapper.js +167 -26
- package/dist/host/src/drivers/codex/mapper.js.map +1 -1
- package/dist/host/src/drivers/codex/mcp-apps.d.ts +69 -0
- package/dist/host/src/drivers/codex/mcp-apps.js +340 -0
- package/dist/host/src/drivers/codex/mcp-apps.js.map +1 -0
- package/dist/host/src/drivers/codex/settings.d.ts +13 -0
- package/dist/host/src/drivers/codex/settings.js +22 -6
- package/dist/host/src/drivers/codex/settings.js.map +1 -1
- package/dist/host/src/drivers/types.d.ts +82 -1
- package/dist/host/src/host.js +2 -1
- package/dist/host/src/host.js.map +1 -1
- package/dist/host/src/hub.d.ts +48 -1
- package/dist/host/src/hub.js +235 -13
- package/dist/host/src/hub.js.map +1 -1
- package/dist/host/src/rpc/mcp.d.ts +8 -0
- package/dist/host/src/rpc/mcp.js +33 -0
- package/dist/host/src/rpc/mcp.js.map +1 -0
- package/dist/host/src/rpc/server.js +27 -3
- package/dist/host/src/rpc/server.js.map +1 -1
- package/dist/host/src/side.d.ts +28 -0
- package/dist/host/src/side.js +142 -0
- package/dist/host/src/side.js.map +1 -0
- package/dist/host/src/store.d.ts +7 -0
- package/dist/host/src/store.js +27 -3
- package/dist/host/src/store.js.map +1 -1
- package/dist/host/src/terminals.d.ts +6 -0
- package/dist/host/src/terminals.js +29 -2
- package/dist/host/src/terminals.js.map +1 -1
- package/dist/host/src/usage.d.ts +5 -0
- package/dist/host/src/usage.js +10 -2
- package/dist/host/src/usage.js.map +1 -1
- package/dist/host/tsconfig.tsbuildinfo +1 -1
- package/dist/wire/src/envelopes.d.ts +53 -0
- package/dist/wire/src/envelopes.js +251 -0
- package/dist/wire/src/envelopes.js.map +1 -0
- package/dist/wire/src/index.d.ts +3 -0
- package/dist/wire/src/index.js +3 -0
- package/dist/wire/src/index.js.map +1 -1
- package/dist/wire/src/model.d.ts +54 -0
- package/dist/wire/src/model.js +28 -0
- package/dist/wire/src/model.js.map +1 -1
- package/dist/wire/src/rpc-mcp.d.ts +199 -0
- package/dist/wire/src/rpc-mcp.js +78 -0
- package/dist/wire/src/rpc-mcp.js.map +1 -0
- package/dist/wire/src/rpc.d.ts +823 -6
- package/dist/wire/src/rpc.js +64 -1
- package/dist/wire/src/rpc.js.map +1 -1
- package/dist/wire/src/side.d.ts +83 -0
- package/dist/wire/src/side.js +26 -0
- package/dist/wire/src/side.js.map +1 -0
- package/dist/wire/src/updates.d.ts +211 -0
- package/dist/wire/src/updates.js +14 -1
- package/dist/wire/src/updates.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** Something attached to a message, shown as a chip beside the words. */
|
|
2
|
+
export interface UserContext {
|
|
3
|
+
kind: "file" | "image" | "pasted" | "selection" | "comments" | "checks" | "annotations" | "browser" | "review" | "pull-request" | "merge" | "history" | "other";
|
|
4
|
+
label: string;
|
|
5
|
+
/** A path, or the start of the attached text. */
|
|
6
|
+
detail?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A message that is an event, not something said: one line in the conversation. */
|
|
9
|
+
export type UserEvent = {
|
|
10
|
+
kind: "ci";
|
|
11
|
+
count: number;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "github";
|
|
14
|
+
count: number;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "sessions";
|
|
17
|
+
sessions: {
|
|
18
|
+
id?: string;
|
|
19
|
+
title: string;
|
|
20
|
+
}[];
|
|
21
|
+
} | {
|
|
22
|
+
kind: "scheduled";
|
|
23
|
+
name: string;
|
|
24
|
+
detail?: string;
|
|
25
|
+
};
|
|
26
|
+
export interface UserTextView {
|
|
27
|
+
/** The words to show; empty when the message is only context, an event or a command's output. */
|
|
28
|
+
text: string;
|
|
29
|
+
context: UserContext[];
|
|
30
|
+
/** A shell command run from the prompt (Claude's `!` mode), and what it printed. */
|
|
31
|
+
shell?: {
|
|
32
|
+
command?: string;
|
|
33
|
+
stdout?: string;
|
|
34
|
+
stderr?: string;
|
|
35
|
+
};
|
|
36
|
+
/** What a local slash command printed (`/cost`, `/context`). */
|
|
37
|
+
output?: string;
|
|
38
|
+
event?: UserEvent;
|
|
39
|
+
/** Nothing in it is for a reader. */
|
|
40
|
+
hidden: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** The text without what is for the model only; `keepPeers` keeps mail from other sessions and agents. */
|
|
43
|
+
export declare function stripHiddenContext(text: string, { keepPeers }?: {
|
|
44
|
+
keepPeers?: boolean;
|
|
45
|
+
}): string;
|
|
46
|
+
/**
|
|
47
|
+
* How to show a person's message: its words, what came with it, or the one event it is. `images`
|
|
48
|
+
* is how many pictures the message carries besides its text, so an envelope naming them doesn't
|
|
49
|
+
* also chip them.
|
|
50
|
+
*/
|
|
51
|
+
export declare function readUserText(raw: string, { images }?: {
|
|
52
|
+
images?: number;
|
|
53
|
+
}): UserTextView;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// What agents and their desktop clients wrap around a person's words. Claude Code adds reminders
|
|
2
|
+
// and IDE state, the Claude app adds session events and peer mail, Codex Desktop adds the files,
|
|
3
|
+
// selection and browser state it attached: context for the model, not what the person typed.
|
|
4
|
+
// Readers show the words, and the context as a chip or an event line where it means something to
|
|
5
|
+
// them, the way Claude's and Codex's own apps do. Shared by the host (titles, previews, what it
|
|
6
|
+
// keeps from Claude's transcripts) and every client.
|
|
7
|
+
/** Tags whose whole content is for the model only: the Claude app's own list, then Codex's. */
|
|
8
|
+
const HIDDEN_TAGS = [
|
|
9
|
+
"system-reminder",
|
|
10
|
+
"task-notification",
|
|
11
|
+
"slack_context",
|
|
12
|
+
"uploaded_files",
|
|
13
|
+
"available-deferred-tools",
|
|
14
|
+
"new-diagnostics",
|
|
15
|
+
"critical_user_preferences_reminder",
|
|
16
|
+
"persisted-output",
|
|
17
|
+
"local-command-caveat",
|
|
18
|
+
"tick",
|
|
19
|
+
"goal",
|
|
20
|
+
"mcp-resource",
|
|
21
|
+
"mcp-resource-update",
|
|
22
|
+
"mcp-polling-update",
|
|
23
|
+
"teammate-message",
|
|
24
|
+
"cross-session-message",
|
|
25
|
+
"launch-selected-element",
|
|
26
|
+
"connected_office_files",
|
|
27
|
+
"thinking",
|
|
28
|
+
"ide_opened_file",
|
|
29
|
+
"ide_selection",
|
|
30
|
+
"ide_diagnostics",
|
|
31
|
+
"browser_instruction",
|
|
32
|
+
"cell",
|
|
33
|
+
"cell_type",
|
|
34
|
+
"language",
|
|
35
|
+
"command-message",
|
|
36
|
+
"command-args",
|
|
37
|
+
"no-action-needed",
|
|
38
|
+
"comprehensive-mode-instructions",
|
|
39
|
+
"cu_window_hints",
|
|
40
|
+
"widget_context_hint",
|
|
41
|
+
"preview-annotation-context",
|
|
42
|
+
"terminal-selection",
|
|
43
|
+
"environment_context",
|
|
44
|
+
"user_instructions",
|
|
45
|
+
"turn_aborted",
|
|
46
|
+
"subagent_notification",
|
|
47
|
+
"external_codex_apps_open_page",
|
|
48
|
+
];
|
|
49
|
+
const hiddenPattern = (tags) => new RegExp(`<(${tags.join("|")})(?:\\s[^>]*)?>[\\s\\S]*?</\\1>`, "gi");
|
|
50
|
+
const HIDDEN = hiddenPattern(HIDDEN_TAGS);
|
|
51
|
+
/** Mail between sessions and agents: hidden in a person's bubble, but a message of its own when it is the whole message. */
|
|
52
|
+
const PEER_TAGS = ["teammate-message", "cross-session-message"];
|
|
53
|
+
const HIDDEN_BUT_PEERS = hiddenPattern(HIDDEN_TAGS.filter((tag) => !PEER_TAGS.includes(tag)));
|
|
54
|
+
/** The text without what is for the model only; `keepPeers` keeps mail from other sessions and agents. */
|
|
55
|
+
export function stripHiddenContext(text, { keepPeers = false } = {}) {
|
|
56
|
+
return text
|
|
57
|
+
.replace(/\r\n/g, "\n")
|
|
58
|
+
.replace(keepPeers ? HIDDEN_BUT_PEERS : HIDDEN, "")
|
|
59
|
+
.replace(/<\/?tool_use_error>/g, "")
|
|
60
|
+
// Claude's pointers to a background task's files, for itself.
|
|
61
|
+
.replace(/^(?:Full transcript available at|Read the output file to retrieve the result):.*$/gm, "")
|
|
62
|
+
.replace(/\s*\[event:[\da-f-]{36}\]\s*$/i, "")
|
|
63
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
64
|
+
.trim();
|
|
65
|
+
}
|
|
66
|
+
const ANSI = /\u001b\[[\d;?]*[ -/]*[@-~]/g;
|
|
67
|
+
function tagText(source, tag) {
|
|
68
|
+
const match = new RegExp(`<${tag}(?:\\s[^>]*)?>([\\s\\S]*?)</${tag}>`, "i").exec(source);
|
|
69
|
+
return match ? match[1] : undefined;
|
|
70
|
+
}
|
|
71
|
+
function attribute(attrs, name) {
|
|
72
|
+
const match = new RegExp(`\\b${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i").exec(attrs);
|
|
73
|
+
return match ? (match[1] ?? match[2]) : undefined;
|
|
74
|
+
}
|
|
75
|
+
const EVENT_TAGS = ["side-sessions-event", "ci-monitor-event", "github-webhook-activity"];
|
|
76
|
+
const EVENT_PATTERNS = new Map(EVENT_TAGS.map((tag) => [tag, new RegExp(`<${tag}\\b[^>]*>[\\s\\S]*?</${tag}>`, "gi")]));
|
|
77
|
+
/** A message made only of one kind of tag, repeated: the count, else undefined. */
|
|
78
|
+
function only(text, tag) {
|
|
79
|
+
if (!text.startsWith(`<${tag}`))
|
|
80
|
+
return undefined;
|
|
81
|
+
const pattern = EVENT_PATTERNS.get(tag);
|
|
82
|
+
const all = text.match(pattern);
|
|
83
|
+
if (!all)
|
|
84
|
+
return undefined;
|
|
85
|
+
return text.replace(pattern, "").trim() ? undefined : all.length;
|
|
86
|
+
}
|
|
87
|
+
/** Codex Desktop's sections before "## My request:", by heading. */
|
|
88
|
+
const CONTEXT_SECTIONS = {
|
|
89
|
+
"Files mentioned by the user": "file",
|
|
90
|
+
"Files pasted by the user": "pasted",
|
|
91
|
+
"Selected text": "selection",
|
|
92
|
+
"Diff comments": "comments",
|
|
93
|
+
"Browser comments": "comments",
|
|
94
|
+
"Failing PR checks": "checks",
|
|
95
|
+
"Response annotations": "annotations",
|
|
96
|
+
};
|
|
97
|
+
const MODES = {
|
|
98
|
+
"Code review guidelines": ["review", "审查模式"],
|
|
99
|
+
"Pull request fix": ["pull-request", "PR 修复"],
|
|
100
|
+
"Auto resolve merge": ["merge", "自动解决冲突"],
|
|
101
|
+
"Prior conversation with Codex": ["history", "参考历史对话"],
|
|
102
|
+
};
|
|
103
|
+
const SECTION_LABELS = {
|
|
104
|
+
"Selected text": "选中的文本",
|
|
105
|
+
"Diff comments": "差异评论",
|
|
106
|
+
"Browser comments": "浏览器评论",
|
|
107
|
+
"Failing PR checks": "失败的 PR 检查",
|
|
108
|
+
"Response annotations": "回复批注",
|
|
109
|
+
};
|
|
110
|
+
const REQUEST = /^## My request(?: for Codex)?:[ \t]*$/gm;
|
|
111
|
+
const baseName = (path) => path.split(/[\\/]/).filter(Boolean).at(-1) ?? path;
|
|
112
|
+
function codexContext(text, images) {
|
|
113
|
+
const start = /^(#{1,2}) ([^\n:]+):[ \t]*$/m.exec(text);
|
|
114
|
+
// Only an envelope Codex wrote: it opens the message with one of its own headings.
|
|
115
|
+
if (!start || start.index !== 0)
|
|
116
|
+
return undefined;
|
|
117
|
+
const heading = start[2];
|
|
118
|
+
if (!(start[1] === "#" ? heading in CONTEXT_SECTIONS : heading in MODES || /^My request(?: for Codex)?$/.test(heading)))
|
|
119
|
+
return undefined;
|
|
120
|
+
let cut = -1;
|
|
121
|
+
let after = 0;
|
|
122
|
+
for (const match of text.matchAll(REQUEST)) {
|
|
123
|
+
cut = match.index;
|
|
124
|
+
after = match.index + match[0].length;
|
|
125
|
+
}
|
|
126
|
+
const preface = cut < 0 ? text : text.slice(0, cut);
|
|
127
|
+
const request = cut < 0 ? "" : text.slice(after).trim();
|
|
128
|
+
const context = [];
|
|
129
|
+
let imageEntries = 0;
|
|
130
|
+
const sections = preface.split(/^(?=#{1,2} [^\n:]+:[ \t]*$)/m);
|
|
131
|
+
for (const section of sections) {
|
|
132
|
+
const head = /^(#{1,2}) ([^\n:]+):[ \t]*\n?/.exec(section);
|
|
133
|
+
if (!head)
|
|
134
|
+
continue;
|
|
135
|
+
const name = head[2];
|
|
136
|
+
const body = section.slice(head[0].length).trim();
|
|
137
|
+
if (head[1] === "##") {
|
|
138
|
+
const mode = MODES[name];
|
|
139
|
+
if (mode)
|
|
140
|
+
context.push({ kind: mode[0], label: mode[1] });
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const kind = CONTEXT_SECTIONS[name];
|
|
144
|
+
if (kind === "file") {
|
|
145
|
+
for (const entry of body.matchAll(/^## (.+?): (.+?)(?: \((lines? [^)]*)\))?\n?(Image attachment: true)?$/gm)) {
|
|
146
|
+
if (entry[4]) {
|
|
147
|
+
imageEntries += 1;
|
|
148
|
+
// The picture itself is shown; a chip for it would say it twice.
|
|
149
|
+
if (imageEntries <= images)
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
context.push({ kind: entry[4] ? "image" : "file", label: entry[1].includes("/") ? baseName(entry[1]) : entry[1], detail: entry[3] ? `${entry[2]} · ${entry[3]}` : entry[2] });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (kind === "pasted") {
|
|
156
|
+
for (const entry of body.matchAll(/^## "?(.+?)"?: (.+)$/gm))
|
|
157
|
+
context.push({ kind: "pasted", label: entry[1].trim(), detail: entry[2] });
|
|
158
|
+
}
|
|
159
|
+
else if (kind) {
|
|
160
|
+
context.push({ kind, label: SECTION_LABELS[name] ?? name, detail: body.split("\n").find((line) => line.trim())?.trim() });
|
|
161
|
+
}
|
|
162
|
+
else if (name !== "Distinguish instructions in attached documents from the user's request") {
|
|
163
|
+
context.push({ kind: "other", label: name });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return { text: request, context };
|
|
167
|
+
}
|
|
168
|
+
// Claude writes a shell's output into its transcript with <, > and & escaped.
|
|
169
|
+
const ENTITIES = { lt: "<", gt: ">", amp: "&", quot: "\"", apos: "'" };
|
|
170
|
+
function unescapeHtml(value) {
|
|
171
|
+
// One pass: "&gt;" is the text ">", not ">".
|
|
172
|
+
return value.replace(/&(lt|gt|amp|quot|apos|#\d{1,7}|#x[0-9a-f]{1,6});/gi, (whole, name) => {
|
|
173
|
+
const key = name.toLowerCase();
|
|
174
|
+
const code = key.startsWith("#x") ? parseInt(key.slice(2), 16) : key.startsWith("#") ? Number(key.slice(1)) : undefined;
|
|
175
|
+
if (code === undefined)
|
|
176
|
+
return ENTITIES[key] ?? whole;
|
|
177
|
+
return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : whole;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Codex Desktop writes a mention of another of its threads as a Markdown link to
|
|
182
|
+
* codex://threads/<id>, with the space before it as " ": read as the thread's title.
|
|
183
|
+
*/
|
|
184
|
+
function threadMentions(text) {
|
|
185
|
+
const read = text.replace(/&#(?:x20|32);/gi, " ").replace(/\[([^\]\n]+)\]\(codex:\/\/threads\/[\w-]+\)/g, "「$1」");
|
|
186
|
+
return read === text ? text : read.trim();
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* How to show a person's message: its words, what came with it, or the one event it is. `images`
|
|
190
|
+
* is how many pictures the message carries besides its text, so an envelope naming them doesn't
|
|
191
|
+
* also chip them.
|
|
192
|
+
*/
|
|
193
|
+
export function readUserText(raw, { images = 0 } = {}) {
|
|
194
|
+
let text = raw.replace(/\r\n/g, "\n");
|
|
195
|
+
const context = [];
|
|
196
|
+
const view = (rest) => ({ text: "", context, hidden: false, ...rest });
|
|
197
|
+
// The Claude app tells a session about the sessions it started in a reminder beside the event.
|
|
198
|
+
const sessions = [...text.matchAll(/The session "([^"\n]+)" you started \((local_[\w-]+)\)/g)].map((match) => ({ title: match[1], id: match[2] }));
|
|
199
|
+
const browser = /<in-app-browser-context\b[^>]*>[\s\S]*?<\/in-app-browser-context>/gi;
|
|
200
|
+
const withoutBrowser = text.replace(browser, "");
|
|
201
|
+
if (withoutBrowser !== text) {
|
|
202
|
+
context.push({ kind: "browser", label: "浏览器上下文" });
|
|
203
|
+
text = withoutBrowser;
|
|
204
|
+
}
|
|
205
|
+
text = stripHiddenContext(text);
|
|
206
|
+
if (only(text, "side-sessions-event"))
|
|
207
|
+
return view({ event: { kind: "sessions", sessions } });
|
|
208
|
+
if (!text)
|
|
209
|
+
return view({ hidden: images === 0 && context.length === 0 });
|
|
210
|
+
if (/^\[Request interrupted by user(?: for tool use)?\]$/.test(text))
|
|
211
|
+
return view({ hidden: true });
|
|
212
|
+
const ci = only(text, "ci-monitor-event");
|
|
213
|
+
if (ci)
|
|
214
|
+
return view({ event: { kind: "ci", count: ci } });
|
|
215
|
+
const github = only(text, "github-webhook-activity");
|
|
216
|
+
if (github)
|
|
217
|
+
return view({ event: { kind: "github", count: github } });
|
|
218
|
+
const scheduled = /^<scheduled-task\b([^>]*)>([\s\S]*?)<\/scheduled-task>$/i.exec(text);
|
|
219
|
+
if (scheduled) {
|
|
220
|
+
const name = attribute(scheduled[1], "name") ?? baseName(attribute(scheduled[1], "file") ?? "").replace(/\.md$/i, "");
|
|
221
|
+
return view({ event: { kind: "scheduled", name: name || "定时任务", detail: scheduled[2].trim() || undefined } });
|
|
222
|
+
}
|
|
223
|
+
if (/^<bash-(?:input|stdout|stderr)>/.test(text)) {
|
|
224
|
+
const clean = (value) => (value === undefined ? undefined : unescapeHtml(value).replace(ANSI, "").replace(/\n+$/, "")) || undefined;
|
|
225
|
+
const command = clean(tagText(text, "bash-input"))?.trim();
|
|
226
|
+
const stdout = clean(tagText(text, "bash-stdout"));
|
|
227
|
+
const stderr = clean(tagText(text, "bash-stderr"));
|
|
228
|
+
const rest = text.replace(/<(bash-(?:input|stdout|stderr|exit-code))>[\s\S]*?<\/\1>/g, "").trim();
|
|
229
|
+
return view({ shell: { command, stdout, stderr }, text: rest, hidden: !command && !stdout && !stderr && !rest });
|
|
230
|
+
}
|
|
231
|
+
if (/^<local-command-(?:stdout|stderr)>/.test(text)) {
|
|
232
|
+
const raw = [tagText(text, "local-command-stdout"), tagText(text, "local-command-stderr")]
|
|
233
|
+
.filter((part) => !!part?.trim())
|
|
234
|
+
.join("\n")
|
|
235
|
+
.replace(ANSI, "");
|
|
236
|
+
const output = unescapeHtml(raw).trim();
|
|
237
|
+
// /model's confirmation: the Claude app doesn't show the switch as a line either.
|
|
238
|
+
return view({ output: output || undefined, hidden: !output || /^Set model to\b/.test(output) });
|
|
239
|
+
}
|
|
240
|
+
// Slash-command plumbing the host couldn't read as a command, and notifications it didn't match.
|
|
241
|
+
if (/^<(?:command-name|local-command-|task-notification)/.test(text))
|
|
242
|
+
return view({ hidden: true });
|
|
243
|
+
const codex = codexContext(text, images);
|
|
244
|
+
if (codex) {
|
|
245
|
+
context.push(...codex.context);
|
|
246
|
+
const words = threadMentions(codex.text);
|
|
247
|
+
return view({ text: words, hidden: !words && images === 0 && context.length === 0 });
|
|
248
|
+
}
|
|
249
|
+
return view({ text: threadMentions(text) });
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=envelopes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelopes.js","sourceRoot":"","sources":["../../../../wire/src/envelopes.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,iGAAiG;AACjG,6FAA6F;AAC7F,iGAAiG;AACjG,gGAAgG;AAChG,qDAAqD;AAErD,+FAA+F;AAC/F,MAAM,WAAW,GAAG;IAClB,iBAAiB;IACjB,mBAAmB;IACnB,eAAe;IACf,gBAAgB;IAChB,0BAA0B;IAC1B,iBAAiB;IACjB,oCAAoC;IACpC,kBAAkB;IAClB,sBAAsB;IACtB,MAAM;IACN,MAAM;IACN,cAAc;IACd,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;IAClB,uBAAuB;IACvB,yBAAyB;IACzB,wBAAwB;IACxB,UAAU;IACV,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,qBAAqB;IACrB,MAAM;IACN,WAAW;IACX,UAAU;IACV,iBAAiB;IACjB,cAAc;IACd,kBAAkB;IAClB,iCAAiC;IACjC,iBAAiB;IACjB,qBAAqB;IACrB,4BAA4B;IAC5B,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,cAAc;IACd,uBAAuB;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C,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/wire/src/index.d.ts
CHANGED
package/dist/wire/src/index.js
CHANGED
|
@@ -17,4 +17,7 @@ export * from "./editor.js";
|
|
|
17
17
|
export * from "./live-activity.js";
|
|
18
18
|
export * from "./watch.js";
|
|
19
19
|
export * from "./usage.js";
|
|
20
|
+
export * from "./side.js";
|
|
21
|
+
export * from "./rpc-mcp.js";
|
|
22
|
+
export * from "./envelopes.js";
|
|
20
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../wire/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../wire/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
package/dist/wire/src/model.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export declare const agentCapabilitiesSchema: z.ZodObject<{
|
|
|
28
28
|
* shows the conversation and its agent is told it as text.
|
|
29
29
|
*/
|
|
30
30
|
fork: z.ZodBoolean;
|
|
31
|
+
/** The agent has a side conversation of its own (`sessions.side`). Absent from older hosts. */
|
|
32
|
+
side: z.ZodOptional<z.ZodBoolean>;
|
|
31
33
|
models: z.ZodBoolean;
|
|
32
34
|
modes: z.ZodBoolean;
|
|
33
35
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -41,6 +43,7 @@ export declare const agentCapabilitiesSchema: z.ZodObject<{
|
|
|
41
43
|
audio?: boolean | undefined;
|
|
42
44
|
embeddedContext?: boolean | undefined;
|
|
43
45
|
acp?: boolean | undefined;
|
|
46
|
+
side?: boolean | undefined;
|
|
44
47
|
}, {
|
|
45
48
|
interrupt: boolean;
|
|
46
49
|
steer: boolean;
|
|
@@ -52,6 +55,7 @@ export declare const agentCapabilitiesSchema: z.ZodObject<{
|
|
|
52
55
|
audio?: boolean | undefined;
|
|
53
56
|
embeddedContext?: boolean | undefined;
|
|
54
57
|
acp?: boolean | undefined;
|
|
58
|
+
side?: boolean | undefined;
|
|
55
59
|
}>;
|
|
56
60
|
export type AgentCapabilities = z.infer<typeof agentCapabilitiesSchema>;
|
|
57
61
|
/**
|
|
@@ -115,6 +119,8 @@ export declare const agentInfoSchema: z.ZodObject<{
|
|
|
115
119
|
* shows the conversation and its agent is told it as text.
|
|
116
120
|
*/
|
|
117
121
|
fork: z.ZodBoolean;
|
|
122
|
+
/** The agent has a side conversation of its own (`sessions.side`). Absent from older hosts. */
|
|
123
|
+
side: z.ZodOptional<z.ZodBoolean>;
|
|
118
124
|
models: z.ZodBoolean;
|
|
119
125
|
modes: z.ZodBoolean;
|
|
120
126
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -128,6 +134,7 @@ export declare const agentInfoSchema: z.ZodObject<{
|
|
|
128
134
|
audio?: boolean | undefined;
|
|
129
135
|
embeddedContext?: boolean | undefined;
|
|
130
136
|
acp?: boolean | undefined;
|
|
137
|
+
side?: boolean | undefined;
|
|
131
138
|
}, {
|
|
132
139
|
interrupt: boolean;
|
|
133
140
|
steer: boolean;
|
|
@@ -139,6 +146,7 @@ export declare const agentInfoSchema: z.ZodObject<{
|
|
|
139
146
|
audio?: boolean | undefined;
|
|
140
147
|
embeddedContext?: boolean | undefined;
|
|
141
148
|
acp?: boolean | undefined;
|
|
149
|
+
side?: boolean | undefined;
|
|
142
150
|
}>;
|
|
143
151
|
}, "strip", z.ZodTypeAny, {
|
|
144
152
|
id: string;
|
|
@@ -156,6 +164,7 @@ export declare const agentInfoSchema: z.ZodObject<{
|
|
|
156
164
|
audio?: boolean | undefined;
|
|
157
165
|
embeddedContext?: boolean | undefined;
|
|
158
166
|
acp?: boolean | undefined;
|
|
167
|
+
side?: boolean | undefined;
|
|
159
168
|
};
|
|
160
169
|
version?: string | undefined;
|
|
161
170
|
problem?: string | undefined;
|
|
@@ -180,6 +189,7 @@ export declare const agentInfoSchema: z.ZodObject<{
|
|
|
180
189
|
audio?: boolean | undefined;
|
|
181
190
|
embeddedContext?: boolean | undefined;
|
|
182
191
|
acp?: boolean | undefined;
|
|
192
|
+
side?: boolean | undefined;
|
|
183
193
|
};
|
|
184
194
|
version?: string | undefined;
|
|
185
195
|
problem?: string | undefined;
|
|
@@ -2026,6 +2036,25 @@ export declare const sessionSummarySchema: z.ZodObject<{
|
|
|
2026
2036
|
branch: string;
|
|
2027
2037
|
source: string;
|
|
2028
2038
|
}>>;
|
|
2039
|
+
/**
|
|
2040
|
+
* The LinkShell session that started this one (e.g. a Claude desktop
|
|
2041
|
+
* session's start_session or hand-off): the sidebar nests it there. Set
|
|
2042
|
+
* only when this host has that session too. Absent from older hosts.
|
|
2043
|
+
*/
|
|
2044
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
2045
|
+
/**
|
|
2046
|
+
* The LinkShell session this one was forked from (made here with
|
|
2047
|
+
* `sessions.fork`, or recorded by the agent), when this host has it. Kept
|
|
2048
|
+
* apart from `parentId`: a fork is a copy, not something that session
|
|
2049
|
+
* started, so whether it nests is the list's choice.
|
|
2050
|
+
*/
|
|
2051
|
+
forkedFrom: z.ZodOptional<z.ZodString>;
|
|
2052
|
+
/**
|
|
2053
|
+
* The id an app of the agent's knows the session by (the Claude desktop
|
|
2054
|
+
* app's `local_…`): mail between its sessions names the sender by it, so a
|
|
2055
|
+
* client can open the sender. Absent from older hosts.
|
|
2056
|
+
*/
|
|
2057
|
+
appId: z.ZodOptional<z.ZodString>;
|
|
2029
2058
|
/** Live only, for sessions that started sub-agents: how many, and how many are working now (`sessions.subagents` lists them). */
|
|
2030
2059
|
subagents: z.ZodOptional<z.ZodObject<{
|
|
2031
2060
|
total: z.ZodNumber;
|
|
@@ -2213,6 +2242,9 @@ export declare const sessionSummarySchema: z.ZodObject<{
|
|
|
2213
2242
|
branch: string;
|
|
2214
2243
|
source: string;
|
|
2215
2244
|
} | undefined;
|
|
2245
|
+
parentId?: string | undefined;
|
|
2246
|
+
forkedFrom?: string | undefined;
|
|
2247
|
+
appId?: string | undefined;
|
|
2216
2248
|
subagents?: {
|
|
2217
2249
|
running: number;
|
|
2218
2250
|
total: number;
|
|
@@ -2324,6 +2356,9 @@ export declare const sessionSummarySchema: z.ZodObject<{
|
|
|
2324
2356
|
branch: string;
|
|
2325
2357
|
source: string;
|
|
2326
2358
|
} | undefined;
|
|
2359
|
+
parentId?: string | undefined;
|
|
2360
|
+
forkedFrom?: string | undefined;
|
|
2361
|
+
appId?: string | undefined;
|
|
2327
2362
|
subagents?: {
|
|
2328
2363
|
running: number;
|
|
2329
2364
|
total: number;
|
|
@@ -2419,6 +2454,8 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2419
2454
|
hostname: z.ZodString;
|
|
2420
2455
|
platform: z.ZodString;
|
|
2421
2456
|
hostVersion: z.ZodString;
|
|
2457
|
+
/** The host's RPC revision (`HOST_PROTOCOL`); absent from hosts older than it. */
|
|
2458
|
+
protocol: z.ZodOptional<z.ZodNumber>;
|
|
2422
2459
|
/** The host user's home directory, so apps can show paths as `~/…`. */
|
|
2423
2460
|
home: z.ZodOptional<z.ZodString>;
|
|
2424
2461
|
agents: z.ZodArray<z.ZodObject<{
|
|
@@ -2461,6 +2498,8 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2461
2498
|
* shows the conversation and its agent is told it as text.
|
|
2462
2499
|
*/
|
|
2463
2500
|
fork: z.ZodBoolean;
|
|
2501
|
+
/** The agent has a side conversation of its own (`sessions.side`). Absent from older hosts. */
|
|
2502
|
+
side: z.ZodOptional<z.ZodBoolean>;
|
|
2464
2503
|
models: z.ZodBoolean;
|
|
2465
2504
|
modes: z.ZodBoolean;
|
|
2466
2505
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2474,6 +2513,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2474
2513
|
audio?: boolean | undefined;
|
|
2475
2514
|
embeddedContext?: boolean | undefined;
|
|
2476
2515
|
acp?: boolean | undefined;
|
|
2516
|
+
side?: boolean | undefined;
|
|
2477
2517
|
}, {
|
|
2478
2518
|
interrupt: boolean;
|
|
2479
2519
|
steer: boolean;
|
|
@@ -2485,6 +2525,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2485
2525
|
audio?: boolean | undefined;
|
|
2486
2526
|
embeddedContext?: boolean | undefined;
|
|
2487
2527
|
acp?: boolean | undefined;
|
|
2528
|
+
side?: boolean | undefined;
|
|
2488
2529
|
}>;
|
|
2489
2530
|
}, "strip", z.ZodTypeAny, {
|
|
2490
2531
|
id: string;
|
|
@@ -2502,6 +2543,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2502
2543
|
audio?: boolean | undefined;
|
|
2503
2544
|
embeddedContext?: boolean | undefined;
|
|
2504
2545
|
acp?: boolean | undefined;
|
|
2546
|
+
side?: boolean | undefined;
|
|
2505
2547
|
};
|
|
2506
2548
|
version?: string | undefined;
|
|
2507
2549
|
problem?: string | undefined;
|
|
@@ -2526,6 +2568,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2526
2568
|
audio?: boolean | undefined;
|
|
2527
2569
|
embeddedContext?: boolean | undefined;
|
|
2528
2570
|
acp?: boolean | undefined;
|
|
2571
|
+
side?: boolean | undefined;
|
|
2529
2572
|
};
|
|
2530
2573
|
version?: string | undefined;
|
|
2531
2574
|
problem?: string | undefined;
|
|
@@ -2565,6 +2608,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2565
2608
|
audio?: boolean | undefined;
|
|
2566
2609
|
embeddedContext?: boolean | undefined;
|
|
2567
2610
|
acp?: boolean | undefined;
|
|
2611
|
+
side?: boolean | undefined;
|
|
2568
2612
|
};
|
|
2569
2613
|
version?: string | undefined;
|
|
2570
2614
|
problem?: string | undefined;
|
|
@@ -2578,6 +2622,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2578
2622
|
hostname: string;
|
|
2579
2623
|
platform: string;
|
|
2580
2624
|
hostVersion: string;
|
|
2625
|
+
protocol?: number | undefined;
|
|
2581
2626
|
home?: string | undefined;
|
|
2582
2627
|
direct?: {
|
|
2583
2628
|
iceServers: string[];
|
|
@@ -2600,6 +2645,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2600
2645
|
audio?: boolean | undefined;
|
|
2601
2646
|
embeddedContext?: boolean | undefined;
|
|
2602
2647
|
acp?: boolean | undefined;
|
|
2648
|
+
side?: boolean | undefined;
|
|
2603
2649
|
};
|
|
2604
2650
|
version?: string | undefined;
|
|
2605
2651
|
problem?: string | undefined;
|
|
@@ -2613,6 +2659,7 @@ export declare const machineInfoSchema: z.ZodObject<{
|
|
|
2613
2659
|
hostname: string;
|
|
2614
2660
|
platform: string;
|
|
2615
2661
|
hostVersion: string;
|
|
2662
|
+
protocol?: number | undefined;
|
|
2616
2663
|
home?: string | undefined;
|
|
2617
2664
|
direct?: {
|
|
2618
2665
|
iceServers: string[];
|
|
@@ -2665,6 +2712,11 @@ export declare const terminalInfoSchema: z.ZodObject<{
|
|
|
2665
2712
|
exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
2666
2713
|
/** Ended without an exit code: the host stopped while it ran. */
|
|
2667
2714
|
interrupted: z.ZodOptional<z.ZodBoolean>;
|
|
2715
|
+
/**
|
|
2716
|
+
* The session it was opened for. Such a terminal belongs to the session: it closes when its
|
|
2717
|
+
* shell exits or the session is archived or deleted, and isn't kept across a host restart.
|
|
2718
|
+
*/
|
|
2719
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
2668
2720
|
}, "strip", z.ZodTypeAny, {
|
|
2669
2721
|
title: string;
|
|
2670
2722
|
id: string;
|
|
@@ -2675,6 +2727,7 @@ export declare const terminalInfoSchema: z.ZodObject<{
|
|
|
2675
2727
|
activeAt: number;
|
|
2676
2728
|
command?: string | undefined;
|
|
2677
2729
|
exitCode?: number | null | undefined;
|
|
2730
|
+
sessionId?: string | undefined;
|
|
2678
2731
|
interrupted?: boolean | undefined;
|
|
2679
2732
|
}, {
|
|
2680
2733
|
title: string;
|
|
@@ -2686,6 +2739,7 @@ export declare const terminalInfoSchema: z.ZodObject<{
|
|
|
2686
2739
|
activeAt: number;
|
|
2687
2740
|
command?: string | undefined;
|
|
2688
2741
|
exitCode?: number | null | undefined;
|
|
2742
|
+
sessionId?: string | undefined;
|
|
2689
2743
|
interrupted?: boolean | undefined;
|
|
2690
2744
|
}>;
|
|
2691
2745
|
export type TerminalInfo = z.infer<typeof terminalInfoSchema>;
|
package/dist/wire/src/model.js
CHANGED
|
@@ -30,6 +30,8 @@ export const agentCapabilitiesSchema = z.object({
|
|
|
30
30
|
* shows the conversation and its agent is told it as text.
|
|
31
31
|
*/
|
|
32
32
|
fork: z.boolean(),
|
|
33
|
+
/** The agent has a side conversation of its own (`sessions.side`). Absent from older hosts. */
|
|
34
|
+
side: z.boolean().optional(),
|
|
33
35
|
models: z.boolean(),
|
|
34
36
|
modes: z.boolean(),
|
|
35
37
|
});
|
|
@@ -219,6 +221,25 @@ export const sessionSummarySchema = z.object({
|
|
|
219
221
|
* (the project the session belongs to).
|
|
220
222
|
*/
|
|
221
223
|
worktree: z.object({ branch: z.string(), source: z.string() }).optional(),
|
|
224
|
+
/**
|
|
225
|
+
* The LinkShell session that started this one (e.g. a Claude desktop
|
|
226
|
+
* session's start_session or hand-off): the sidebar nests it there. Set
|
|
227
|
+
* only when this host has that session too. Absent from older hosts.
|
|
228
|
+
*/
|
|
229
|
+
parentId: z.string().optional(),
|
|
230
|
+
/**
|
|
231
|
+
* The LinkShell session this one was forked from (made here with
|
|
232
|
+
* `sessions.fork`, or recorded by the agent), when this host has it. Kept
|
|
233
|
+
* apart from `parentId`: a fork is a copy, not something that session
|
|
234
|
+
* started, so whether it nests is the list's choice.
|
|
235
|
+
*/
|
|
236
|
+
forkedFrom: z.string().optional(),
|
|
237
|
+
/**
|
|
238
|
+
* The id an app of the agent's knows the session by (the Claude desktop
|
|
239
|
+
* app's `local_…`): mail between its sessions names the sender by it, so a
|
|
240
|
+
* client can open the sender. Absent from older hosts.
|
|
241
|
+
*/
|
|
242
|
+
appId: z.string().optional(),
|
|
222
243
|
/** Live only, for sessions that started sub-agents: how many, and how many are working now (`sessions.subagents` lists them). */
|
|
223
244
|
subagents: z.object({ total: z.number().int(), running: z.number().int() }).optional(),
|
|
224
245
|
/** Live only, for sessions that left commands running: how many, and how many still run (`sessions.tasks` lists them). */
|
|
@@ -272,6 +293,8 @@ export const machineInfoSchema = z.object({
|
|
|
272
293
|
hostname: z.string(),
|
|
273
294
|
platform: z.string(),
|
|
274
295
|
hostVersion: z.string(),
|
|
296
|
+
/** The host's RPC revision (`HOST_PROTOCOL`); absent from hosts older than it. */
|
|
297
|
+
protocol: z.number().int().nonnegative().optional(),
|
|
275
298
|
/** The host user's home directory, so apps can show paths as `~/…`. */
|
|
276
299
|
home: z.string().optional(),
|
|
277
300
|
agents: z.array(agentInfoSchema),
|
|
@@ -313,6 +336,11 @@ export const terminalInfoSchema = z.object({
|
|
|
313
336
|
exitCode: z.number().int().nullable().optional(),
|
|
314
337
|
/** Ended without an exit code: the host stopped while it ran. */
|
|
315
338
|
interrupted: z.boolean().optional(),
|
|
339
|
+
/**
|
|
340
|
+
* The session it was opened for. Such a terminal belongs to the session: it closes when its
|
|
341
|
+
* shell exits or the session is archived or deleted, and isn't kept across a host restart.
|
|
342
|
+
*/
|
|
343
|
+
sessionId: z.string().optional(),
|
|
316
344
|
});
|
|
317
345
|
/** The host's link to a v2 gateway, for `linkshell status` and the app's computer page. */
|
|
318
346
|
export const gatewayStatusSchema = z.object({
|