@vibefield/puppeteer-adapter-claude 0.0.0-stage → 0.2.0

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 (215) hide show
  1. package/LICENSE +21 -0
  2. package/dist/detection.d.ts +78 -0
  3. package/dist/detection.d.ts.map +1 -0
  4. package/dist/detection.js +167 -0
  5. package/dist/detection.js.map +1 -0
  6. package/dist/driver.d.ts +145 -0
  7. package/dist/driver.d.ts.map +1 -0
  8. package/dist/driver.js +840 -0
  9. package/dist/driver.js.map +1 -0
  10. package/dist/generated/detection-surface.d.ts +30 -0
  11. package/dist/generated/detection-surface.d.ts.map +1 -0
  12. package/dist/generated/detection-surface.js +34 -0
  13. package/dist/generated/detection-surface.js.map +1 -0
  14. package/dist/generated/registry.d.ts +45 -0
  15. package/dist/generated/registry.d.ts.map +1 -0
  16. package/dist/generated/registry.js +287 -0
  17. package/dist/generated/registry.js.map +1 -0
  18. package/dist/index.d.ts +27 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +27 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/launch/hook-switches.d.ts +32 -0
  23. package/dist/launch/hook-switches.d.ts.map +1 -0
  24. package/dist/launch/hook-switches.js +56 -0
  25. package/dist/launch/hook-switches.js.map +1 -0
  26. package/dist/launch/invocation-grammar.d.ts +196 -0
  27. package/dist/launch/invocation-grammar.d.ts.map +1 -0
  28. package/dist/launch/invocation-grammar.js +857 -0
  29. package/dist/launch/invocation-grammar.js.map +1 -0
  30. package/dist/launch/native-invocation.d.ts +42 -0
  31. package/dist/launch/native-invocation.d.ts.map +1 -0
  32. package/dist/launch/native-invocation.js +130 -0
  33. package/dist/launch/native-invocation.js.map +1 -0
  34. package/dist/launch/prepare.d.ts +137 -0
  35. package/dist/launch/prepare.d.ts.map +1 -0
  36. package/dist/launch/prepare.js +317 -0
  37. package/dist/launch/prepare.js.map +1 -0
  38. package/dist/launch/settings.d.ts +63 -0
  39. package/dist/launch/settings.d.ts.map +1 -0
  40. package/dist/launch/settings.js +94 -0
  41. package/dist/launch/settings.js.map +1 -0
  42. package/dist/normalization/adapter.d.ts +3 -0
  43. package/dist/normalization/adapter.d.ts.map +1 -0
  44. package/dist/normalization/adapter.js +4 -0
  45. package/dist/normalization/adapter.js.map +1 -0
  46. package/dist/normalization/compaction.d.ts +4 -0
  47. package/dist/normalization/compaction.d.ts.map +1 -0
  48. package/dist/normalization/compaction.js +7 -0
  49. package/dist/normalization/compaction.js.map +1 -0
  50. package/dist/normalization/context-window.d.ts +3 -0
  51. package/dist/normalization/context-window.d.ts.map +1 -0
  52. package/dist/normalization/context-window.js +4 -0
  53. package/dist/normalization/context-window.js.map +1 -0
  54. package/dist/normalization/conversation.d.ts +3 -0
  55. package/dist/normalization/conversation.d.ts.map +1 -0
  56. package/dist/normalization/conversation.js +4 -0
  57. package/dist/normalization/conversation.js.map +1 -0
  58. package/dist/normalization/delegation.d.ts +4 -0
  59. package/dist/normalization/delegation.d.ts.map +1 -0
  60. package/dist/normalization/delegation.js +7 -0
  61. package/dist/normalization/delegation.js.map +1 -0
  62. package/dist/normalization/effort.d.ts +8 -0
  63. package/dist/normalization/effort.d.ts.map +1 -0
  64. package/dist/normalization/effort.js +16 -0
  65. package/dist/normalization/effort.js.map +1 -0
  66. package/dist/normalization/environment.d.ts +5 -0
  67. package/dist/normalization/environment.d.ts.map +1 -0
  68. package/dist/normalization/environment.js +10 -0
  69. package/dist/normalization/environment.js.map +1 -0
  70. package/dist/normalization/index.d.ts +20 -0
  71. package/dist/normalization/index.d.ts.map +1 -0
  72. package/dist/normalization/index.js +20 -0
  73. package/dist/normalization/index.js.map +1 -0
  74. package/dist/normalization/interaction.d.ts +38 -0
  75. package/dist/normalization/interaction.d.ts.map +1 -0
  76. package/dist/normalization/interaction.js +60 -0
  77. package/dist/normalization/interaction.js.map +1 -0
  78. package/dist/normalization/mode.d.ts +11 -0
  79. package/dist/normalization/mode.d.ts.map +1 -0
  80. package/dist/normalization/mode.js +37 -0
  81. package/dist/normalization/mode.js.map +1 -0
  82. package/dist/normalization/model.d.ts +5 -0
  83. package/dist/normalization/model.d.ts.map +1 -0
  84. package/dist/normalization/model.js +7 -0
  85. package/dist/normalization/model.js.map +1 -0
  86. package/dist/normalization/monitor-capabilities.d.ts +4 -0
  87. package/dist/normalization/monitor-capabilities.d.ts.map +1 -0
  88. package/dist/normalization/monitor-capabilities.js +121 -0
  89. package/dist/normalization/monitor-capabilities.js.map +1 -0
  90. package/dist/normalization/monitor.d.ts +46 -0
  91. package/dist/normalization/monitor.d.ts.map +1 -0
  92. package/dist/normalization/monitor.js +332 -0
  93. package/dist/normalization/monitor.js.map +1 -0
  94. package/dist/normalization/notification.d.ts +4 -0
  95. package/dist/normalization/notification.d.ts.map +1 -0
  96. package/dist/normalization/notification.js +9 -0
  97. package/dist/normalization/notification.js.map +1 -0
  98. package/dist/normalization/pipeline.d.ts +56 -0
  99. package/dist/normalization/pipeline.d.ts.map +1 -0
  100. package/dist/normalization/pipeline.js +472 -0
  101. package/dist/normalization/pipeline.js.map +1 -0
  102. package/dist/normalization/session.d.ts +6 -0
  103. package/dist/normalization/session.d.ts.map +1 -0
  104. package/dist/normalization/session.js +17 -0
  105. package/dist/normalization/session.js.map +1 -0
  106. package/dist/normalization/tool.d.ts +8 -0
  107. package/dist/normalization/tool.d.ts.map +1 -0
  108. package/dist/normalization/tool.js +64 -0
  109. package/dist/normalization/tool.js.map +1 -0
  110. package/dist/normalization/turn.d.ts +6 -0
  111. package/dist/normalization/turn.d.ts.map +1 -0
  112. package/dist/normalization/turn.js +15 -0
  113. package/dist/normalization/turn.js.map +1 -0
  114. package/dist/normalization/types.d.ts +47 -0
  115. package/dist/normalization/types.d.ts.map +1 -0
  116. package/dist/normalization/types.js +2 -0
  117. package/dist/normalization/types.js.map +1 -0
  118. package/dist/normalization/wire.d.ts +10 -0
  119. package/dist/normalization/wire.d.ts.map +1 -0
  120. package/dist/normalization/wire.js +75 -0
  121. package/dist/normalization/wire.js.map +1 -0
  122. package/dist/normalization/workspace.d.ts +5 -0
  123. package/dist/normalization/workspace.d.ts.map +1 -0
  124. package/dist/normalization/workspace.js +68 -0
  125. package/dist/normalization/workspace.js.map +1 -0
  126. package/dist/observation/hook-bridge.d.ts +72 -0
  127. package/dist/observation/hook-bridge.d.ts.map +1 -0
  128. package/dist/observation/hook-bridge.js +250 -0
  129. package/dist/observation/hook-bridge.js.map +1 -0
  130. package/dist/observation/otel/actor.d.ts +14 -0
  131. package/dist/observation/otel/actor.d.ts.map +1 -0
  132. package/dist/observation/otel/actor.js +44 -0
  133. package/dist/observation/otel/actor.js.map +1 -0
  134. package/dist/observation/otel/capability.d.ts +4 -0
  135. package/dist/observation/otel/capability.d.ts.map +1 -0
  136. package/dist/observation/otel/capability.js +24 -0
  137. package/dist/observation/otel/capability.js.map +1 -0
  138. package/dist/observation/otel/index.d.ts +6 -0
  139. package/dist/observation/otel/index.d.ts.map +1 -0
  140. package/dist/observation/otel/index.js +6 -0
  141. package/dist/observation/otel/index.js.map +1 -0
  142. package/dist/observation/otel/model.d.ts +9 -0
  143. package/dist/observation/otel/model.d.ts.map +1 -0
  144. package/dist/observation/otel/model.js +16 -0
  145. package/dist/observation/otel/model.js.map +1 -0
  146. package/dist/observation/otel/usage.d.ts +16 -0
  147. package/dist/observation/otel/usage.d.ts.map +1 -0
  148. package/dist/observation/otel/usage.js +75 -0
  149. package/dist/observation/otel/usage.js.map +1 -0
  150. package/dist/observation/otel/wire.d.ts +15 -0
  151. package/dist/observation/otel/wire.d.ts.map +1 -0
  152. package/dist/observation/otel/wire.js +147 -0
  153. package/dist/observation/otel/wire.js.map +1 -0
  154. package/dist/observation/semantic-provider.d.ts +45 -0
  155. package/dist/observation/semantic-provider.d.ts.map +1 -0
  156. package/dist/observation/semantic-provider.js +8 -0
  157. package/dist/observation/semantic-provider.js.map +1 -0
  158. package/dist/observation/status-channel.d.ts +70 -0
  159. package/dist/observation/status-channel.d.ts.map +1 -0
  160. package/dist/observation/status-channel.js +268 -0
  161. package/dist/observation/status-channel.js.map +1 -0
  162. package/dist/observation/transcript/conversation.d.ts +6 -0
  163. package/dist/observation/transcript/conversation.d.ts.map +1 -0
  164. package/dist/observation/transcript/conversation.js +170 -0
  165. package/dist/observation/transcript/conversation.js.map +1 -0
  166. package/dist/observation/transcript/index.d.ts +5 -0
  167. package/dist/observation/transcript/index.d.ts.map +1 -0
  168. package/dist/observation/transcript/index.js +5 -0
  169. package/dist/observation/transcript/index.js.map +1 -0
  170. package/dist/observation/transcript/provider.d.ts +7 -0
  171. package/dist/observation/transcript/provider.d.ts.map +1 -0
  172. package/dist/observation/transcript/provider.js +132 -0
  173. package/dist/observation/transcript/provider.js.map +1 -0
  174. package/dist/observation/transcript/services/jsonl-reader.d.ts +12 -0
  175. package/dist/observation/transcript/services/jsonl-reader.d.ts.map +1 -0
  176. package/dist/observation/transcript/services/jsonl-reader.js +140 -0
  177. package/dist/observation/transcript/services/jsonl-reader.js.map +1 -0
  178. package/dist/observation/transcript/services/yield.d.ts +3 -0
  179. package/dist/observation/transcript/services/yield.d.ts.map +1 -0
  180. package/dist/observation/transcript/services/yield.js +15 -0
  181. package/dist/observation/transcript/services/yield.js.map +1 -0
  182. package/dist/observation/transcript/wire.d.ts +26 -0
  183. package/dist/observation/transcript/wire.d.ts.map +1 -0
  184. package/dist/observation/transcript/wire.js +89 -0
  185. package/dist/observation/transcript/wire.js.map +1 -0
  186. package/dist/services/account-usage.d.ts +86 -0
  187. package/dist/services/account-usage.d.ts.map +1 -0
  188. package/dist/services/account-usage.js +813 -0
  189. package/dist/services/account-usage.js.map +1 -0
  190. package/dist/services/distribution.d.ts +64 -0
  191. package/dist/services/distribution.d.ts.map +1 -0
  192. package/dist/services/distribution.js +255 -0
  193. package/dist/services/distribution.js.map +1 -0
  194. package/dist/services/event-source.d.ts +29 -0
  195. package/dist/services/event-source.d.ts.map +1 -0
  196. package/dist/services/event-source.js +38 -0
  197. package/dist/services/event-source.js.map +1 -0
  198. package/dist/services/extensions.d.ts +46 -0
  199. package/dist/services/extensions.d.ts.map +1 -0
  200. package/dist/services/extensions.js +1263 -0
  201. package/dist/services/extensions.js.map +1 -0
  202. package/dist/services/models.d.ts +6 -0
  203. package/dist/services/models.d.ts.map +1 -0
  204. package/dist/services/models.js +90 -0
  205. package/dist/services/models.js.map +1 -0
  206. package/dist/services/profiles.d.ts +48 -0
  207. package/dist/services/profiles.d.ts.map +1 -0
  208. package/dist/services/profiles.js +176 -0
  209. package/dist/services/profiles.js.map +1 -0
  210. package/dist/services/prompt.d.ts +39 -0
  211. package/dist/services/prompt.d.ts.map +1 -0
  212. package/dist/services/prompt.js +107 -0
  213. package/dist/services/prompt.js.map +1 -0
  214. package/package.json +46 -3
  215. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook-switches.js","sourceRoot":"","sources":["../../src/launch/hook-switches.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,oBAAoB,GAGrB,MAAM,kCAAkC,CAAC;AAW1C,KAAK,UAAU,YAAY,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACjE,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAC5E,CAAC,CAAE,MAAkC;YACrC,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,KAAgB,EAAY,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO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196 @@
1
+ /**
2
+ * Claude Code's command line as the installed CLI reads it: one declarative table and the one
3
+ * reader that walks argv with it. The reader states what a typed `claude …` IS — a passthrough
4
+ * (help, a management command, a one-shot, a session that lives elsewhere), a session the managed
5
+ * launch cannot carry (a clause a person reads), or a session it runs with the person's own
6
+ * arguments carried. What a host does with that is the host's policy.
7
+ *
8
+ * The CLI reads argv in two stages and so does this reader, in the CLI's own order. First its
9
+ * entry looks at the raw argv before any parser runs: literal tokens, some only as the first
10
+ * argument, some anywhere, some only before `--` ({@link CLAUDE_ENTRY_RULES},
11
+ * {@link CLAUDE_SUBCOMMANDS}' `dispatch`). Then commander parses the rest (12.x semantics in this
12
+ * build: options anywhere until `--`; unknown options refused; excess operands dropped; positional
13
+ * options, so a subcommand selected as the first operand owns everything after it; subcommands
14
+ * registered only when the argv does not ask for `-p`/`--print`).
15
+ *
16
+ * Every row is evidence-bound to one CLI version: the census test holds the table to the
17
+ * captured `claude --help` in both directions. Evidence per row, and the probes behind the
18
+ * classes: packages/surface/vendors/claude/findings.md §7 and probes/claude@2.1.283/.
19
+ */
20
+ /** The Claude Code version whose grammar this table is. */
21
+ export declare const CLAUDE_INVOCATION_GRAMMAR_VERSION = "2.1.283";
22
+ /**
23
+ * Commander's arity, read from the help's usage column: `none` (a flag), `one` (`<value>`: always
24
+ * the next token, even one that starts with `-`), `optional` (`[value]`: the next token unless it
25
+ * looks like an option), `variadic` (`<values...>`: the next token, then every following token
26
+ * until one looks like an option or is `--`).
27
+ */
28
+ export type ClaudeOptionArity = 'none' | 'one' | 'optional' | 'variadic';
29
+ /**
30
+ * What an option makes of a typed launch. `utility`, `elsewhere` and `one-shot` are passthrough
31
+ * kinds; `print-only` is refused unless `-p` makes the invocation a one-shot; `rejected` is a
32
+ * session option the managed launch cannot carry; `mapped` becomes a managed option; `carried`
33
+ * rides the managed launch verbatim.
34
+ */
35
+ export type ClaudeOptionClass = 'utility' | 'elsewhere' | 'one-shot' | 'print-only' | 'rejected' | 'mapped' | 'carried';
36
+ /** The managed option a mapped row becomes. `resume` covers every resume form. */
37
+ export type ClaudeMappedOption = 'model' | 'effort' | 'permissionMode' | 'settingSources' | 'resume' | 'title';
38
+ export interface ClaudeOptionRow {
39
+ /** Every spelling commander matches, as the help lists them. */
40
+ readonly names: readonly string[];
41
+ readonly arity: ClaudeOptionArity;
42
+ readonly class: ClaudeOptionClass;
43
+ /**
44
+ * The clause this row answers with when it decides the invocation (a person reads a rejected
45
+ * one in their terminal), or, for a mapped or carried row, what the option is.
46
+ */
47
+ readonly why: string;
48
+ readonly maps?: ClaudeMappedOption;
49
+ /** The values commander accepts when it validates them while parsing. */
50
+ readonly choices?: readonly string[];
51
+ /** Present only when the help does not list the option: the evidence that the CLI accepts it. */
52
+ readonly hidden?: string;
53
+ /** Commander keeps its help option apart from the others: a whole token only, never a cluster's head. */
54
+ readonly wholeTokenOnly?: true;
55
+ /** A session given this option reads no settings files, so no status line in them may be delegated to. */
56
+ readonly readsNoSettingsFiles?: true;
57
+ }
58
+ /**
59
+ * How the CLI reaches a subcommand: `command` — commander's first operand, when the argv does not
60
+ * ask for print mode; `first-argument` — the entry's own dispatch, only as argv[0];
61
+ * `after-skip-permission-flags` — the entry's own dispatch, as the first argument after any
62
+ * `--dangerously-skip-permissions` / `--allow-dangerously-skip-permissions`.
63
+ */
64
+ export type ClaudeSubcommandDispatch = 'command' | 'first-argument' | 'after-skip-permission-flags';
65
+ export interface ClaudeSubcommandRow {
66
+ /** The name, then its aliases. */
67
+ readonly names: readonly string[];
68
+ readonly class: 'utility' | 'elsewhere';
69
+ readonly why: string;
70
+ readonly dispatch: readonly ClaudeSubcommandDispatch[];
71
+ /** Present only when the help does not list the subcommand: the evidence that the CLI accepts it. */
72
+ readonly hidden?: string;
73
+ }
74
+ /** Every option the root command accepts at {@link CLAUDE_INVOCATION_GRAMMAR_VERSION}, in the help's order. */
75
+ export declare const CLAUDE_OPTIONS: readonly ClaudeOptionRow[];
76
+ /** Every subcommand the CLI dispatches at {@link CLAUDE_INVOCATION_GRAMMAR_VERSION}, in the help's order. */
77
+ export declare const CLAUDE_SUBCOMMANDS: readonly ClaudeSubcommandRow[];
78
+ /**
79
+ * The entry's checks on the raw argv, before its parser runs. `argvIs`: the whole argv is one of
80
+ * these; `firstTwo`: argv[0] and argv[1]; `subcommand`: a {@link CLAUDE_SUBCOMMANDS} row with that
81
+ * dispatch, at its position (the row's class and why answer); `anywhere`: some token equals one of
82
+ * these, `--` or not (`also`: and some token equals or starts with one of those too); `withNext`:
83
+ * the token appears with a token after it.
84
+ */
85
+ export type ClaudeEntryMatch = {
86
+ readonly argvIs: readonly (readonly string[])[];
87
+ } | {
88
+ readonly firstTwo: readonly [string, string];
89
+ } | {
90
+ readonly subcommand: Exclude<ClaudeSubcommandDispatch, 'command'>;
91
+ } | {
92
+ readonly anywhere: readonly string[];
93
+ readonly also?: {
94
+ readonly tokens: readonly string[];
95
+ readonly prefixes: readonly string[];
96
+ };
97
+ } | {
98
+ readonly withNext: string;
99
+ };
100
+ export interface ClaudeEntryRule {
101
+ readonly id: string;
102
+ readonly match: ClaudeEntryMatch;
103
+ /** Absent for a subcommand match: the subcommand's row answers. */
104
+ readonly class?: 'utility' | 'elsewhere' | 'rejected';
105
+ readonly why?: string;
106
+ }
107
+ /** In the CLI's own order: the first that matches decides. */
108
+ export declare const CLAUDE_ENTRY_RULES: readonly ClaudeEntryRule[];
109
+ /**
110
+ * Checked on the raw argv before the first `--`, whatever the parser makes of the token (even the
111
+ * value of another option): the CLI turns hooks off from them before it parses.
112
+ */
113
+ export declare const CLAUDE_BLINDING_TOKENS: readonly string[];
114
+ /**
115
+ * An environment variable that changes what a session IS, as the flag it stands for does. A
116
+ * typed `claude` inherits the whole shell environment at exec, so these are read too: the
117
+ * provider forwards exactly them to the normalizer (with the config root).
118
+ */
119
+ export interface ClaudeEnvironmentSwitch {
120
+ readonly name: string;
121
+ /** The flag the variable does the work of. */
122
+ readonly flag: string;
123
+ readonly class: 'rejected' | 'carried';
124
+ /** For a rejected switch, the clause a person reads; for a carried one, what it does. */
125
+ readonly why: string;
126
+ readonly readsNoSettingsFiles?: true;
127
+ }
128
+ /**
129
+ * In Claude Code 2.1.283 each is read through one parser, whatever reads it (findings.md §7.5):
130
+ * CLAUDE_CODE_SIMPLE does what --bare does (no hook fires: live F01), CLAUDE_CODE_SAFE_MODE what
131
+ * --safe-mode does (none fires: F03), and CLAUDE_CODE_RESTRICTED what --restricted does (the
132
+ * managed hooks fire, the person's settings files are not read: F04).
133
+ */
134
+ export declare const CLAUDE_ENVIRONMENT_SWITCHES: readonly ClaudeEnvironmentSwitch[];
135
+ /** The CLI's own reading of a switch: on for 1, true, yes or on, in any case, trimmed; off for anything else. */
136
+ export declare function claudeSwitchIsOn(value: string | undefined): boolean;
137
+ /** What the switches in a launch's environment make of an interactive session. */
138
+ export interface ClaudeEnvironmentReading {
139
+ /** The first switch that is on and blinds, named as the person set it (`CLAUDE_CODE_SIMPLE=1`). */
140
+ readonly refusal?: {
141
+ readonly reason: string;
142
+ readonly argument: string;
143
+ };
144
+ readonly readsNoSettingsFiles: boolean;
145
+ }
146
+ export declare function readClaudeEnvironment(environment: Readonly<Record<string, string>>): ClaudeEnvironmentReading;
147
+ /**
148
+ * `claude [options] import [codex|gemini|cursor] [--dry-run] [--yes[=<digest>]]` is rewritten to
149
+ * `claude [options] -- "/import …"` before the parser runs: an interactive session that runs
150
+ * /import (when the CLI has the feature on; otherwise it exits with an error).
151
+ */
152
+ export declare const CLAUDE_IMPORT_REWRITE: {
153
+ readonly token: "import";
154
+ /** None of these may come before it. */
155
+ readonly prefixExcludes: readonly ["--", "-h", "--help", "-v", "-V", "--version"];
156
+ /** Everything after it must be one of these. */
157
+ readonly rest: readonly ["codex", "gemini", "cursor", "--dry-run", "--yes"];
158
+ readonly restPrefixes: readonly ["--yes="];
159
+ };
160
+ /** What the reader makes of a typed argv. */
161
+ export type ClaudeInvocationReading = {
162
+ readonly status: 'passthrough';
163
+ readonly kind: 'utility' | 'elsewhere' | 'one-shot';
164
+ readonly reason: string;
165
+ } | {
166
+ readonly status: 'rejected';
167
+ readonly reason: string;
168
+ readonly argument?: string;
169
+ } | ({
170
+ readonly status: 'accepted';
171
+ } & ClaudeSessionReading);
172
+ /** An interactive session here: what is mapped to managed options, and what rides verbatim. */
173
+ export interface ClaudeSessionReading {
174
+ readonly model?: string;
175
+ readonly effort?: string;
176
+ readonly permissionMode?: string;
177
+ readonly settingSources?: readonly string[];
178
+ /** The person's resume form, as typed (`-c`, `-r [value]`, `--from-pr [value]`, `--resume=…`). */
179
+ readonly resumeInvocation?: readonly string[];
180
+ /** Set when `resumeInvocation` names a conversation id: the managed launch resumes it by id. */
181
+ readonly resume?: string;
182
+ readonly title?: string;
183
+ /** Every carried option and its values, verbatim and in the person's order. */
184
+ readonly carriedArgs: readonly string[];
185
+ /** The operands as typed: the prompt, then any the CLI drops. */
186
+ readonly prompt: readonly string[];
187
+ /** The first carried option that is not the managed launch's own mapping (for implementations that take none). */
188
+ readonly firstCarried?: string;
189
+ readonly readsNoSettingsFiles: boolean;
190
+ }
191
+ /**
192
+ * Read a typed `claude …` (the argv after the command name) the way Claude Code
193
+ * {@link CLAUDE_INVOCATION_GRAMMAR_VERSION} reads it.
194
+ */
195
+ export declare function readClaudeInvocation(argv: readonly string[]): ClaudeInvocationReading;
196
+ //# sourceMappingURL=invocation-grammar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocation-grammar.d.ts","sourceRoot":"","sources":["../../src/launch/invocation-grammar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,iCAAiC,YAAY,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,YAA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