@100xprompt/sdk 0.0.0-dev-202607191034 → 0.1.110

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 (75) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +107 -0
  3. package/dist/client.d.ts +49 -4
  4. package/dist/client.js +122 -14
  5. package/dist/gen/sdk.gen.d.ts +172 -2
  6. package/dist/gen/sdk.gen.js +372 -0
  7. package/dist/gen/types.gen.d.ts +1964 -391
  8. package/openapi.json +14260 -0
  9. package/package.json +41 -24
  10. package/dist/v2/client.d.ts +0 -7
  11. package/dist/v2/client.js +0 -73
  12. package/dist/v2/gen/client/client.gen.d.ts +0 -2
  13. package/dist/v2/gen/client/client.gen.js +0 -225
  14. package/dist/v2/gen/client/index.d.ts +0 -8
  15. package/dist/v2/gen/client/index.js +0 -6
  16. package/dist/v2/gen/client/types.gen.d.ts +0 -117
  17. package/dist/v2/gen/client/types.gen.js +0 -2
  18. package/dist/v2/gen/client/utils.gen.d.ts +0 -33
  19. package/dist/v2/gen/client/utils.gen.js +0 -226
  20. package/dist/v2/gen/client.gen.d.ts +0 -12
  21. package/dist/v2/gen/client.gen.js +0 -3
  22. package/dist/v2/gen/core/auth.gen.d.ts +0 -18
  23. package/dist/v2/gen/core/auth.gen.js +0 -14
  24. package/dist/v2/gen/core/bodySerializer.gen.d.ts +0 -25
  25. package/dist/v2/gen/core/bodySerializer.gen.js +0 -57
  26. package/dist/v2/gen/core/params.gen.d.ts +0 -43
  27. package/dist/v2/gen/core/params.gen.js +0 -102
  28. package/dist/v2/gen/core/pathSerializer.gen.d.ts +0 -33
  29. package/dist/v2/gen/core/pathSerializer.gen.js +0 -106
  30. package/dist/v2/gen/core/queryKeySerializer.gen.d.ts +0 -18
  31. package/dist/v2/gen/core/queryKeySerializer.gen.js +0 -93
  32. package/dist/v2/gen/core/serverSentEvents.gen.d.ts +0 -71
  33. package/dist/v2/gen/core/serverSentEvents.gen.js +0 -131
  34. package/dist/v2/gen/core/types.gen.d.ts +0 -78
  35. package/dist/v2/gen/core/types.gen.js +0 -2
  36. package/dist/v2/gen/core/utils.gen.d.ts +0 -19
  37. package/dist/v2/gen/core/utils.gen.js +0 -87
  38. package/dist/v2/gen/gen/client/client.gen.d.ts +0 -2
  39. package/dist/v2/gen/gen/client/client.gen.js +0 -225
  40. package/dist/v2/gen/gen/client/index.d.ts +0 -8
  41. package/dist/v2/gen/gen/client/index.js +0 -6
  42. package/dist/v2/gen/gen/client/types.gen.d.ts +0 -117
  43. package/dist/v2/gen/gen/client/types.gen.js +0 -2
  44. package/dist/v2/gen/gen/client/utils.gen.d.ts +0 -33
  45. package/dist/v2/gen/gen/client/utils.gen.js +0 -226
  46. package/dist/v2/gen/gen/client.gen.d.ts +0 -12
  47. package/dist/v2/gen/gen/client.gen.js +0 -3
  48. package/dist/v2/gen/gen/core/auth.gen.d.ts +0 -18
  49. package/dist/v2/gen/gen/core/auth.gen.js +0 -14
  50. package/dist/v2/gen/gen/core/bodySerializer.gen.d.ts +0 -25
  51. package/dist/v2/gen/gen/core/bodySerializer.gen.js +0 -57
  52. package/dist/v2/gen/gen/core/params.gen.d.ts +0 -43
  53. package/dist/v2/gen/gen/core/params.gen.js +0 -102
  54. package/dist/v2/gen/gen/core/pathSerializer.gen.d.ts +0 -33
  55. package/dist/v2/gen/gen/core/pathSerializer.gen.js +0 -106
  56. package/dist/v2/gen/gen/core/queryKeySerializer.gen.d.ts +0 -18
  57. package/dist/v2/gen/gen/core/queryKeySerializer.gen.js +0 -93
  58. package/dist/v2/gen/gen/core/serverSentEvents.gen.d.ts +0 -71
  59. package/dist/v2/gen/gen/core/serverSentEvents.gen.js +0 -131
  60. package/dist/v2/gen/gen/core/types.gen.d.ts +0 -78
  61. package/dist/v2/gen/gen/core/types.gen.js +0 -2
  62. package/dist/v2/gen/gen/core/utils.gen.d.ts +0 -19
  63. package/dist/v2/gen/gen/core/utils.gen.js +0 -87
  64. package/dist/v2/gen/gen/sdk.gen.d.ts +0 -1013
  65. package/dist/v2/gen/gen/sdk.gen.js +0 -1931
  66. package/dist/v2/gen/gen/types.gen.d.ts +0 -4246
  67. package/dist/v2/gen/gen/types.gen.js +0 -2
  68. package/dist/v2/gen/sdk.gen.d.ts +0 -1014
  69. package/dist/v2/gen/sdk.gen.js +0 -1932
  70. package/dist/v2/gen/types.gen.d.ts +0 -4238
  71. package/dist/v2/gen/types.gen.js +0 -2
  72. package/dist/v2/index.d.ts +0 -10
  73. package/dist/v2/index.js +0 -16
  74. package/dist/v2/server.d.ts +0 -23
  75. package/dist/v2/server.js +0 -94
package/LICENSE ADDED
@@ -0,0 +1,3 @@
1
+ Copyright (c) 2025 100xprompt
2
+
3
+ All rights reserved. No one should copy, modify, distribute, or do anything with this code.
package/README.md ADDED
@@ -0,0 +1,107 @@
1
+ # @100xprompt/sdk
2
+
3
+ TypeScript SDK for [100XPrompt](https://100xprompt.com) — the AI coding agent.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@100xprompt/sdk?style=flat-square)](https://www.npmjs.com/package/@100xprompt/sdk)
6
+
7
+ ---
8
+
9
+ A fully-typed client for the 100XPrompt agent server, plus helpers to spawn the server or the terminal UI from Node or Bun. Use it to drive sessions, stream responses, manage models/providers and MCP servers, and build your own tools, UIs, bots, and CI integrations on top of 100XPrompt.
10
+
11
+ > **The SDK is a client.** It talks to a running `100xprompt` instance — it does not bundle the agent runtime or any model access. You need the CLI installed and a model configured for it to do anything.
12
+
13
+ ## Prerequisites
14
+
15
+ Install the 100XPrompt CLI so the `100xprompt` binary is on your `PATH`:
16
+
17
+ ```bash
18
+ curl -fsSL https://100xprompt.com/install | bash
19
+ # or
20
+ npm i -g 100xprompt-cli@latest
21
+ ```
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ npm install @100xprompt/sdk
27
+ # bun add @100xprompt/sdk · pnpm add @100xprompt/sdk · yarn add @100xprompt/sdk
28
+ ```
29
+
30
+ ## Quick start
31
+
32
+ Spin up a server and a client in one call:
33
+
34
+ ```ts
35
+ import { create100XPrompt } from "@100xprompt/sdk"
36
+
37
+ const { client, server } = await create100XPrompt()
38
+
39
+ const session = await client.session.create()
40
+
41
+ await client.session.prompt({
42
+ sessionID: session.data.id,
43
+ parts: [{ type: "text", text: "Write unit tests for src/index.ts" }],
44
+ })
45
+
46
+ server.close()
47
+ ```
48
+
49
+ `create100XPrompt()` spawns `100xprompt serve` on `127.0.0.1:4096` and returns a typed client pointed at it.
50
+
51
+ ## Server and client separately
52
+
53
+ ```ts
54
+ import { create100XPromptServer, create100XPromptClient } from "@100xprompt/sdk"
55
+
56
+ const server = await create100XPromptServer({ port: 4096 })
57
+ const client = create100XPromptClient({ baseUrl: server.url })
58
+
59
+ // ... use the client ...
60
+
61
+ server.close()
62
+ ```
63
+
64
+ ## Connect to an existing server
65
+
66
+ If a `100xprompt serve` instance is already running — locally or remotely — skip the spawn and point the client at it:
67
+
68
+ ```ts
69
+ import { create100XPromptClient } from "@100xprompt/sdk/client"
70
+
71
+ const client = create100XPromptClient({
72
+ baseUrl: "https://your-host.example.com",
73
+ headers: { Authorization: `Bearer ${process.env.HUNDREDXPROMPT_TOKEN}` },
74
+ })
75
+ ```
76
+
77
+ > Authentication, rate limiting, and access control are enforced by the **server**, not the SDK. The SDK only formats requests — secure your hosted instance accordingly.
78
+
79
+ ## Launch the terminal UI
80
+
81
+ ```ts
82
+ import { create100XPromptTui } from "@100xprompt/sdk"
83
+
84
+ const tui = create100XPromptTui({ agent: "build" })
85
+ // tui.close() to stop
86
+ ```
87
+
88
+ ## Types
89
+
90
+ Every request and response type is exported and generated from the server's OpenAPI schema:
91
+
92
+ ```ts
93
+ import type { X100PromptClientConfig } from "@100xprompt/sdk"
94
+ ```
95
+
96
+ ## Requirements
97
+
98
+ - Node.js 18+ (for global `fetch`) or Bun
99
+ - The `100xprompt` CLI on your `PATH` (see [Prerequisites](#prerequisites))
100
+
101
+ ## Documentation
102
+
103
+ Full docs at [100xprompt.com/docs](https://100xprompt.com/docs).
104
+
105
+ ## License
106
+
107
+ Proprietary. See [LICENSE](./LICENSE).
package/dist/client.d.ts CHANGED
@@ -1,7 +1,52 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { type Config } from "./gen/client/types.gen.js";
3
- import { X100PromptClient as _X100PromptClient } from "./gen/sdk.gen.js";
4
- export { type Config as X100PromptClientConfig, _X100PromptClient as X100PromptClient };
5
- export declare function create100XPromptClient(config?: Config & {
3
+ import { X100PromptClient as _X100PromptClient, Revert, Oauth, Resource, Control } from "./gen/sdk.gen.js";
4
+ import { type Client } from "./gen/client/index.js";
5
+ export declare class X100PromptClient extends _X100PromptClient {
6
+ revert: Revert;
7
+ oauth: Oauth;
8
+ resource: Resource;
9
+ control: Control;
10
+ constructor(args?: {
11
+ client?: Client;
12
+ key?: string;
13
+ });
14
+ }
15
+ export { type Config as X100PromptClientConfig, Revert, Oauth, Resource, Control };
16
+ /**
17
+ * A non-fatal condition the client recovered from. Reported through a hook
18
+ * rather than the console: this is a library, and the host may own the
19
+ * terminal — the TUI renders into it, so a stray `console.warn` is drawn
20
+ * straight into the frame and corrupts it.
21
+ */
22
+ export interface X100PromptClientDiagnostic {
23
+ /** A 2xx response whose body was empty or truncated; a default was returned. */
24
+ kind: "empty-response-body";
25
+ /** Human-readable, already formatted for a log line. */
26
+ message: string;
27
+ /** The request URL. Taken from the Request, not the Response: a
28
+ * hand-constructed Response (the TUI's worker-thread fetch bridge builds
29
+ * one) always has `url === ""`. */
30
+ url: string;
31
+ status: number;
32
+ /** What the caller asked the body to be parsed as. */
33
+ parseAs: "json" | "text";
34
+ /** The underlying parse failure. */
35
+ cause: Error;
36
+ }
37
+ export type X100PromptClientDiagnosticHandler = (diagnostic: X100PromptClientDiagnostic) => void;
38
+ /**
39
+ * Install the process-wide sink for client diagnostics, for hosts that build
40
+ * clients in several places (the CLI wires this to its file logger once at
41
+ * startup). Per-client `onDiagnostic` wins over it.
42
+ *
43
+ * With no handler installed the diagnostic is DROPPED. That is deliberate: a
44
+ * library writing to stdio behind the host's back is the bug this replaced.
45
+ */
46
+ export declare function set100XPromptClientDiagnosticHandler(handler: X100PromptClientDiagnosticHandler | undefined): void;
47
+ export type X100PromptClientOptions = Config & {
6
48
  directory?: string;
7
- }): _X100PromptClient;
49
+ /** Per-client diagnostic sink; overrides the process-wide handler. */
50
+ onDiagnostic?: X100PromptClientDiagnosticHandler;
51
+ };
52
+ export declare function create100XPromptClient(config?: X100PromptClientOptions): X100PromptClient;
package/dist/client.js CHANGED
@@ -1,25 +1,133 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { createClient } from "./gen/client/client.gen.js";
3
- import { X100PromptClient as _X100PromptClient } from "./gen/sdk.gen.js";
4
- export { _X100PromptClient as X100PromptClient };
3
+ import { X100PromptClient as _X100PromptClient, Revert, Oauth, Resource, Control, } from "./gen/sdk.gen.js";
4
+ export class X100PromptClient extends _X100PromptClient {
5
+ revert;
6
+ oauth;
7
+ resource;
8
+ control;
9
+ constructor(args) {
10
+ super(args);
11
+ this.revert = new Revert(args);
12
+ this.oauth = new Oauth(args);
13
+ this.resource = new Resource(args);
14
+ this.control = new Control(args);
15
+ this.provider.oauth = this.oauth;
16
+ this.tui.control = this.control;
17
+ this.experimental.resource = this.resource;
18
+ }
19
+ }
20
+ export { Revert, Oauth, Resource, Control };
21
+ let defaultDiagnosticHandler;
22
+ /**
23
+ * Install the process-wide sink for client diagnostics, for hosts that build
24
+ * clients in several places (the CLI wires this to its file logger once at
25
+ * startup). Per-client `onDiagnostic` wins over it.
26
+ *
27
+ * With no handler installed the diagnostic is DROPPED. That is deliberate: a
28
+ * library writing to stdio behind the host's back is the bug this replaced.
29
+ */
30
+ export function set100XPromptClientDiagnosticHandler(handler) {
31
+ defaultDiagnosticHandler = handler;
32
+ }
5
33
  export function create100XPromptClient(config) {
6
- if (!config?.fetch) {
7
- const customFetch = (req) => {
8
- // @ts-ignore
9
- req.timeout = false;
10
- return fetch(req);
34
+ const originalFetch = config?.fetch ?? globalThis.fetch;
35
+ const onDiagnostic = config?.onDiagnostic;
36
+ const report = (diagnostic) => {
37
+ const handler = onDiagnostic ?? defaultDiagnosticHandler;
38
+ if (!handler)
39
+ return;
40
+ try {
41
+ handler(diagnostic);
42
+ }
43
+ catch {
44
+ // A broken sink must never take down the request it was describing.
45
+ }
46
+ };
47
+ const customFetch = async (request) => {
48
+ // HeyAPI passes a Request object
49
+ let signal = request.signal;
50
+ // @ts-ignore - Bun specific timeout extension
51
+ request.timeout = false;
52
+ // Captured before the call: `response.url` is empty whenever the Response
53
+ // was constructed by hand instead of coming off the wire, which is exactly
54
+ // the case in the TUI (its `fetch` is a postMessage bridge to the server
55
+ // worker). The Request always knows where it was going.
56
+ const requestUrl = request.url;
57
+ const response = await originalFetch(request);
58
+ const wrapParser = (parser, parseType) => {
59
+ return async () => {
60
+ try {
61
+ return await parser();
62
+ }
63
+ catch (e) {
64
+ if (e instanceof Error &&
65
+ (e.message.includes("Unexpected end of JSON input") ||
66
+ e.message.includes("terminated") ||
67
+ e.message.includes("JSON"))) {
68
+ // Case 1: Request was intentionally aborted — surface a clean AbortError
69
+ if (signal?.aborted) {
70
+ const abortError = new Error("The operation was aborted");
71
+ abortError.name = "AbortError";
72
+ throw abortError;
73
+ }
74
+ // Case 2: Server returned empty/truncated body on a success response
75
+ // Return safe defaults instead of crashing
76
+ if (response.ok) {
77
+ const parseAs = parseType === "text" ? "text" : "json";
78
+ report({
79
+ kind: "empty-response-body",
80
+ message: `empty or malformed response body from ${requestUrl} (status ${response.status}); ` +
81
+ `returning empty ${parseAs === "text" ? "string" : "object"}`,
82
+ url: requestUrl,
83
+ status: response.status,
84
+ parseAs,
85
+ cause: e,
86
+ });
87
+ return parseAs === "text" ? "" : {};
88
+ }
89
+ // Case 3: Error response with unparseable body — wrap with context
90
+ const wrappedError = new Error(`Failed to parse ${parseType ?? "response"} from ${requestUrl} (status ${response.status}): ${e.message}`);
91
+ wrappedError.name = "ResponseParseError";
92
+ throw wrappedError;
93
+ }
94
+ throw e;
95
+ }
96
+ };
11
97
  };
12
- config = {
13
- ...config,
14
- fetch: customFetch,
15
- };
16
- }
98
+ // Proxy the response to wrap json() and text()
99
+ return new Proxy(response, {
100
+ get(target, prop) {
101
+ // Keep the endpoint visible downstream too, so anything reading
102
+ // `response.url` off a bridged response sees the real target instead
103
+ // of the empty string a hand-built Response reports.
104
+ if (prop === "url" && !target.url)
105
+ return requestUrl;
106
+ const value = target[prop];
107
+ if (typeof value === "function") {
108
+ if (prop === "json" || prop === "text") {
109
+ return wrapParser(value.bind(target), prop);
110
+ }
111
+ return value.bind(target);
112
+ }
113
+ return value;
114
+ },
115
+ });
116
+ };
117
+ config = {
118
+ ...config,
119
+ fetch: customFetch,
120
+ };
17
121
  if (config?.directory) {
122
+ // HTTP headers are ISO-8859-1; a non-ASCII path (CJK, Cyrillic, accents)
123
+ // would otherwise throw or arrive corrupted.
124
+ const isNonASCII = /[^\x00-\x7F]/.test(config.directory);
125
+ const encodedDirectory = isNonASCII ? encodeURIComponent(config.directory) : config.directory;
18
126
  config.headers = {
19
127
  ...config.headers,
20
- "x-100xprompt-directory": config.directory,
128
+ "x-100xprompt-directory": encodedDirectory,
21
129
  };
22
130
  }
23
131
  const client = createClient(config);
24
- return new _X100PromptClient({ client });
132
+ return new X100PromptClient({ client });
25
133
  }
@@ -1,5 +1,5 @@
1
1
  import { type Client, type Options as Options2, type TDataShape } from "./client/index.js";
2
- import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, Auth as Auth2, AuthSetErrors, AuthSetResponses, CommandListResponses, Config as Config2, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, LspStatusResponses, McpAddErrors, McpAddResponses, McpAuthAuthenticateErrors, McpAuthAuthenticateResponses, McpAuthCallbackErrors, McpAuthCallbackResponses, McpAuthRemoveErrors, McpAuthRemoveResponses, McpAuthStartErrors, McpAuthStartResponses, McpConnectResponses, McpDisconnectResponses, McpLocalConfig, McpRemoteConfig, McpStatusResponses, Part as Part2, PartDeleteErrors, PartDeleteResponses, PartUpdateErrors, PartUpdateResponses, PathGetResponses, PermissionListResponses, PermissionMode, PermissionReplyErrors, PermissionReplyResponses, PermissionRespondErrors, PermissionRespondResponses, PermissionRuleset, ProjectCurrentResponses, ProjectListResponses, ProjectUpdateErrors, ProjectUpdateResponses, ProviderAuthResponses, ProviderListResponses, ProviderOauthAuthorizeErrors, ProviderOauthAuthorizeResponses, ProviderOauthCallbackErrors, ProviderOauthCallbackResponses, PtyConnectErrors, PtyConnectResponses, PtyCreateErrors, PtyCreateResponses, PtyGetErrors, PtyGetResponses, PtyListResponses, PtyRemoveErrors, PtyRemoveResponses, PtyUpdateErrors, PtyUpdateResponses, QuestionAnswer, QuestionListResponses, QuestionRejectErrors, QuestionRejectResponses, QuestionReplyErrors, QuestionReplyResponses, SessionAbortErrors, SessionAbortResponses, SessionChildrenErrors, SessionChildrenResponses, SessionCommandErrors, SessionCommandResponses, SessionCreateErrors, SessionCreateResponses, SessionDeleteErrors, SessionDeleteResponses, SessionDiffErrors, SessionDiffResponses, SessionForkResponses, SessionGetErrors, SessionGetResponses, SessionInitErrors, SessionInitResponses, SessionListResponses, SessionMessageErrors, SessionMessageResponses, SessionMessagesErrors, SessionMessagesResponses, SessionPromptAsyncErrors, SessionPromptAsyncResponses, SessionPromptErrors, SessionPromptResponses, SessionRevertErrors, SessionRevertResponses, SessionShareErrors, SessionShareResponses, SessionShellErrors, SessionShellResponses, SessionStatusErrors, SessionStatusResponses, SessionSummarizeErrors, SessionSummarizeResponses, SessionTodoErrors, SessionTodoResponses, SessionUnrevertErrors, SessionUnrevertResponses, SessionUnshareErrors, SessionUnshareResponses, SessionUpdateErrors, SessionUpdateResponses, SubtaskPartInput, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeListResponses } from "./types.gen.js";
2
+ import type { AgentPartInput, AppAgentsResponses, AppLogErrors, AppLogResponses, Auth as Auth2, AuthSetErrors, AuthSetResponses, CommandListResponses, Config as Config2, ConfigGetResponses, ConfigProvidersResponses, ConfigUpdateErrors, ConfigUpdateResponses, EventSubscribeResponses, EventTuiCommandExecute, EventTuiPromptAppend, EventTuiSessionSelect, EventTuiToastShow, ExperimentalResourceListResponses, FileListResponses, FilePartInput, FilePartSource, FileReadResponses, FileStatusResponses, FindFilesResponses, FindSymbolsResponses, FindTextResponses, FormatterStatusResponses, GlobalDisposeResponses, GlobalEventResponses, GlobalHealthResponses, InstanceDisposeResponses, LspStatusResponses, McpAddErrors, McpAddResponses, McpAuthAuthenticateErrors, McpAuthAuthenticateResponses, McpAuthCallbackErrors, McpAuthCallbackResponses, McpAuthRemoveErrors, McpAuthRemoveResponses, McpAuthStartErrors, McpAuthStartResponses, McpConnectErrors, McpConnectResponses, McpDisconnectResponses, McpLocalConfig, McpRemoteConfig, McpStatusResponses, Part as Part2, PartDeleteErrors, PartDeleteResponses, PartUpdateErrors, PartUpdateResponses, PathGetResponses, PermissionListResponses, PermissionMode, PermissionReplyErrors, PermissionReplyResponses, PermissionRespondErrors, PermissionRespondResponses, PermissionRuleset, PluginDiscoverResponses, PluginErrorsResponses, PluginInstalledResponses, PluginInstallErrors, PluginInstallNamedErrors, PluginInstallNamedResponses, PluginInstallResponses, PluginMarketplaceAddResponses, PluginMarketplaceRemoveResponses, PluginMarketplacesResponses, PluginReloadResponses, PluginRemoveResponses, PluginSetEnabledResponses, ProjectCurrentResponses, ProjectListResponses, ProjectUpdateErrors, ProjectUpdateResponses, ProviderAuthResponses, ProviderListResponses, ProviderOauthAuthorizeErrors, ProviderOauthAuthorizeResponses, ProviderOauthCallbackErrors, ProviderOauthCallbackResponses, PtyConnectErrors, PtyConnectResponses, PtyCreateErrors, PtyCreateResponses, PtyGetErrors, PtyGetResponses, PtyListResponses, PtyRemoveErrors, PtyRemoveResponses, PtyUpdateErrors, PtyUpdateResponses, QuestionAnswer, QuestionListResponses, QuestionRejectErrors, QuestionRejectResponses, QuestionReplyErrors, QuestionReplyResponses, RemoteBridgeConnectResponses, RemoteBridgeDevicesResponses, RemoteBridgeEnrollResponses, RemoteBridgeRevokeResponses, SessionAbortErrors, SessionAbortResponses, SessionChildrenErrors, SessionChildrenResponses, SessionCommandErrors, SessionCommandResponses, SessionCreateErrors, SessionCreateResponses, SessionDeleteErrors, SessionDeleteResponses, SessionDiffErrors, SessionDiffResponses, SessionFeedbackErrors, SessionFeedbackResponses, SessionForkResponses, SessionGetErrors, SessionGetResponses, SessionInitErrors, SessionInitResponses, SessionListResponses, SessionMessageErrors, SessionMessageResponses, SessionMessagesErrors, SessionMessagesResponses, SessionPromptAsyncErrors, SessionPromptAsyncResponses, SessionPromptErrors, SessionPromptResponses, SessionRevertErrors, SessionRevertPreviewErrors, SessionRevertPreviewResponses, SessionRevertResponses, SessionShareErrors, SessionShareResponses, SessionShellErrors, SessionShellResponses, SessionStatusErrors, SessionStatusResponses, SessionSummarizeErrors, SessionSummarizeResponses, SessionTodoErrors, SessionTodoResponses, SessionUnrevertErrors, SessionUnrevertResponses, SessionUnshareErrors, SessionUnshareResponses, SessionUpdateErrors, SessionUpdateResponses, SubtaskPartInput, TextPartInput, ToolIdsErrors, ToolIdsResponses, ToolListErrors, ToolListResponses, TrustAlwaysResponses, TrustOnceResponses, TrustStatusResponses, TuiAppendPromptErrors, TuiAppendPromptResponses, TuiClearPromptResponses, TuiControlNextResponses, TuiControlResponseResponses, TuiExecuteCommandErrors, TuiExecuteCommandResponses, TuiOpenHelpResponses, TuiOpenModelsResponses, TuiOpenSessionsResponses, TuiOpenThemesResponses, TuiPublishErrors, TuiPublishResponses, TuiSelectSessionErrors, TuiSelectSessionResponses, TuiShowToastResponses, TuiSubmitPromptResponses, VcsGetResponses, WorktreeCreateErrors, WorktreeCreateInput, WorktreeCreateResponses, WorktreeListResponses } from "./types.gen.js";
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -77,6 +77,137 @@ export declare class Project extends HeyApiClient {
77
77
  };
78
78
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProjectUpdateResponses, ProjectUpdateErrors, ThrowOnError, "fields">;
79
79
  }
80
+ export declare class Plugin extends HeyApiClient {
81
+ /**
82
+ * List installed plugins
83
+ */
84
+ installed<ThrowOnError extends boolean = false>(parameters?: {
85
+ directory?: string;
86
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginInstalledResponses, unknown, ThrowOnError, "fields">;
87
+ /**
88
+ * Browse plugins across added marketplaces
89
+ */
90
+ discover<ThrowOnError extends boolean = false>(parameters?: {
91
+ directory?: string;
92
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginDiscoverResponses, unknown, ThrowOnError, "fields">;
93
+ /**
94
+ * List added marketplace sources
95
+ */
96
+ marketplaces<ThrowOnError extends boolean = false>(parameters?: {
97
+ directory?: string;
98
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginMarketplacesResponses, unknown, ThrowOnError, "fields">;
99
+ /**
100
+ * List plugins that failed to load
101
+ */
102
+ errors<ThrowOnError extends boolean = false>(parameters?: {
103
+ directory?: string;
104
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginErrorsResponses, unknown, ThrowOnError, "fields">;
105
+ /**
106
+ * Activate pending plugin changes in the current session
107
+ */
108
+ reload<ThrowOnError extends boolean = false>(parameters?: {
109
+ directory?: string;
110
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginReloadResponses, unknown, ThrowOnError, "fields">;
111
+ /**
112
+ * Install a plugin from a source spec
113
+ */
114
+ install<ThrowOnError extends boolean = false>(parameters?: {
115
+ directory?: string;
116
+ source?: string;
117
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginInstallResponses, PluginInstallErrors, ThrowOnError, "fields">;
118
+ /**
119
+ * Install a plugin by name from added marketplaces
120
+ */
121
+ installNamed<ThrowOnError extends boolean = false>(parameters?: {
122
+ directory?: string;
123
+ name?: string;
124
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginInstallNamedResponses, PluginInstallNamedErrors, ThrowOnError, "fields">;
125
+ /**
126
+ * Enable or disable an installed plugin
127
+ */
128
+ setEnabled<ThrowOnError extends boolean = false>(parameters?: {
129
+ directory?: string;
130
+ name?: string;
131
+ enabled?: boolean;
132
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginSetEnabledResponses, unknown, ThrowOnError, "fields">;
133
+ /**
134
+ * Uninstall a plugin
135
+ */
136
+ remove<ThrowOnError extends boolean = false>(parameters?: {
137
+ directory?: string;
138
+ name?: string;
139
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginRemoveResponses, unknown, ThrowOnError, "fields">;
140
+ /**
141
+ * Add a marketplace source
142
+ */
143
+ marketplaceAdd<ThrowOnError extends boolean = false>(parameters?: {
144
+ directory?: string;
145
+ source?: string;
146
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginMarketplaceAddResponses, unknown, ThrowOnError, "fields">;
147
+ /**
148
+ * Remove a marketplace source
149
+ */
150
+ marketplaceRemove<ThrowOnError extends boolean = false>(parameters?: {
151
+ directory?: string;
152
+ source?: string;
153
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<PluginMarketplaceRemoveResponses, unknown, ThrowOnError, "fields">;
154
+ }
155
+ export declare class Trust extends HeyApiClient {
156
+ /**
157
+ * Get workspace trust status for the current directory
158
+ */
159
+ status<ThrowOnError extends boolean = false>(parameters?: {
160
+ directory?: string;
161
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<TrustStatusResponses, unknown, ThrowOnError, "fields">;
162
+ /**
163
+ * Trust the current directory for this session only
164
+ */
165
+ once<ThrowOnError extends boolean = false>(parameters?: {
166
+ directory?: string;
167
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<TrustOnceResponses, unknown, ThrowOnError, "fields">;
168
+ /**
169
+ * Trust the current directory and persist it across sessions
170
+ */
171
+ always<ThrowOnError extends boolean = false>(parameters?: {
172
+ directory?: string;
173
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<TrustAlwaysResponses, unknown, ThrowOnError, "fields">;
174
+ }
175
+ export declare class RemoteBridge extends HeyApiClient {
176
+ /**
177
+ * Enrol a device and mint a bridge token
178
+ *
179
+ * Registers the calling device in the bridge trust store and returns a short-lived signed token for the WebSocket endpoint.
180
+ */
181
+ enroll<ThrowOnError extends boolean = false>(parameters?: {
182
+ directory?: string;
183
+ device?: {
184
+ id?: string;
185
+ name?: string;
186
+ };
187
+ sessionID?: string;
188
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<RemoteBridgeEnrollResponses, unknown, ThrowOnError, "fields">;
189
+ /**
190
+ * List bridge devices
191
+ */
192
+ devices<ThrowOnError extends boolean = false>(parameters?: {
193
+ directory?: string;
194
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<RemoteBridgeDevicesResponses, unknown, ThrowOnError, "fields">;
195
+ /**
196
+ * Revoke a bridge device
197
+ *
198
+ * Permanently refuses the device. Takes effect on the next connection attempt even if its token is still unexpired, and kicks any connection it currently holds.
199
+ */
200
+ revoke<ThrowOnError extends boolean = false>(parameters: {
201
+ deviceID: string;
202
+ directory?: string;
203
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<RemoteBridgeRevokeResponses, unknown, ThrowOnError, "fields">;
204
+ /**
205
+ * Attach to a session over the bridge WebSocket
206
+ */
207
+ connect<ThrowOnError extends boolean = false>(parameters?: {
208
+ directory?: string;
209
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<RemoteBridgeConnectResponses, unknown, ThrowOnError, "fields">;
210
+ }
80
211
  export declare class Pty extends HeyApiClient {
81
212
  /**
82
213
  * List PTY sessions
@@ -239,6 +370,20 @@ export declare class Vcs extends HeyApiClient {
239
370
  directory?: string;
240
371
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<VcsGetResponses, unknown, ThrowOnError, "fields">;
241
372
  }
373
+ export declare class Revert extends HeyApiClient {
374
+ /**
375
+ * Preview revert
376
+ *
377
+ * Dry-run a revert: which files would change with +/- line counts, and whether it would overwrite content modified outside the session.
378
+ */
379
+ preview<ThrowOnError extends boolean = false>(parameters: {
380
+ sessionID: string;
381
+ directory?: string;
382
+ messageID?: string;
383
+ partID?: string;
384
+ mode?: "both" | "conversation" | "files";
385
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionRevertPreviewResponses, SessionRevertPreviewErrors, ThrowOnError, "fields">;
386
+ }
242
387
  export declare class Session extends HeyApiClient {
243
388
  /**
244
389
  * List sessions
@@ -250,6 +395,8 @@ export declare class Session extends HeyApiClient {
250
395
  start?: number;
251
396
  search?: string;
252
397
  limit?: number;
398
+ include_archived?: boolean;
399
+ search_content?: boolean;
253
400
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionListResponses, unknown, ThrowOnError, "fields">;
254
401
  /**
255
402
  * Create session
@@ -258,6 +405,7 @@ export declare class Session extends HeyApiClient {
258
405
  */
259
406
  create<ThrowOnError extends boolean = false>(parameters?: {
260
407
  directory?: string;
408
+ id?: string;
261
409
  parentID?: string;
262
410
  title?: string;
263
411
  permission?: PermissionRuleset;
@@ -390,6 +538,7 @@ export declare class Session extends HeyApiClient {
390
538
  providerID?: string;
391
539
  modelID?: string;
392
540
  auto?: boolean;
541
+ customInstructions?: string;
393
542
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionSummarizeResponses, SessionSummarizeErrors, ThrowOnError, "fields">;
394
543
  /**
395
544
  * Get session messages
@@ -420,7 +569,10 @@ export declare class Session extends HeyApiClient {
420
569
  [key: string]: boolean;
421
570
  };
422
571
  system?: string;
572
+ systemOverride?: string;
423
573
  variant?: string;
574
+ kairos?: boolean;
575
+ terminalFocus?: boolean;
424
576
  parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
425
577
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptResponses, SessionPromptErrors, ThrowOnError, "fields">;
426
578
  /**
@@ -452,7 +604,10 @@ export declare class Session extends HeyApiClient {
452
604
  [key: string]: boolean;
453
605
  };
454
606
  system?: string;
607
+ systemOverride?: string;
455
608
  variant?: string;
609
+ kairos?: boolean;
610
+ terminalFocus?: boolean;
456
611
  parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
457
612
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError, "fields">;
458
613
  /**
@@ -503,6 +658,7 @@ export declare class Session extends HeyApiClient {
503
658
  directory?: string;
504
659
  messageID?: string;
505
660
  partID?: string;
661
+ mode?: "both" | "conversation" | "files";
506
662
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionRevertResponses, SessionRevertErrors, ThrowOnError, "fields">;
507
663
  /**
508
664
  * Restore reverted messages
@@ -513,6 +669,17 @@ export declare class Session extends HeyApiClient {
513
669
  sessionID: string;
514
670
  directory?: string;
515
671
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionUnrevertResponses, SessionUnrevertErrors, ThrowOnError, "fields">;
672
+ /**
673
+ * Rate the last Auto-routed turn
674
+ *
675
+ * Send explicit 👍/👎 feedback for the most recent turn that the 'Auto' model router steered. Attributed to that turn's routing decision and forwarded to the routing proxy. A no-op (matched:false) when the last turn was not proxy-routed.
676
+ */
677
+ feedback<ThrowOnError extends boolean = false>(parameters: {
678
+ sessionID: string;
679
+ directory?: string;
680
+ explicit?: "up" | "down";
681
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionFeedbackResponses, SessionFeedbackErrors, ThrowOnError, "fields">;
682
+ revert2: Revert;
516
683
  }
517
684
  export declare class Part extends HeyApiClient {
518
685
  /**
@@ -808,7 +975,7 @@ export declare class Mcp extends HeyApiClient {
808
975
  connect<ThrowOnError extends boolean = false>(parameters: {
809
976
  name: string;
810
977
  directory?: string;
811
- }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpConnectResponses, unknown, ThrowOnError, "fields">;
978
+ }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<McpConnectResponses, McpConnectErrors, ThrowOnError, "fields">;
812
979
  /**
813
980
  * Disconnect an MCP server
814
981
  */
@@ -987,6 +1154,9 @@ export declare class X100PromptClient extends HeyApiClient {
987
1154
  });
988
1155
  global: Global;
989
1156
  project: Project;
1157
+ plugin: Plugin;
1158
+ trust: Trust;
1159
+ remoteBridge: RemoteBridge;
990
1160
  pty: Pty;
991
1161
  config: Config;
992
1162
  tool: Tool;