indusagi-coding-agent 0.2.8 → 0.2.10

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 (222) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/entry.js +4 -4
  3. package/dist/index.js +4 -4
  4. package/package.json +3 -2
  5. package/src/_decls/entry.ts +18 -0
  6. package/src/_decls/guardrails.ts +35 -0
  7. package/src/_decls/index.ts +26 -0
  8. package/src/addons/contract.ts +236 -0
  9. package/src/addons/dispatch/event-dispatcher.ts +164 -0
  10. package/src/addons/dispatch/index.ts +25 -0
  11. package/src/addons/dispatch/tool-interceptor.ts +208 -0
  12. package/src/addons/host.ts +225 -0
  13. package/src/addons/index.ts +112 -0
  14. package/src/addons/manifest.ts +158 -0
  15. package/src/addons/sandbox.ts +170 -0
  16. package/src/addons/surface.ts +78 -0
  17. package/src/boot/auth-vault.ts +195 -0
  18. package/src/boot/boot.ts +138 -0
  19. package/src/boot/contract.ts +238 -0
  20. package/src/boot/heap.ts +59 -0
  21. package/src/boot/index.ts +28 -0
  22. package/src/boot/invocation.ts +93 -0
  23. package/src/boot/runners/addon-wiring.ts +153 -0
  24. package/src/boot/runners/checkpoint.ts +169 -0
  25. package/src/boot/runners/delegate-runner.ts +294 -0
  26. package/src/boot/runners/index.ts +13 -0
  27. package/src/boot/runners/link-runner.ts +45 -0
  28. package/src/boot/runners/memdir.ts +168 -0
  29. package/src/boot/runners/oneshot-runner.ts +58 -0
  30. package/src/boot/runners/read-state.ts +90 -0
  31. package/src/boot/runners/registry.ts +42 -0
  32. package/src/boot/runners/repl-runner.ts +143 -0
  33. package/src/boot/runners/server-mode.ts +121 -0
  34. package/src/boot/runners/session.ts +641 -0
  35. package/src/boot/server-token.ts +148 -0
  36. package/src/boot/stages.ts +167 -0
  37. package/src/boot/upgrade/apply.ts +94 -0
  38. package/src/boot/upgrade/index.ts +13 -0
  39. package/src/boot/upgrade/upgrades.ts +289 -0
  40. package/src/briefing/compose.ts +150 -0
  41. package/src/briefing/context-docs.ts +19 -0
  42. package/src/briefing/contract.ts +717 -0
  43. package/src/briefing/index.ts +31 -0
  44. package/src/briefing/macros.ts +97 -0
  45. package/src/briefing/skills.ts +47 -0
  46. package/src/capability-deck/bridge-ledger/index.ts +27 -0
  47. package/src/capability-deck/bridge-ledger/key.ts +67 -0
  48. package/src/capability-deck/bridge-ledger/ledger.ts +131 -0
  49. package/src/capability-deck/bridge-ledger/network.ts +117 -0
  50. package/src/capability-deck/builtin-bridge.ts +312 -0
  51. package/src/capability-deck/cards/bg-process-card.ts +335 -0
  52. package/src/capability-deck/cards/index.ts +115 -0
  53. package/src/capability-deck/cards/memory-card.ts +146 -0
  54. package/src/capability-deck/cards/plan-file.ts +97 -0
  55. package/src/capability-deck/cards/plan-tools.ts +185 -0
  56. package/src/capability-deck/cards/saas-card.ts +183 -0
  57. package/src/capability-deck/cards/task-card.ts +207 -0
  58. package/src/capability-deck/cards/todo-card.ts +168 -0
  59. package/src/capability-deck/cards/workflow-card.ts +247 -0
  60. package/src/capability-deck/contract.ts +388 -0
  61. package/src/capability-deck/index.ts +48 -0
  62. package/src/capability-deck/manifest.ts +109 -0
  63. package/src/capability-deck/provision.ts +169 -0
  64. package/src/channels/contract.ts +191 -0
  65. package/src/channels/framer.ts +50 -0
  66. package/src/channels/index.ts +101 -0
  67. package/src/channels/link/dialog.ts +129 -0
  68. package/src/channels/link/driver.ts +190 -0
  69. package/src/channels/link/index.ts +34 -0
  70. package/src/channels/link/server.ts +134 -0
  71. package/src/channels/oneshot.ts +90 -0
  72. package/src/channels/ops.ts +65 -0
  73. package/src/channels/session-ops.ts +81 -0
  74. package/src/conductor/bash-guard.ts +599 -0
  75. package/src/conductor/catalog/catalog.ts +116 -0
  76. package/src/conductor/catalog/index.ts +8 -0
  77. package/src/conductor/catalog/matcher.ts +134 -0
  78. package/src/conductor/conductor.ts +234 -0
  79. package/src/conductor/contract.ts +842 -0
  80. package/src/conductor/diagnostics.ts +227 -0
  81. package/src/conductor/index.ts +33 -0
  82. package/src/conductor/permissions.ts +588 -0
  83. package/src/conductor/quota-error.ts +49 -0
  84. package/src/conductor/signal-hub/hub.ts +46 -0
  85. package/src/conductor/signal-hub/index.ts +2 -0
  86. package/src/conductor/signal-hub/translate.test.ts +81 -0
  87. package/src/conductor/signal-hub/translate.ts +74 -0
  88. package/src/conductor/skill-parse/index.ts +2 -0
  89. package/src/conductor/skill-parse/parse.ts +108 -0
  90. package/src/conductor/transcript-store/index.ts +22 -0
  91. package/src/conductor/transcript-store/serialize.ts +116 -0
  92. package/src/conductor/transcript-store/store.ts +205 -0
  93. package/src/console/auth-status.ts +56 -0
  94. package/src/console/components/AgentsView.ts +165 -0
  95. package/src/console/components/BackgroundAgents.ts +155 -0
  96. package/src/console/components/Banner.ts +334 -0
  97. package/src/console/components/Composer.ts +94 -0
  98. package/src/console/components/StatusBar.ts +49 -0
  99. package/src/console/components/TerminalConsole.ts +1090 -0
  100. package/src/console/components/WorkingIndicator.ts +98 -0
  101. package/src/console/components/banner-sweep.ts +24 -0
  102. package/src/console/components/welcome.ts +74 -0
  103. package/src/console/contract.ts +630 -0
  104. package/src/console/index.ts +34 -0
  105. package/src/console/input/complete.ts +127 -0
  106. package/src/console/input/dir-reader.ts +34 -0
  107. package/src/console/input/index.ts +23 -0
  108. package/src/console/input/keymap.ts +159 -0
  109. package/src/console/input/paste.ts +104 -0
  110. package/src/console/mount.ts +56 -0
  111. package/src/console/overlays/approval-queue.ts +57 -0
  112. package/src/console/overlays/approval.ts +130 -0
  113. package/src/console/overlays/auth.ts +342 -0
  114. package/src/console/overlays/boards.ts +308 -0
  115. package/src/console/overlays/host.ts +36 -0
  116. package/src/console/overlays/index.ts +26 -0
  117. package/src/console/overlays/pickers.ts +258 -0
  118. package/src/console/overlays/sessions.ts +190 -0
  119. package/src/console/reducer.ts +182 -0
  120. package/src/console/slash/builtins.ts +81 -0
  121. package/src/console/slash/commands/dynamic.ts +83 -0
  122. package/src/console/slash/commands/integrations.ts +695 -0
  123. package/src/console/slash/commands/shared.ts +75 -0
  124. package/src/console/slash/commands/transcript.ts +263 -0
  125. package/src/console/slash/commands/workbench.ts +246 -0
  126. package/src/console/slash/index.ts +15 -0
  127. package/src/console/slash/registry.ts +70 -0
  128. package/src/console/slash/resolve.ts +63 -0
  129. package/src/console/startup.ts +209 -0
  130. package/src/console/theme/adapter.ts +45 -0
  131. package/src/console/theme/index.ts +7 -0
  132. package/src/console/theme/palette.ts +68 -0
  133. package/src/console/theme/resolve.ts +39 -0
  134. package/src/console/theme/tokens.ts +71 -0
  135. package/src/entry.ts +55 -0
  136. package/src/guardrails.ts +37 -0
  137. package/src/index.ts +18 -0
  138. package/src/insight/channel.ts +88 -0
  139. package/src/insight/contract.ts +185 -0
  140. package/src/insight/index.ts +110 -0
  141. package/src/insight/recorder.ts +213 -0
  142. package/src/insight/redaction.ts +157 -0
  143. package/src/insight/replay.ts +158 -0
  144. package/src/insight/sampling.ts +70 -0
  145. package/src/insight/serialize.ts +50 -0
  146. package/src/insight/sinks/console.ts +64 -0
  147. package/src/insight/sinks/file.ts +40 -0
  148. package/src/insight/sinks/index.ts +24 -0
  149. package/src/insight/sinks/stream.ts +54 -0
  150. package/src/integrations/sarvam/attach.ts +239 -0
  151. package/src/integrations/sarvam/config.ts +156 -0
  152. package/src/integrations/sarvam/index.ts +25 -0
  153. package/src/integrations/sarvam/sarvam.test.ts +60 -0
  154. package/src/integrations/sarvam/types.ts +27 -0
  155. package/src/integrations/zoho/attach.ts +342 -0
  156. package/src/integrations/zoho/config.ts +125 -0
  157. package/src/integrations/zoho/index.ts +27 -0
  158. package/src/integrations/zoho/types.ts +21 -0
  159. package/src/integrations/zoho/zoho.test.ts +50 -0
  160. package/src/kit/clipboard-image.ts +107 -0
  161. package/src/kit/external-editor.ts +48 -0
  162. package/src/kit/image.ts +59 -0
  163. package/src/kit/index.ts +51 -0
  164. package/src/kit/shell.ts +19 -0
  165. package/src/kit/tool-fetch.ts +85 -0
  166. package/src/launch/catalog.ts +148 -0
  167. package/src/launch/contract.ts +187 -0
  168. package/src/launch/credentials.ts +625 -0
  169. package/src/launch/index.ts +98 -0
  170. package/src/launch/invocation/attachments.ts +179 -0
  171. package/src/launch/invocation/flags.ts +196 -0
  172. package/src/launch/invocation/index.ts +25 -0
  173. package/src/launch/invocation/read.ts +260 -0
  174. package/src/launch/invocation/usage.ts +67 -0
  175. package/src/launch/login.ts +324 -0
  176. package/src/launch/oauth.test.ts +18 -0
  177. package/src/launch/oauth.ts +203 -0
  178. package/src/launch/packages.ts +194 -0
  179. package/src/launch/pickers.ts +189 -0
  180. package/src/runtime-bridge/bridges/_drive.ts +96 -0
  181. package/src/runtime-bridge/bridges/builtins.ts +68 -0
  182. package/src/runtime-bridge/bridges/claude-cli.ts +123 -0
  183. package/src/runtime-bridge/bridges/codex-cli.ts +142 -0
  184. package/src/runtime-bridge/bridges/index.ts +33 -0
  185. package/src/runtime-bridge/bridges/indusagi-cli.ts +155 -0
  186. package/src/runtime-bridge/broker.ts +227 -0
  187. package/src/runtime-bridge/contract.ts +122 -0
  188. package/src/runtime-bridge/index.ts +79 -0
  189. package/src/runtime-bridge/sink.ts +180 -0
  190. package/src/sessions/contract.ts +81 -0
  191. package/src/sessions/index.ts +13 -0
  192. package/src/sessions/library.ts +229 -0
  193. package/src/settings/contract.ts +114 -0
  194. package/src/settings/index.ts +32 -0
  195. package/src/settings/manager.ts +117 -0
  196. package/src/transcript-export/index.ts +45 -0
  197. package/src/transcript-export/publish.ts +260 -0
  198. package/src/transcript-export/sgr.ts +315 -0
  199. package/src/transcript-export/template.ts +272 -0
  200. package/src/transcript-export/theme-bridge.ts +150 -0
  201. package/src/window-budget/budget/estimate.ts +135 -0
  202. package/src/window-budget/budget/gate.ts +33 -0
  203. package/src/window-budget/budget/index.ts +16 -0
  204. package/src/window-budget/budget/slice.ts +56 -0
  205. package/src/window-budget/condenser.ts +58 -0
  206. package/src/window-budget/contract.ts +184 -0
  207. package/src/window-budget/index.ts +19 -0
  208. package/src/window-budget/microcompact.ts +95 -0
  209. package/src/window-budget/rehydrate.ts +136 -0
  210. package/src/window-budget/summarize/condense.ts +103 -0
  211. package/src/window-budget/summarize/index.ts +14 -0
  212. package/src/window-budget/summarize/prompt.ts +149 -0
  213. package/src/workflow-engine/agent-runner.ts +181 -0
  214. package/src/workflow-engine/display.ts +224 -0
  215. package/src/workflow-engine/engine.ts +294 -0
  216. package/src/workflow-engine/index.ts +23 -0
  217. package/src/workflow-engine/parse.ts +172 -0
  218. package/src/workflow-engine/structured-output.ts +35 -0
  219. package/src/workspace/brand.ts +29 -0
  220. package/src/workspace/index.ts +18 -0
  221. package/src/workspace/locator.ts +103 -0
  222. package/src/workspace/runtime-detect.ts +64 -0
@@ -0,0 +1,98 @@
1
+ // @ts-nocheck
2
+ // Type declarations recovered from dist/types (no runtime body)
3
+ /**
4
+ * Launch subsystem — public barrel.
5
+ *
6
+ * Re-exports the frozen Phase-10 contract surface: the parsed
7
+ * {@link Invocation} and its {@link OutputMode} / {@link ThinkingEffort} /
8
+ * {@link ToolName} vocabularies, the declarative {@link FlagSpec} table types,
9
+ * the gathered {@link Attachments} shape, the typed {@link CredentialFault}
10
+ * union and its {@link AuthVault} seam, the model-catalog filter, and the resume
11
+ * / settings-browser option shapes. Behavior modules (the reader, the usage
12
+ * renderer, the credential command, the attachment gatherer, the catalog
13
+ * printer, the resume picker, the settings browser) attach their exports here as
14
+ * they land, so consumers import the launch surface from `src/launch` rather
15
+ * than reaching into individual modules.
16
+ */
17
+ export type {
18
+ OutputMode,
19
+ ThinkingEffort,
20
+ ToolName,
21
+ FlagKind,
22
+ FlagDefault,
23
+ FlagSpec,
24
+ Invocation,
25
+ FlagValue,
26
+ Attachments,
27
+ AttachmentOptions,
28
+ CredentialVerb,
29
+ ProviderEntry,
30
+ CredentialFaultKind,
31
+ CredentialFault,
32
+ AuthVault,
33
+ CredentialCommandOptions,
34
+ CatalogFilter,
35
+ SessionLoader,
36
+ ResumeFault,
37
+ SettingsBrowseOptions,
38
+ ResumeRef,
39
+ ThinkingLevel,
40
+ SessionListProgress,
41
+ ImageContent,
42
+ KnownProvider,
43
+ ModelRegistry,
44
+ OAuthCredentials,
45
+ Settings,
46
+ RunnerId,
47
+ } from "./contract.js";
48
+ export {
49
+ THINKING_EFFORTS,
50
+ TOOL_NAMES,
51
+ isThinkingEffort,
52
+ isOutputMode,
53
+ isToolName,
54
+ credentialFault,
55
+ } from "./contract.js";
56
+ export {
57
+ FLAG_SPECS,
58
+ FLAG_GROUPS,
59
+ readInvocation,
60
+ readFileReferences,
61
+ renderUsage,
62
+ gatherAttachments,
63
+ AttachmentError,
64
+ } from "./invocation/index.js";
65
+ export type { FlagGroup, GroupedFlagSpec, AttachmentErrorKind } from "./invocation/index.js";
66
+ export { runPackageCommand, defaultPackageIo, PACKAGE_COMMANDS } from "./packages.js";
67
+ export type { PackageCommand, PackageIo, PackageCommandOptions, PackageResult } from "./packages.js";
68
+ export {
69
+ runCredentialCommand,
70
+ defaultCredentialIo,
71
+ formatCredentialFault,
72
+ validateApiKey,
73
+ validateAccountName,
74
+ findProvider,
75
+ isOAuthCapable,
76
+ asSigninMethod,
77
+ PROVIDER_DIRECTORY,
78
+ } from "./credentials.js";
79
+ export type { CredentialIo, CredentialResult, SigninMethod } from "./credentials.js";
80
+ export {
81
+ registerBuiltInOAuthProviders,
82
+ listLoginProviders,
83
+ startOAuthLogin,
84
+ openLoginUrl,
85
+ hasRegisteredOAuthClientId,
86
+ } from "./oauth.js";
87
+ export type { AuthKind, LoginProvider, OAuthLoginResult } from "./oauth.js";
88
+ export { printModelCatalog, defaultCatalogIo, registrySource } from "./catalog.js";
89
+ export type { CatalogIo, CatalogModelSource } from "./catalog/index.js";
90
+ export {
91
+ pickResumeTarget,
92
+ browseSettings,
93
+ mergeSessions,
94
+ renderSettingsListing,
95
+ defaultResumeDeps,
96
+ defaultSettingsBrowseIo,
97
+ } from "./pickers.js";
98
+ export type { ResumeDeps, ResumeOutcome, SettingsBrowseIo } from "./pickers.js";
@@ -0,0 +1,179 @@
1
+ /**
2
+ * The attachment gatherer — expands `@file` references into one
3
+ * {@link Attachments} value.
4
+ */
5
+ import { readFile, stat } from "node:fs/promises";
6
+ import { extname } from "node:path";
7
+ import type { ImageContent } from "indusagi/ai";
8
+ import { resolveReadPath } from "indusagi/agent";
9
+ import type { Attachments, AttachmentOptions } from "../contract.js";
10
+
11
+ const MAX_TEXT_BYTES = 10 * 1024 * 1024;
12
+ const MAX_IMAGE_BYTES = 20 * 1024 * 1024;
13
+
14
+ const TEXT_EXTENSIONS: ReadonlySet<string> = new Set([
15
+ ".txt",
16
+ ".md",
17
+ ".markdown",
18
+ ".json",
19
+ ".jsonc",
20
+ ".yaml",
21
+ ".yml",
22
+ ".toml",
23
+ ".ini",
24
+ ".csv",
25
+ ".tsv",
26
+ ".xml",
27
+ ".html",
28
+ ".htm",
29
+ ".css",
30
+ ".scss",
31
+ ".ts",
32
+ ".tsx",
33
+ ".js",
34
+ ".jsx",
35
+ ".mjs",
36
+ ".cjs",
37
+ ".py",
38
+ ".rb",
39
+ ".go",
40
+ ".rs",
41
+ ".java",
42
+ ".kt",
43
+ ".c",
44
+ ".h",
45
+ ".cc",
46
+ ".cpp",
47
+ ".hpp",
48
+ ".cs",
49
+ ".php",
50
+ ".sh",
51
+ ".bash",
52
+ ".zsh",
53
+ ".sql",
54
+ ".log",
55
+ ".env",
56
+ ".gitignore",
57
+ ".dockerfile",
58
+ ]);
59
+
60
+ const IMAGE_MIME_BY_EXT: ReadonlyMap<string, string> = new Map([
61
+ [".png", "image/png"],
62
+ [".jpg", "image/jpeg"],
63
+ [".jpeg", "image/jpeg"],
64
+ [".gif", "image/gif"],
65
+ [".webp", "image/webp"],
66
+ [".bmp", "image/bmp"],
67
+ [".svg", "image/svg+xml"],
68
+ ]);
69
+
70
+ export type AttachmentErrorKind = "unsupported" | "too-large" | "not-found" | "read-failed";
71
+
72
+ export class AttachmentError extends Error {
73
+ readonly kind: AttachmentErrorKind;
74
+ readonly reference: string;
75
+ readonly resolvedPath?: string;
76
+ readonly cause?: unknown;
77
+
78
+ constructor(
79
+ kind: AttachmentErrorKind,
80
+ message: string,
81
+ detail: { reference: string; resolvedPath?: string; cause?: unknown },
82
+ ) {
83
+ super(message);
84
+ this.name = "AttachmentError";
85
+ this.kind = kind;
86
+ this.reference = detail.reference;
87
+ if (detail.resolvedPath !== undefined) this.resolvedPath = detail.resolvedPath;
88
+ if (detail.cause !== undefined) this.cause = detail.cause;
89
+ }
90
+ }
91
+
92
+ function extensionOf(path: string): string {
93
+ return extname(path).toLowerCase();
94
+ }
95
+
96
+ function isMissing(error: unknown): boolean {
97
+ return (
98
+ typeof error === "object" &&
99
+ error !== null &&
100
+ "code" in error &&
101
+ (error as { code?: unknown }).code === "ENOENT"
102
+ );
103
+ }
104
+
105
+ async function sizeOf(resolvedPath: string, reference: string): Promise<number> {
106
+ try {
107
+ const info = await stat(resolvedPath);
108
+ return info.size;
109
+ } catch (error) {
110
+ if (isMissing(error)) {
111
+ throw new AttachmentError("not-found", `No such file: ${reference}`, {
112
+ reference,
113
+ resolvedPath,
114
+ cause: error,
115
+ });
116
+ }
117
+ throw new AttachmentError("read-failed", `Could not access file: ${reference}`, {
118
+ reference,
119
+ resolvedPath,
120
+ cause: error,
121
+ });
122
+ }
123
+ }
124
+
125
+ function wrapTextBlock(resolvedPath: string, body: string): string {
126
+ return `<file path="${resolvedPath}">\n${body}\n</file>`;
127
+ }
128
+
129
+ /**
130
+ * Expand the `@file` references into a single {@link Attachments} value.
131
+ */
132
+ export async function gatherAttachments(
133
+ references: readonly string[],
134
+ options: AttachmentOptions,
135
+ ): Promise<Attachments> {
136
+ const blocks: string[] = [];
137
+ const media: ImageContent[] = [];
138
+ for (const reference of references) {
139
+ const resolvedPath = resolveReadPath(reference, options.cwd);
140
+ const ext = extensionOf(resolvedPath);
141
+ const imageMime = IMAGE_MIME_BY_EXT.get(ext);
142
+ const isText = TEXT_EXTENSIONS.has(ext);
143
+ if (imageMime === undefined && !isText) {
144
+ throw new AttachmentError("unsupported", `Unsupported attachment type: ${reference}`, {
145
+ reference,
146
+ resolvedPath,
147
+ });
148
+ }
149
+ const size = await sizeOf(resolvedPath, reference);
150
+ if (size === 0) continue;
151
+ const cap = imageMime !== undefined ? MAX_IMAGE_BYTES : MAX_TEXT_BYTES;
152
+ if (size > cap) {
153
+ throw new AttachmentError("too-large", `Attachment exceeds the size limit: ${reference}`, {
154
+ reference,
155
+ resolvedPath,
156
+ });
157
+ }
158
+ try {
159
+ if (imageMime !== undefined) {
160
+ const bytes = await readFile(resolvedPath);
161
+ media.push({
162
+ type: "image",
163
+ data: bytes.toString("base64"),
164
+ mimeType: imageMime,
165
+ });
166
+ } else {
167
+ const body = await readFile(resolvedPath, "utf8");
168
+ if (body.length > 0) blocks.push(wrapTextBlock(resolvedPath, body));
169
+ }
170
+ } catch (error) {
171
+ throw new AttachmentError("read-failed", `Could not read file: ${reference}`, {
172
+ reference,
173
+ resolvedPath,
174
+ cause: error,
175
+ });
176
+ }
177
+ }
178
+ return { prose: blocks.join("\n\n"), media };
179
+ }
@@ -0,0 +1,196 @@
1
+ /**
2
+ * The single declarative flag table.
3
+ *
4
+ * Every recognised command-line option is described here exactly once, as one
5
+ * {@link FlagSpec} row.
6
+ */
7
+ import type { FlagSpec } from "../contract.js";
8
+
9
+ export type FlagGroup = "output" | "model" | "context" | "tools" | "meta";
10
+
11
+ export interface GroupedFlagSpec extends FlagSpec {
12
+ readonly group: FlagGroup;
13
+ }
14
+
15
+ export const FLAG_GROUPS: readonly { readonly id: FlagGroup; readonly title: string }[] = [
16
+ { id: "output", title: "Output" },
17
+ { id: "model", title: "Model" },
18
+ { id: "context", title: "Context" },
19
+ { id: "tools", title: "Tools" },
20
+ { id: "meta", title: "Meta" },
21
+ ];
22
+
23
+ const THINKING_CHOICES = ["off", "minimal", "low", "medium", "high", "xhigh"];
24
+
25
+ export const FLAG_SPECS: readonly GroupedFlagSpec[] = [
26
+ /* ---- Output ---------------------------------------------------------- */
27
+ {
28
+ name: "--print",
29
+ aliases: ["-p"],
30
+ kind: "boolean",
31
+ group: "output",
32
+ describe: "Run a single request, print only the result, and exit.",
33
+ },
34
+ {
35
+ name: "--json",
36
+ aliases: ["--rpc"],
37
+ kind: "boolean",
38
+ group: "output",
39
+ describe: "Speak the headless line protocol for a driving parent process.",
40
+ },
41
+ {
42
+ name: "--interactive",
43
+ aliases: ["-i"],
44
+ kind: "boolean",
45
+ group: "output",
46
+ describe: "Force the interactive session even when a prompt is supplied.",
47
+ },
48
+ /* ---- Model ----------------------------------------------------------- */
49
+ {
50
+ name: "--model",
51
+ aliases: ["-m"],
52
+ kind: "string",
53
+ group: "model",
54
+ describe: "Select the model, provider-qualified or bare (e.g. provider/name).",
55
+ },
56
+ {
57
+ name: "--fallback-model",
58
+ kind: "string",
59
+ group: "model",
60
+ describe: "Model to switch to mid-turn when the selected model is overloaded (HTTP 529).",
61
+ },
62
+ {
63
+ name: "--account",
64
+ kind: "string",
65
+ group: "model",
66
+ describe: "Authenticate the run with a named stored credential account.",
67
+ },
68
+ {
69
+ name: "--thinking",
70
+ kind: "string",
71
+ group: "model",
72
+ describe: `Set the reasoning effort (one of: ${THINKING_CHOICES.join(", ")}).`,
73
+ },
74
+ {
75
+ name: "--list-models",
76
+ kind: "string",
77
+ group: "model",
78
+ describe: "List the available models (optionally filtered by a substring) and exit.",
79
+ },
80
+ /* ---- Context --------------------------------------------------------- */
81
+ {
82
+ name: "--cwd",
83
+ kind: "string",
84
+ group: "context",
85
+ describe: "Scope the run to a working directory (default: the current directory).",
86
+ },
87
+ {
88
+ name: "--system",
89
+ kind: "string",
90
+ group: "context",
91
+ describe: "Replace the built-in system prompt with the given text.",
92
+ },
93
+ {
94
+ name: "--append-system",
95
+ kind: "string",
96
+ group: "context",
97
+ describe: "Append extra text after the system prompt.",
98
+ },
99
+ {
100
+ name: "--resume",
101
+ aliases: ["-r"],
102
+ kind: "boolean",
103
+ group: "context",
104
+ describe: "Pick a previous session to resume.",
105
+ },
106
+ {
107
+ name: "--continue",
108
+ aliases: ["-c"],
109
+ kind: "boolean",
110
+ group: "context",
111
+ describe: "Continue the most recent session in this directory.",
112
+ },
113
+ /* ---- Tools ----------------------------------------------------------- */
114
+ {
115
+ name: "--tools",
116
+ kind: "list",
117
+ group: "tools",
118
+ describe: "Allow only the named built-in tools (comma-separated or repeated).",
119
+ },
120
+ {
121
+ name: "--no-tools",
122
+ kind: "boolean",
123
+ group: "tools",
124
+ describe: "Disable every built-in tool for this run.",
125
+ },
126
+ {
127
+ name: "--mcp",
128
+ kind: "list",
129
+ group: "tools",
130
+ describe: "Attach an external MCP server endpoint (comma-separated or repeated).",
131
+ },
132
+ {
133
+ name: "--zoho-url",
134
+ kind: "string",
135
+ group: "tools",
136
+ describe: "Zoho MCP server URL (from Zoho Connect tab). Enables native Zoho CRM tools.",
137
+ },
138
+ {
139
+ name: "--zoho",
140
+ kind: "boolean",
141
+ group: "tools",
142
+ describe: "Force-enable Zoho tools when ZOHO_MCP_URL or zoho.json is configured.",
143
+ },
144
+ {
145
+ name: "--no-zoho",
146
+ kind: "boolean",
147
+ group: "tools",
148
+ describe: "Disable Zoho MCP tools for this run.",
149
+ },
150
+ {
151
+ name: "--sarvam",
152
+ kind: "boolean",
153
+ group: "tools",
154
+ describe: "Force-enable Sarvam MCP tools when SARVAM_API_KEY is configured.",
155
+ },
156
+ {
157
+ name: "--no-sarvam",
158
+ kind: "boolean",
159
+ group: "tools",
160
+ describe: "Disable Sarvam MCP tools for this run.",
161
+ },
162
+ {
163
+ name: "--sarvam-key",
164
+ kind: "string",
165
+ group: "tools",
166
+ describe: "Sarvam API key for this run (prefer SARVAM_API_KEY env).",
167
+ },
168
+ {
169
+ name: "--sarvam-base-path",
170
+ kind: "string",
171
+ group: "tools",
172
+ describe: "Directory for Sarvam TTS/docs output (default ~/Desktop).",
173
+ },
174
+ {
175
+ name: "--permission-mode",
176
+ kind: "string",
177
+ group: "tools",
178
+ describe:
179
+ "Open in the given permission mode: default, acceptEdits, plan, or bypass. On headless runs (--print/--json) `default` denies tools that would prompt.",
180
+ },
181
+ /* ---- Meta ------------------------------------------------------------ */
182
+ {
183
+ name: "--help",
184
+ aliases: ["-h"],
185
+ kind: "boolean",
186
+ group: "meta",
187
+ describe: "Show this usage and exit.",
188
+ },
189
+ {
190
+ name: "--version",
191
+ aliases: ["-v"],
192
+ kind: "boolean",
193
+ group: "meta",
194
+ describe: "Show the version and exit.",
195
+ },
196
+ ];
@@ -0,0 +1,25 @@
1
+ // @ts-nocheck
2
+ // Type declarations recovered from dist/types (no runtime body)
3
+ /**
4
+ * Invocation subsystem — public barrel.
5
+ *
6
+ * Bundles the command-line behavior modules that all read the single
7
+ * declarative {@link FLAG_SPECS} table:
8
+ *
9
+ * - {@link readInvocation} — the generic, table-driven argv parser that folds
10
+ * a sliced argument vector into a typed {@link Invocation};
11
+ * - {@link renderUsage} — the `--help` banner generated from that same table,
12
+ * so help and parsing share one source of truth;
13
+ * - {@link gatherAttachments} — the `@file` expander that resolves references
14
+ * through the framework path resolver into inlined prose plus base64 media,
15
+ * raising a typed {@link AttachmentError} on failure.
16
+ *
17
+ * Consumers import the invocation surface from `src/launch/invocation` rather
18
+ * than reaching into the individual modules.
19
+ */
20
+ export { FLAG_SPECS, FLAG_GROUPS } from "./flags.js";
21
+ export type { FlagGroup, GroupedFlagSpec } from "./flags.js";
22
+ export { readInvocation, readFileReferences } from "./read.js";
23
+ export { renderUsage } from "./usage.js";
24
+ export { gatherAttachments, AttachmentError } from "./attachments.js";
25
+ export type { AttachmentErrorKind } from "./attachments.js";