@linkshell/host 0.4.69 → 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.
Files changed (74) hide show
  1. package/dist/host/src/drivers/acp/antigravity.d.ts +13 -0
  2. package/dist/host/src/drivers/acp/antigravity.js +13 -0
  3. package/dist/host/src/drivers/acp/antigravity.js.map +1 -1
  4. package/dist/host/src/drivers/acp/driver.d.ts +14 -1
  5. package/dist/host/src/drivers/acp/driver.js +45 -3
  6. package/dist/host/src/drivers/acp/driver.js.map +1 -1
  7. package/dist/host/src/drivers/acp/mapper.d.ts +2 -0
  8. package/dist/host/src/drivers/acp/mapper.js +6 -1
  9. package/dist/host/src/drivers/acp/mapper.js.map +1 -1
  10. package/dist/host/src/drivers/claude/app-sessions.d.ts +58 -0
  11. package/dist/host/src/drivers/claude/app-sessions.js +183 -0
  12. package/dist/host/src/drivers/claude/app-sessions.js.map +1 -0
  13. package/dist/host/src/drivers/claude/driver.d.ts +22 -1
  14. package/dist/host/src/drivers/claude/driver.js +95 -10
  15. package/dist/host/src/drivers/claude/driver.js.map +1 -1
  16. package/dist/host/src/drivers/claude/holders.d.ts +3 -1
  17. package/dist/host/src/drivers/claude/holders.js +4 -0
  18. package/dist/host/src/drivers/claude/holders.js.map +1 -1
  19. package/dist/host/src/drivers/claude/routing.d.ts +19 -0
  20. package/dist/host/src/drivers/claude/routing.js +145 -0
  21. package/dist/host/src/drivers/claude/routing.js.map +1 -0
  22. package/dist/host/src/drivers/claude/transcript.d.ts +10 -0
  23. package/dist/host/src/drivers/claude/transcript.js +97 -22
  24. package/dist/host/src/drivers/claude/transcript.js.map +1 -1
  25. package/dist/host/src/drivers/codex/driver.d.ts +15 -0
  26. package/dist/host/src/drivers/codex/driver.js +47 -9
  27. package/dist/host/src/drivers/codex/driver.js.map +1 -1
  28. package/dist/host/src/drivers/codex/mapper.d.ts +41 -7
  29. package/dist/host/src/drivers/codex/mapper.js +167 -26
  30. package/dist/host/src/drivers/codex/mapper.js.map +1 -1
  31. package/dist/host/src/drivers/codex/mcp-apps.d.ts +69 -0
  32. package/dist/host/src/drivers/codex/mcp-apps.js +340 -0
  33. package/dist/host/src/drivers/codex/mcp-apps.js.map +1 -0
  34. package/dist/host/src/drivers/codex/settings.d.ts +13 -0
  35. package/dist/host/src/drivers/codex/settings.js +22 -6
  36. package/dist/host/src/drivers/codex/settings.js.map +1 -1
  37. package/dist/host/src/drivers/types.d.ts +50 -1
  38. package/dist/host/src/hub.d.ts +33 -1
  39. package/dist/host/src/hub.js +157 -13
  40. package/dist/host/src/hub.js.map +1 -1
  41. package/dist/host/src/rpc/mcp.d.ts +8 -0
  42. package/dist/host/src/rpc/mcp.js +33 -0
  43. package/dist/host/src/rpc/mcp.js.map +1 -0
  44. package/dist/host/src/rpc/server.js +16 -2
  45. package/dist/host/src/rpc/server.js.map +1 -1
  46. package/dist/host/src/store.d.ts +7 -0
  47. package/dist/host/src/store.js +27 -3
  48. package/dist/host/src/store.js.map +1 -1
  49. package/dist/host/src/terminals.d.ts +6 -0
  50. package/dist/host/src/terminals.js +29 -2
  51. package/dist/host/src/terminals.js.map +1 -1
  52. package/dist/host/src/usage.d.ts +5 -0
  53. package/dist/host/src/usage.js +10 -2
  54. package/dist/host/src/usage.js.map +1 -1
  55. package/dist/host/tsconfig.tsbuildinfo +1 -1
  56. package/dist/wire/src/envelopes.d.ts +53 -0
  57. package/dist/wire/src/envelopes.js +251 -0
  58. package/dist/wire/src/envelopes.js.map +1 -0
  59. package/dist/wire/src/index.d.ts +2 -0
  60. package/dist/wire/src/index.js +2 -0
  61. package/dist/wire/src/index.js.map +1 -1
  62. package/dist/wire/src/model.d.ts +32 -0
  63. package/dist/wire/src/model.js +24 -0
  64. package/dist/wire/src/model.js.map +1 -1
  65. package/dist/wire/src/rpc-mcp.d.ts +199 -0
  66. package/dist/wire/src/rpc-mcp.js +78 -0
  67. package/dist/wire/src/rpc-mcp.js.map +1 -0
  68. package/dist/wire/src/rpc.d.ts +494 -4
  69. package/dist/wire/src/rpc.js +30 -2
  70. package/dist/wire/src/rpc.js.map +1 -1
  71. package/dist/wire/src/updates.d.ts +211 -0
  72. package/dist/wire/src/updates.js +14 -1
  73. package/dist/wire/src/updates.js.map +1 -1
  74. package/package.json +3 -3
@@ -0,0 +1,199 @@
1
+ import { z } from "zod";
2
+ /** A tool Codex offers as an app of the thread (what its "插件和 MCP" menu lists). */
3
+ export declare const mcpAppSchema: z.ZodObject<{
4
+ server: z.ZodString;
5
+ tool: z.ZodString;
6
+ /** The plugin's or connector's name where there is one, else the tool's. */
7
+ title: z.ZodString;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ /** Always `ui://…`. */
10
+ resourceUri: z.ZodString;
11
+ /** Where Codex offers it (`openai/ui.entrypoints[].type`): always includes "thread". */
12
+ entrypoints: z.ZodArray<z.ZodString, "many">;
13
+ /** Who may call the tool (`ui.visibility`: "model", "app"); absent: both. */
14
+ visibility: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
+ displayMode: z.ZodOptional<z.ZodEnum<["inline", "fullscreen"]>>;
16
+ /** The Codex connector (server `codex_apps`): `mcp.call` needs it there. */
17
+ connector: z.ZodOptional<z.ZodString>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ title: string;
20
+ server: string;
21
+ tool: string;
22
+ resourceUri: string;
23
+ entrypoints: string[];
24
+ description?: string | undefined;
25
+ displayMode?: "inline" | "fullscreen" | undefined;
26
+ connector?: string | undefined;
27
+ visibility?: string[] | undefined;
28
+ }, {
29
+ title: string;
30
+ server: string;
31
+ tool: string;
32
+ resourceUri: string;
33
+ entrypoints: string[];
34
+ description?: string | undefined;
35
+ displayMode?: "inline" | "fullscreen" | undefined;
36
+ connector?: string | undefined;
37
+ visibility?: string[] | undefined;
38
+ }>;
39
+ export type McpApp = z.infer<typeof mcpAppSchema>;
40
+ export declare const mcpMethods: {
41
+ /** The apps the session's Codex can open in the thread. */
42
+ readonly "mcp.apps": {
43
+ readonly params: z.ZodObject<{
44
+ sessionId: z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ sessionId: string;
47
+ }, {
48
+ sessionId: string;
49
+ }>;
50
+ readonly result: z.ZodObject<{
51
+ apps: z.ZodArray<z.ZodObject<{
52
+ server: z.ZodString;
53
+ tool: z.ZodString;
54
+ /** The plugin's or connector's name where there is one, else the tool's. */
55
+ title: z.ZodString;
56
+ description: z.ZodOptional<z.ZodString>;
57
+ /** Always `ui://…`. */
58
+ resourceUri: z.ZodString;
59
+ /** Where Codex offers it (`openai/ui.entrypoints[].type`): always includes "thread". */
60
+ entrypoints: z.ZodArray<z.ZodString, "many">;
61
+ /** Who may call the tool (`ui.visibility`: "model", "app"); absent: both. */
62
+ visibility: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
63
+ displayMode: z.ZodOptional<z.ZodEnum<["inline", "fullscreen"]>>;
64
+ /** The Codex connector (server `codex_apps`): `mcp.call` needs it there. */
65
+ connector: z.ZodOptional<z.ZodString>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ title: string;
68
+ server: string;
69
+ tool: string;
70
+ resourceUri: string;
71
+ entrypoints: string[];
72
+ description?: string | undefined;
73
+ displayMode?: "inline" | "fullscreen" | undefined;
74
+ connector?: string | undefined;
75
+ visibility?: string[] | undefined;
76
+ }, {
77
+ title: string;
78
+ server: string;
79
+ tool: string;
80
+ resourceUri: string;
81
+ entrypoints: string[];
82
+ description?: string | undefined;
83
+ displayMode?: "inline" | "fullscreen" | undefined;
84
+ connector?: string | undefined;
85
+ visibility?: string[] | undefined;
86
+ }>, "many">;
87
+ }, "strip", z.ZodTypeAny, {
88
+ apps: {
89
+ title: string;
90
+ server: string;
91
+ tool: string;
92
+ resourceUri: string;
93
+ entrypoints: string[];
94
+ description?: string | undefined;
95
+ displayMode?: "inline" | "fullscreen" | undefined;
96
+ connector?: string | undefined;
97
+ visibility?: string[] | undefined;
98
+ }[];
99
+ }, {
100
+ apps: {
101
+ title: string;
102
+ server: string;
103
+ tool: string;
104
+ resourceUri: string;
105
+ entrypoints: string[];
106
+ description?: string | undefined;
107
+ displayMode?: "inline" | "fullscreen" | undefined;
108
+ connector?: string | undefined;
109
+ visibility?: string[] | undefined;
110
+ }[];
111
+ }>;
112
+ };
113
+ /**
114
+ * A page's HTML (its first content), as the MCP server gives it. Only `ui://`
115
+ * URIs (`invalid_params` otherwise); one over 4 MB is refused (`too_large`).
116
+ * `meta` is the content's `_meta`: CSP domains, display modes, border.
117
+ */
118
+ readonly "mcp.resource": {
119
+ readonly params: z.ZodObject<{
120
+ sessionId: z.ZodString;
121
+ server: z.ZodString;
122
+ uri: z.ZodString;
123
+ /** The page's connector (`detail.app.connector`, `McpApp.connector`), for server `codex_apps`. */
124
+ connector: z.ZodOptional<z.ZodString>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ uri: string;
127
+ server: string;
128
+ sessionId: string;
129
+ connector?: string | undefined;
130
+ }, {
131
+ uri: string;
132
+ server: string;
133
+ sessionId: string;
134
+ connector?: string | undefined;
135
+ }>;
136
+ readonly result: z.ZodObject<{
137
+ mimeType: z.ZodOptional<z.ZodString>;
138
+ text: z.ZodOptional<z.ZodString>;
139
+ blob: z.ZodOptional<z.ZodString>;
140
+ meta: z.ZodOptional<z.ZodUnknown>;
141
+ }, "strip", z.ZodTypeAny, {
142
+ text?: string | undefined;
143
+ mimeType?: string | undefined;
144
+ blob?: string | undefined;
145
+ meta?: unknown;
146
+ }, {
147
+ text?: string | undefined;
148
+ mimeType?: string | undefined;
149
+ blob?: string | undefined;
150
+ meta?: unknown;
151
+ }>;
152
+ };
153
+ /**
154
+ * A page calls one of its server's tools, in the session's thread. Refused
155
+ * (`forbidden`) for a server without a page, a tool the page may not call
156
+ * (`ui.visibility` without "app", `openai/fileParams`), or, on `codex_apps`, a
157
+ * tool of another connector than `connector` (required there:
158
+ * `invalid_params` without it); `not_found` for a tool the server doesn't
159
+ * have. Codex's own failure is `agent_error`; a tool that ran and failed is
160
+ * `isError` in the result.
161
+ */
162
+ readonly "mcp.call": {
163
+ readonly params: z.ZodObject<{
164
+ sessionId: z.ZodString;
165
+ server: z.ZodString;
166
+ tool: z.ZodString;
167
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
168
+ connector: z.ZodOptional<z.ZodString>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ server: string;
171
+ tool: string;
172
+ sessionId: string;
173
+ connector?: string | undefined;
174
+ arguments?: Record<string, unknown> | undefined;
175
+ }, {
176
+ server: string;
177
+ tool: string;
178
+ sessionId: string;
179
+ connector?: string | undefined;
180
+ arguments?: Record<string, unknown> | undefined;
181
+ }>;
182
+ readonly result: z.ZodObject<{
183
+ content: z.ZodArray<z.ZodUnknown, "many">;
184
+ structuredContent: z.ZodOptional<z.ZodUnknown>;
185
+ isError: z.ZodOptional<z.ZodBoolean>;
186
+ meta: z.ZodOptional<z.ZodUnknown>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ content: unknown[];
189
+ meta?: unknown;
190
+ structuredContent?: unknown;
191
+ isError?: boolean | undefined;
192
+ }, {
193
+ content: unknown[];
194
+ meta?: unknown;
195
+ structuredContent?: unknown;
196
+ isError?: boolean | undefined;
197
+ }>;
198
+ };
199
+ };
@@ -0,0 +1,78 @@
1
+ import { z } from "zod";
2
+ import { mcpAppDisplayModeSchema } from "./updates.js";
3
+ // MCP Apps: an MCP tool can declare a page of its own (a `ui://` HTML
4
+ // resource) that the client shows in a sandboxed frame, and that page can call
5
+ // its server's tools back. Codex sessions only: Codex is the agent that tells
6
+ // the host which tools have pages and lets a client read and call them. Other
7
+ // agents' sessions are refused with `not_supported`; a Codex that isn't
8
+ // running with `agent_unavailable`. Hosts older than these methods answer
9
+ // "method not found".
10
+ /** A tool Codex offers as an app of the thread (what its "插件和 MCP" menu lists). */
11
+ export const mcpAppSchema = z.object({
12
+ server: z.string(),
13
+ tool: z.string(),
14
+ /** The plugin's or connector's name where there is one, else the tool's. */
15
+ title: z.string(),
16
+ description: z.string().optional(),
17
+ /** Always `ui://…`. */
18
+ resourceUri: z.string(),
19
+ /** Where Codex offers it (`openai/ui.entrypoints[].type`): always includes "thread". */
20
+ entrypoints: z.array(z.string()),
21
+ /** Who may call the tool (`ui.visibility`: "model", "app"); absent: both. */
22
+ visibility: z.array(z.string()).optional(),
23
+ displayMode: mcpAppDisplayModeSchema.optional(),
24
+ /** The Codex connector (server `codex_apps`): `mcp.call` needs it there. */
25
+ connector: z.string().optional(),
26
+ });
27
+ export const mcpMethods = {
28
+ /** The apps the session's Codex can open in the thread. */
29
+ "mcp.apps": {
30
+ params: z.object({ sessionId: z.string().min(1) }),
31
+ result: z.object({ apps: z.array(mcpAppSchema) }),
32
+ },
33
+ /**
34
+ * A page's HTML (its first content), as the MCP server gives it. Only `ui://`
35
+ * URIs (`invalid_params` otherwise); one over 4 MB is refused (`too_large`).
36
+ * `meta` is the content's `_meta`: CSP domains, display modes, border.
37
+ */
38
+ "mcp.resource": {
39
+ params: z.object({
40
+ sessionId: z.string().min(1),
41
+ server: z.string().min(1),
42
+ uri: z.string().min(1),
43
+ /** The page's connector (`detail.app.connector`, `McpApp.connector`), for server `codex_apps`. */
44
+ connector: z.string().optional(),
45
+ }),
46
+ result: z.object({
47
+ mimeType: z.string().optional(),
48
+ text: z.string().optional(),
49
+ blob: z.string().optional(),
50
+ meta: z.unknown().optional(),
51
+ }),
52
+ },
53
+ /**
54
+ * A page calls one of its server's tools, in the session's thread. Refused
55
+ * (`forbidden`) for a server without a page, a tool the page may not call
56
+ * (`ui.visibility` without "app", `openai/fileParams`), or, on `codex_apps`, a
57
+ * tool of another connector than `connector` (required there:
58
+ * `invalid_params` without it); `not_found` for a tool the server doesn't
59
+ * have. Codex's own failure is `agent_error`; a tool that ran and failed is
60
+ * `isError` in the result.
61
+ */
62
+ "mcp.call": {
63
+ params: z.object({
64
+ sessionId: z.string().min(1),
65
+ server: z.string().min(1),
66
+ tool: z.string().min(1),
67
+ arguments: z.record(z.unknown()).optional(),
68
+ connector: z.string().optional(),
69
+ }),
70
+ result: z.object({
71
+ content: z.array(z.unknown()),
72
+ structuredContent: z.unknown().optional(),
73
+ isError: z.boolean().optional(),
74
+ meta: z.unknown().optional(),
75
+ }),
76
+ },
77
+ };
78
+ //# sourceMappingURL=rpc-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc-mcp.js","sourceRoot":"","sources":["../../../../wire/src/rpc-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,sEAAsE;AACtE,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,wEAAwE;AACxE,0EAA0E;AAC1E,sBAAsB;AAEtB,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,4EAA4E;IAC5E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,uBAAuB;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,wFAAwF;IACxF,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,6EAA6E;IAC7E,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC1C,WAAW,EAAE,uBAAuB,CAAC,QAAQ,EAAE;IAC/C,4EAA4E;IAC5E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,2DAA2D;IAC3D,UAAU,EAAE;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