@tickernelz/paperclip-pro-adapter-claude-local 2026.925.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 (206) hide show
  1. package/LICENSE +22 -0
  2. package/dist/cli/format-event.d.ts +2 -0
  3. package/dist/cli/format-event.d.ts.map +1 -0
  4. package/dist/cli/format-event.js +141 -0
  5. package/dist/cli/format-event.js.map +1 -0
  6. package/dist/cli/index.d.ts +2 -0
  7. package/dist/cli/index.d.ts.map +1 -0
  8. package/dist/cli/index.js +2 -0
  9. package/dist/cli/index.js.map +1 -0
  10. package/dist/cli/quota-probe.d.ts +3 -0
  11. package/dist/cli/quota-probe.d.ts.map +1 -0
  12. package/dist/cli/quota-probe.js +106 -0
  13. package/dist/cli/quota-probe.js.map +1 -0
  14. package/dist/index.d.ts +13 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +90 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/index.test.d.ts +2 -0
  19. package/dist/index.test.d.ts.map +1 -0
  20. package/dist/index.test.js +35 -0
  21. package/dist/index.test.js.map +1 -0
  22. package/dist/server/acp.auth.test.d.ts +2 -0
  23. package/dist/server/acp.auth.test.d.ts.map +1 -0
  24. package/dist/server/acp.auth.test.js +581 -0
  25. package/dist/server/acp.auth.test.js.map +1 -0
  26. package/dist/server/acp.d.ts +68 -0
  27. package/dist/server/acp.d.ts.map +1 -0
  28. package/dist/server/acp.js +779 -0
  29. package/dist/server/acp.js.map +1 -0
  30. package/dist/server/acp.quota.test.d.ts +2 -0
  31. package/dist/server/acp.quota.test.d.ts.map +1 -0
  32. package/dist/server/acp.quota.test.js +114 -0
  33. package/dist/server/acp.quota.test.js.map +1 -0
  34. package/dist/server/acp.test.d.ts +2 -0
  35. package/dist/server/acp.test.d.ts.map +1 -0
  36. package/dist/server/acp.test.js +1153 -0
  37. package/dist/server/acp.test.js.map +1 -0
  38. package/dist/server/auth-check.d.ts +8 -0
  39. package/dist/server/auth-check.d.ts.map +1 -0
  40. package/dist/server/auth-check.js +8 -0
  41. package/dist/server/auth-check.js.map +1 -0
  42. package/dist/server/claude-config.d.ts +49 -0
  43. package/dist/server/claude-config.d.ts.map +1 -0
  44. package/dist/server/claude-config.js +279 -0
  45. package/dist/server/claude-config.js.map +1 -0
  46. package/dist/server/claude-config.test.d.ts +2 -0
  47. package/dist/server/claude-config.test.d.ts.map +1 -0
  48. package/dist/server/claude-config.test.js +197 -0
  49. package/dist/server/claude-config.test.js.map +1 -0
  50. package/dist/server/cli-capabilities.d.ts +26 -0
  51. package/dist/server/cli-capabilities.d.ts.map +1 -0
  52. package/dist/server/cli-capabilities.js +115 -0
  53. package/dist/server/cli-capabilities.js.map +1 -0
  54. package/dist/server/config-schema.d.ts +3 -0
  55. package/dist/server/config-schema.d.ts.map +1 -0
  56. package/dist/server/config-schema.js +67 -0
  57. package/dist/server/config-schema.js.map +1 -0
  58. package/dist/server/engine-availability.test.d.ts +2 -0
  59. package/dist/server/engine-availability.test.d.ts.map +1 -0
  60. package/dist/server/engine-availability.test.js +41 -0
  61. package/dist/server/engine-availability.test.js.map +1 -0
  62. package/dist/server/execute.acp-fallback.test.d.ts +2 -0
  63. package/dist/server/execute.acp-fallback.test.d.ts.map +1 -0
  64. package/dist/server/execute.acp-fallback.test.js +104 -0
  65. package/dist/server/execute.acp-fallback.test.js.map +1 -0
  66. package/dist/server/execute.d.ts +23 -0
  67. package/dist/server/execute.d.ts.map +1 -0
  68. package/dist/server/execute.js +1089 -0
  69. package/dist/server/execute.js.map +1 -0
  70. package/dist/server/execute.remote.test.d.ts +2 -0
  71. package/dist/server/execute.remote.test.d.ts.map +1 -0
  72. package/dist/server/execute.remote.test.js +484 -0
  73. package/dist/server/execute.remote.test.js.map +1 -0
  74. package/dist/server/index.d.ts +16 -0
  75. package/dist/server/index.d.ts.map +1 -0
  76. package/dist/server/index.js +84 -0
  77. package/dist/server/index.js.map +1 -0
  78. package/dist/server/models.d.ts +13 -0
  79. package/dist/server/models.d.ts.map +1 -0
  80. package/dist/server/models.js +153 -0
  81. package/dist/server/models.js.map +1 -0
  82. package/dist/server/parse.d.ts +58 -0
  83. package/dist/server/parse.d.ts.map +1 -0
  84. package/dist/server/parse.js +459 -0
  85. package/dist/server/parse.js.map +1 -0
  86. package/dist/server/parse.test.d.ts +2 -0
  87. package/dist/server/parse.test.d.ts.map +1 -0
  88. package/dist/server/parse.test.js +419 -0
  89. package/dist/server/parse.test.js.map +1 -0
  90. package/dist/server/permissions.d.ts +14 -0
  91. package/dist/server/permissions.d.ts.map +1 -0
  92. package/dist/server/permissions.js +13 -0
  93. package/dist/server/permissions.js.map +1 -0
  94. package/dist/server/permissions.test.d.ts +2 -0
  95. package/dist/server/permissions.test.d.ts.map +1 -0
  96. package/dist/server/permissions.test.js +22 -0
  97. package/dist/server/permissions.test.js.map +1 -0
  98. package/dist/server/probe-diagnostics.d.ts +102 -0
  99. package/dist/server/probe-diagnostics.d.ts.map +1 -0
  100. package/dist/server/probe-diagnostics.js +140 -0
  101. package/dist/server/probe-diagnostics.js.map +1 -0
  102. package/dist/server/probe-diagnostics.test.d.ts +2 -0
  103. package/dist/server/probe-diagnostics.test.d.ts.map +1 -0
  104. package/dist/server/probe-diagnostics.test.js +114 -0
  105. package/dist/server/probe-diagnostics.test.js.map +1 -0
  106. package/dist/server/probe-env.d.ts +42 -0
  107. package/dist/server/probe-env.d.ts.map +1 -0
  108. package/dist/server/probe-env.js +149 -0
  109. package/dist/server/probe-env.js.map +1 -0
  110. package/dist/server/probe-env.test.d.ts +2 -0
  111. package/dist/server/probe-env.test.d.ts.map +1 -0
  112. package/dist/server/probe-env.test.js +135 -0
  113. package/dist/server/probe-env.test.js.map +1 -0
  114. package/dist/server/probe-redaction.test.d.ts +2 -0
  115. package/dist/server/probe-redaction.test.d.ts.map +1 -0
  116. package/dist/server/probe-redaction.test.js +86 -0
  117. package/dist/server/probe-redaction.test.js.map +1 -0
  118. package/dist/server/prompt-cache.d.ts +17 -0
  119. package/dist/server/prompt-cache.d.ts.map +1 -0
  120. package/dist/server/prompt-cache.js +126 -0
  121. package/dist/server/prompt-cache.js.map +1 -0
  122. package/dist/server/quota-keychain.test.d.ts +2 -0
  123. package/dist/server/quota-keychain.test.d.ts.map +1 -0
  124. package/dist/server/quota-keychain.test.js +83 -0
  125. package/dist/server/quota-keychain.test.js.map +1 -0
  126. package/dist/server/quota.d.ts +30 -0
  127. package/dist/server/quota.d.ts.map +1 -0
  128. package/dist/server/quota.js +543 -0
  129. package/dist/server/quota.js.map +1 -0
  130. package/dist/server/setup-token-characterization.test.d.ts +2 -0
  131. package/dist/server/setup-token-characterization.test.d.ts.map +1 -0
  132. package/dist/server/setup-token-characterization.test.js +123 -0
  133. package/dist/server/setup-token-characterization.test.js.map +1 -0
  134. package/dist/server/setup-token-parse.d.ts +47 -0
  135. package/dist/server/setup-token-parse.d.ts.map +1 -0
  136. package/dist/server/setup-token-parse.js +506 -0
  137. package/dist/server/setup-token-parse.js.map +1 -0
  138. package/dist/server/setup-token-parse.test.d.ts +2 -0
  139. package/dist/server/setup-token-parse.test.d.ts.map +1 -0
  140. package/dist/server/setup-token-parse.test.js +587 -0
  141. package/dist/server/setup-token-parse.test.js.map +1 -0
  142. package/dist/server/setup-token-runner.d.ts +115 -0
  143. package/dist/server/setup-token-runner.d.ts.map +1 -0
  144. package/dist/server/setup-token-runner.js +317 -0
  145. package/dist/server/setup-token-runner.js.map +1 -0
  146. package/dist/server/setup-token-runner.test.d.ts +2 -0
  147. package/dist/server/setup-token-runner.test.d.ts.map +1 -0
  148. package/dist/server/setup-token-runner.test.js +336 -0
  149. package/dist/server/setup-token-runner.test.js.map +1 -0
  150. package/dist/server/skills.d.ts +8 -0
  151. package/dist/server/skills.d.ts.map +1 -0
  152. package/dist/server/skills.js +42 -0
  153. package/dist/server/skills.js.map +1 -0
  154. package/dist/server/test.d.ts +3 -0
  155. package/dist/server/test.d.ts.map +1 -0
  156. package/dist/server/test.js +434 -0
  157. package/dist/server/test.js.map +1 -0
  158. package/dist/server/test.probe.test.d.ts +2 -0
  159. package/dist/server/test.probe.test.d.ts.map +1 -0
  160. package/dist/server/test.probe.test.js +608 -0
  161. package/dist/server/test.probe.test.js.map +1 -0
  162. package/dist/server/test.remote.test.d.ts +2 -0
  163. package/dist/server/test.remote.test.d.ts.map +1 -0
  164. package/dist/server/test.remote.test.js +149 -0
  165. package/dist/server/test.remote.test.js.map +1 -0
  166. package/dist/ui/build-config.d.ts +3 -0
  167. package/dist/ui/build-config.d.ts.map +1 -0
  168. package/dist/ui/build-config.js +76 -0
  169. package/dist/ui/build-config.js.map +1 -0
  170. package/dist/ui/build-config.test.d.ts +2 -0
  171. package/dist/ui/build-config.test.d.ts.map +1 -0
  172. package/dist/ui/build-config.test.js +68 -0
  173. package/dist/ui/build-config.test.js.map +1 -0
  174. package/dist/ui/index.d.ts +3 -0
  175. package/dist/ui/index.d.ts.map +1 -0
  176. package/dist/ui/index.js +3 -0
  177. package/dist/ui/index.js.map +1 -0
  178. package/dist/ui/parse-stdout.d.ts +3 -0
  179. package/dist/ui/parse-stdout.d.ts.map +1 -0
  180. package/dist/ui/parse-stdout.js +153 -0
  181. package/dist/ui/parse-stdout.js.map +1 -0
  182. package/package.json +63 -0
  183. package/skills/agentmail/SKILL.md +70 -0
  184. package/skills/paperclip/SKILL.md +712 -0
  185. package/skills/paperclip/references/api-reference.md +1675 -0
  186. package/skills/paperclip/references/artifacts.md +158 -0
  187. package/skills/paperclip/references/cases.md +295 -0
  188. package/skills/paperclip/references/company-skills.md +266 -0
  189. package/skills/paperclip/references/issue-workspaces.md +80 -0
  190. package/skills/paperclip/references/routines.md +231 -0
  191. package/skills/paperclip/references/workflows.md +141 -0
  192. package/skills/paperclip/scripts/paperclip-upload-artifact.sh +592 -0
  193. package/skills/paperclip-board/SKILL.md +619 -0
  194. package/skills/paperclip-converting-plans-to-tasks/SKILL.md +60 -0
  195. package/skills/paperclip-create-agent/SKILL.md +179 -0
  196. package/skills/paperclip-create-agent/references/agent-instruction-templates.md +123 -0
  197. package/skills/paperclip-create-agent/references/agents/coder.md +64 -0
  198. package/skills/paperclip-create-agent/references/agents/qa.md +88 -0
  199. package/skills/paperclip-create-agent/references/agents/securityengineer.md +135 -0
  200. package/skills/paperclip-create-agent/references/agents/uxdesigner.md +115 -0
  201. package/skills/paperclip-create-agent/references/api-reference.md +110 -0
  202. package/skills/paperclip-create-agent/references/baseline-role-guide.md +168 -0
  203. package/skills/paperclip-create-agent/references/draft-review-checklist.md +95 -0
  204. package/skills/para-memory-files/SKILL.md +100 -0
  205. package/skills/para-memory-files/references/schemas.md +35 -0
  206. package/skills/slack/SKILL.md +65 -0
@@ -0,0 +1,115 @@
1
+ import { type LoginRunnerDisposable, type LoginRunnerLifecycleOptions, type LoginRunnerOutcome, type LoginRunnerResult } from "@tickernelz/paperclip-pro-adapter-utils";
2
+ import { type SetupTokenPrompt } from "./setup-token-parse.js";
3
+ /** The fixed Claude setup-token command. The login flow needs a PTY. */
4
+ export declare const CLAUDE_SETUP_TOKEN_COMMAND = "claude setup-token";
5
+ /**
6
+ * The submission terminator for the browser code. The interactive login UI reads
7
+ * the code on a PTY and submits it on a carriage return. The runner writes this
8
+ * terminator as its own write, after the code write and a short settle delay.
9
+ * The live characterization showed that a single write of `code + "\r"` does not
10
+ * submit: the input is an Ink text field with paste handling, so a glued
11
+ * carriage return folds into the pasted text instead of a Return key, and the
12
+ * login stalls at the prompt. Two writes with a settle gap submit on the first
13
+ * Return.
14
+ */
15
+ export declare const CODE_SUBMISSION_TERMINATOR = "\r";
16
+ /**
17
+ * The default settle delay in milliseconds between the code write and the
18
+ * terminator write. The delay lets the Ink paste buffer settle, so the terminator
19
+ * arrives as a distinct Return key. A caller can override it; a test sets it to 0.
20
+ */
21
+ export declare const CODE_SUBMIT_SETTLE_MS = 150;
22
+ /**
23
+ * The maximum number of characters the runner keeps for the next chunk. The
24
+ * login prompt is small and puts the URL and the prompt line close together. A
25
+ * sandbox can stream a large volume of output before the prompt. So after each
26
+ * parse the runner keeps only the most recent characters up to this limit. The
27
+ * retained buffer cannot grow without a bound across many chunks. The limit is
28
+ * far larger than the prompt, so the trailing window never drops a real prompt
29
+ * that spans a chunk boundary.
30
+ */
31
+ export declare const CLAUDE_SETUP_TOKEN_MAX_BUFFER_CHARS: number;
32
+ /**
33
+ * The child side of the setup-token run. The runner never spawns the PTY
34
+ * directly; a caller injects a concrete driver. A production driver binds these
35
+ * methods to a PTY child that runs {@link CLAUDE_SETUP_TOKEN_COMMAND}.
36
+ */
37
+ export interface SetupTokenPtyDriver extends LoginRunnerDisposable {
38
+ /**
39
+ * Starts `command` in a PTY and streams the terminal output to `onData` in
40
+ * memory. Resolves with the child exit code when the child ends. A driver must
41
+ * not persist the raw output to any durable log.
42
+ */
43
+ start(command: string, onData: (chunk: string) => void): Promise<{
44
+ exitCode: number | null;
45
+ }>;
46
+ /**
47
+ * Writes `input` to the child PTY. The runner writes the browser code plus the
48
+ * submission terminator one time, only after it matches the prompt.
49
+ */
50
+ write(input: string): void;
51
+ /**
52
+ * Stops the child process with a direct child stop. The characterization showed
53
+ * that the child needs `SIGKILL`. The method must be safe to call before start
54
+ * and safe to call more than one time.
55
+ */
56
+ stop(): void;
57
+ }
58
+ /** Receives the parsed prompt one time in memory. The caller displays it. */
59
+ export type SetupTokenPromptSink = (prompt: SetupTokenPrompt) => void;
60
+ /**
61
+ * Returns the one browser code the user pastes from the sign-in page. The runner
62
+ * calls it one time, only after it surfaces the prompt. The runner passes an
63
+ * abort signal, so the provider can stop when the runner cancels or times out.
64
+ */
65
+ export type SetupTokenCodeProvider = (signal: AbortSignal) => Promise<string>;
66
+ /**
67
+ * Receives the credential bytes one time in memory on success. The runner binds
68
+ * the token from the success record, then it awaits this sink one time with the
69
+ * token bytes. The sink is mandatory and it returns a promise; the runner awaits
70
+ * that promise before it reports success. A sink rejection ends the run as a
71
+ * failure. The runner never logs the bytes and never stores them on the result.
72
+ */
73
+ export type SetupTokenCredentialSink = (authBytes: Buffer) => Promise<void>;
74
+ /** The setup-token runner outcome. It is a fixed, non-secret status. */
75
+ export type SetupTokenOutcome = LoginRunnerOutcome;
76
+ /**
77
+ * The runner result. It never carries a URL, a code, or a token byte. It extends
78
+ * the base result with the two setup-token status fields.
79
+ */
80
+ export interface SetupTokenLoginResult extends LoginRunnerResult {
81
+ codeSubmitted: boolean;
82
+ /** True when the runner bound the token and invoked `onCredential` one time. */
83
+ credentialDelivered: boolean;
84
+ }
85
+ export interface RunSetupTokenLoginOptions extends LoginRunnerLifecycleOptions {
86
+ /** The login command. Defaults to {@link CLAUDE_SETUP_TOKEN_COMMAND}. */
87
+ command?: string;
88
+ /** Receives the parsed prompt one time in memory. The caller displays it. */
89
+ onPrompt: SetupTokenPromptSink;
90
+ /** Returns the one browser code. The runner writes it to the matched prompt. */
91
+ provideCode: SetupTokenCodeProvider;
92
+ /**
93
+ * The credential sink. The runner awaits it one time with the token bytes and
94
+ * reports success only after it resolves. The sink is mandatory for a
95
+ * successful run: a missing sink ends the run as a failure. The option stays
96
+ * optional so a caller can drive a fail-closed path with no sink.
97
+ */
98
+ onCredential?: SetupTokenCredentialSink;
99
+ /**
100
+ * The settle delay in milliseconds between the code write and the terminator
101
+ * write. Defaults to {@link CODE_SUBMIT_SETTLE_MS}. A test sets it to 0.
102
+ */
103
+ codeSubmitSettleMs?: number;
104
+ }
105
+ /**
106
+ * Runs the setup-token login through `driver`. Surfaces the prompt one time
107
+ * through `onPrompt`. Reads the browser code one time through `provideCode` and
108
+ * writes it to the matched prompt. Binds the minted token from the success
109
+ * record and delivers it one time through `onCredential`. Returns a fixed status.
110
+ * Stops the child and disposes the driver for every terminal state. Never logs
111
+ * the raw stream, and never puts a URL, a code, or a token into a log line, the
112
+ * result, or a thrown error.
113
+ */
114
+ export declare function runSetupTokenLogin(driver: SetupTokenPtyDriver, options: RunSetupTokenLoginOptions): Promise<SetupTokenLoginResult>;
115
+ //# sourceMappingURL=setup-token-runner.d.ts.map
@@ -0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CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,aAAa,EAAE,OAAO,CAAC;IACvB,gFAAgF;IAChF,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,yBAA0B,SAAQ,2BAA2B;IAC5E,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,gFAAgF;IAChF,WAAW,EAAE,sBAAsB,CAAC;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC;IACxC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAyCD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,qBAAqB,CAAC,CA+MhC"}
@@ -0,0 +1,317 @@
1
+ import { raceLoginRunnerExit, } from "@tickernelz/paperclip-pro-adapter-utils";
2
+ import { parseSetupTokenCredential, parseSetupTokenPrompt, } from "./setup-token-parse.js";
3
+ // The Claude `setup-token` login runner. It starts `claude setup-token` through
4
+ // an injected {@link SetupTokenPtyDriver}, surfaces the sign-in prompt one time
5
+ // in memory, accepts one browser code, sends the code to the matched prompt, and
6
+ // delivers the minted OAuth token one time. It handles a timeout and a
7
+ // cancellation, and it stops the child for every terminal state.
8
+ //
9
+ // Security (secret handling): the runner treats every byte of the terminal
10
+ // stream as secret-bearing, untrusted input. It parses the stream in an in-memory
11
+ // buffer only. It drops the prompt buffer as soon as it finds the prompt, and it
12
+ // drops the token buffer as soon as it binds the token. It never forwards the raw
13
+ // text to a log or an artifact, and it never stores the raw text on the result.
14
+ // The runner reports only a fixed, non-secret status. It passes the prompt one
15
+ // time through the in-memory `onPrompt` callback. It reads the browser code one
16
+ // time through the in-memory `provideCode` callback and writes the code only to
17
+ // the child, only after it matches the prompt. It delivers the token one time
18
+ // through the in-memory `onCredential` sink. The runner keeps the URL, the code,
19
+ // and any token byte out of every log line and every thrown error.
20
+ //
21
+ // Fail-closed credential delivery. The `onCredential` sink is mandatory and
22
+ // awaited. The runner binds the token from the exact success record with
23
+ // {@link parseSetupTokenCredential}, then it awaits the sink one time. It sets
24
+ // `credentialDelivered` true only after the sink resolves. A missing sink, a
25
+ // success stream with no token, and a sink rejection each end the run as a
26
+ // failure; the runner never reports success without a resolved sink. The runner
27
+ // zeros the token bytes in a `finally` block on every path, so the secret never
28
+ // outlives the delivery.
29
+ /** The fixed Claude setup-token command. The login flow needs a PTY. */
30
+ export const CLAUDE_SETUP_TOKEN_COMMAND = "claude setup-token";
31
+ /**
32
+ * The submission terminator for the browser code. The interactive login UI reads
33
+ * the code on a PTY and submits it on a carriage return. The runner writes this
34
+ * terminator as its own write, after the code write and a short settle delay.
35
+ * The live characterization showed that a single write of `code + "\r"` does not
36
+ * submit: the input is an Ink text field with paste handling, so a glued
37
+ * carriage return folds into the pasted text instead of a Return key, and the
38
+ * login stalls at the prompt. Two writes with a settle gap submit on the first
39
+ * Return.
40
+ */
41
+ export const CODE_SUBMISSION_TERMINATOR = "\r";
42
+ /**
43
+ * The default settle delay in milliseconds between the code write and the
44
+ * terminator write. The delay lets the Ink paste buffer settle, so the terminator
45
+ * arrives as a distinct Return key. A caller can override it; a test sets it to 0.
46
+ */
47
+ export const CODE_SUBMIT_SETTLE_MS = 150;
48
+ /**
49
+ * The maximum number of characters the runner keeps for the next chunk. The
50
+ * login prompt is small and puts the URL and the prompt line close together. A
51
+ * sandbox can stream a large volume of output before the prompt. So after each
52
+ * parse the runner keeps only the most recent characters up to this limit. The
53
+ * retained buffer cannot grow without a bound across many chunks. The limit is
54
+ * far larger than the prompt, so the trailing window never drops a real prompt
55
+ * that spans a chunk boundary.
56
+ */
57
+ export const CLAUDE_SETUP_TOKEN_MAX_BUFFER_CHARS = 64 * 1024;
58
+ /**
59
+ * Waits `ms` milliseconds, or resolves at once when the signal aborts. The
60
+ * routine lets the Ink paste buffer settle between the code write and the
61
+ * terminator write. It never rejects; a caller checks the signal after it
62
+ * resolves. A zero or negative delay resolves on the next microtask.
63
+ */
64
+ function settleDelay(ms, signal) {
65
+ if (ms <= 0 || signal.aborted)
66
+ return Promise.resolve();
67
+ return new Promise((resolve) => {
68
+ const done = () => {
69
+ clearTimeout(timer);
70
+ signal.removeEventListener("abort", done);
71
+ resolve();
72
+ };
73
+ const timer = setTimeout(done, ms);
74
+ signal.addEventListener("abort", done, { once: true });
75
+ });
76
+ }
77
+ /**
78
+ * Stops the child and releases the driver for a terminal state. The runner calls
79
+ * this on every exit path: a normal exit, a non-zero exit, a timeout, a
80
+ * cancellation, and an error. It first runs a direct child stop, then it disposes
81
+ * the driver. A stop error or a dispose error must not leak or mask the result,
82
+ * so the function swallows each error and logs a fixed line.
83
+ */
84
+ async function stopAndDispose(driver, log) {
85
+ try {
86
+ driver.stop();
87
+ }
88
+ catch {
89
+ log("[paperclip] Setup-token login: the process stop step errored.");
90
+ }
91
+ try {
92
+ await driver.dispose();
93
+ }
94
+ catch {
95
+ log("[paperclip] Setup-token login: the driver dispose step errored.");
96
+ }
97
+ }
98
+ /**
99
+ * Runs the setup-token login through `driver`. Surfaces the prompt one time
100
+ * through `onPrompt`. Reads the browser code one time through `provideCode` and
101
+ * writes it to the matched prompt. Binds the minted token from the success
102
+ * record and delivers it one time through `onCredential`. Returns a fixed status.
103
+ * Stops the child and disposes the driver for every terminal state. Never logs
104
+ * the raw stream, and never puts a URL, a code, or a token into a log line, the
105
+ * result, or a thrown error.
106
+ */
107
+ export async function runSetupTokenLogin(driver, options) {
108
+ const { onPrompt, provideCode, onCredential, timeoutMs, signal } = options;
109
+ const command = options.command ?? CLAUDE_SETUP_TOKEN_COMMAND;
110
+ const codeSubmitSettleMs = options.codeSubmitSettleMs ?? CODE_SUBMIT_SETTLE_MS;
111
+ const log = options.log ?? (() => { });
112
+ // A private controller that fans a timeout or a cancellation into the
113
+ // code-input routine, so a pending `provideCode` stops when the run ends.
114
+ const controller = new AbortController();
115
+ const onExternalAbort = () => controller.abort();
116
+ if (signal) {
117
+ if (signal.aborted)
118
+ controller.abort();
119
+ else
120
+ signal.addEventListener("abort", onExternalAbort, { once: true });
121
+ }
122
+ let promptSurfaced = false;
123
+ let codeSubmitted = false;
124
+ let submitStarted = false;
125
+ // The runner sets this true one time, only after the mandatory sink resolves.
126
+ let credentialDelivered = false;
127
+ // The bound token bytes. The runner binds them from the success record during
128
+ // the stream, holds them in memory only, awaits the sink one time after a
129
+ // clean exit, and zeros them in a `finally` block on every path. A null value
130
+ // means the runner never bound a token.
131
+ let tokenBytes = null;
132
+ // The code-input routine runs beside the race. It is self-guarding and never
133
+ // rejects, so an unresolved provider cannot become an unhandled rejection.
134
+ let submitPromise = Promise.resolve();
135
+ // The in-memory prompt buffer. The runner drops it as soon as it finds the
136
+ // prompt, so the secret-bearing stream never lives longer than one parse. The
137
+ // runner parses the full buffer, and it includes the whole new chunk. So a
138
+ // prompt at the start of one large chunk still parses. The runner bounds only
139
+ // the buffer that it keeps for the next chunk to
140
+ // {@link CLAUDE_SETUP_TOKEN_MAX_BUFFER_CHARS}. The runner keeps the trailing
141
+ // window and drops the oldest characters.
142
+ let buffer = "";
143
+ // The in-memory token buffer. The runner accumulates the post-prompt stream
144
+ // here, parses the full buffer before any truncation, and drops it as soon as
145
+ // it binds the token. It bounds the retained window the same way as the prompt
146
+ // buffer, so the secret-bearing stream never grows without a bound.
147
+ let tokenBuffer = "";
148
+ // Reads the browser code and writes it to the matched prompt one time. The
149
+ // routine never throws: it logs a fixed line on a provider error or a write
150
+ // error, so the code never reaches a log or a thrown error.
151
+ const submitCode = async () => {
152
+ let code;
153
+ try {
154
+ code = await provideCode(controller.signal);
155
+ }
156
+ catch {
157
+ log("[paperclip] Setup-token login: the code input step errored.");
158
+ return;
159
+ }
160
+ if (controller.signal.aborted)
161
+ return;
162
+ try {
163
+ // Write the code, let the Ink paste buffer settle, then write the Return as
164
+ // its own write. A glued `code + "\r"` burst folds the Return into the
165
+ // pasted text and never submits (live characterization). Two writes with a
166
+ // settle gap submit on the first Return.
167
+ driver.write(code);
168
+ await settleDelay(codeSubmitSettleMs, controller.signal);
169
+ if (controller.signal.aborted)
170
+ return;
171
+ driver.write(CODE_SUBMISSION_TERMINATOR);
172
+ codeSubmitted = true;
173
+ log("[paperclip] Setup-token login: sent the browser code to the prompt.");
174
+ }
175
+ catch {
176
+ log("[paperclip] Setup-token login: the code input step errored.");
177
+ }
178
+ };
179
+ // Binds the token from the token buffer one time and holds the bytes in
180
+ // memory. The runner scans only when a caller provides an `onCredential` sink,
181
+ // so it never holds the secret-bearing stream without a need. It drops the
182
+ // token buffer as soon as the parser binds the token. The runner delivers the
183
+ // bytes later, after a clean exit, through {@link deliverCredential}.
184
+ const captureCredential = () => {
185
+ if (!onCredential || tokenBytes)
186
+ return;
187
+ const token = parseSetupTokenCredential(tokenBuffer);
188
+ if (!token)
189
+ return;
190
+ tokenBytes = Buffer.from(token, "utf8");
191
+ tokenBuffer = "";
192
+ };
193
+ // Awaits the mandatory sink one time with the bound token bytes and reports
194
+ // whether the credential landed. It returns false when the sink is missing,
195
+ // when the runner bound no token, or when the sink rejects. It does not swallow
196
+ // a sink rejection: it maps the rejection to a false result, so the caller ends
197
+ // the run as a failure. It zeros the token bytes in a `finally` block on every
198
+ // path, so the secret never outlives the delivery.
199
+ const deliverCredential = async () => {
200
+ const bytes = tokenBytes;
201
+ tokenBytes = null;
202
+ if (!bytes)
203
+ return false;
204
+ try {
205
+ if (!onCredential)
206
+ return false;
207
+ await onCredential(bytes);
208
+ log("[paperclip] Setup-token login: delivered the credential to the sink.");
209
+ return true;
210
+ }
211
+ catch {
212
+ log("[paperclip] Setup-token login: the credential delivery step errored.");
213
+ return false;
214
+ }
215
+ finally {
216
+ bytes.fill(0);
217
+ }
218
+ };
219
+ const onData = (chunk) => {
220
+ if (!promptSurfaced) {
221
+ // Parse the full buffer before any truncation. This order finds an early
222
+ // prompt inside one large chunk, so the runner never drops it.
223
+ buffer += chunk;
224
+ const prompt = parseSetupTokenPrompt(buffer);
225
+ if (prompt) {
226
+ promptSurfaced = true;
227
+ buffer = "";
228
+ onPrompt(prompt);
229
+ log("[paperclip] Setup-token login: surfaced the sign-in prompt.");
230
+ if (!submitStarted) {
231
+ submitStarted = true;
232
+ submitPromise = submitCode();
233
+ }
234
+ return;
235
+ }
236
+ if (buffer.length > CLAUDE_SETUP_TOKEN_MAX_BUFFER_CHARS) {
237
+ buffer = buffer.slice(buffer.length - CLAUDE_SETUP_TOKEN_MAX_BUFFER_CHARS);
238
+ }
239
+ return;
240
+ }
241
+ // The prompt already surfaced. Scan the post-prompt stream for the success
242
+ // token. The runner scans only when a caller provides an `onCredential`
243
+ // sink, so it never holds the secret-bearing stream without a need.
244
+ if (!onCredential || tokenBytes)
245
+ return;
246
+ tokenBuffer += chunk;
247
+ captureCredential();
248
+ if (!tokenBytes && tokenBuffer.length > CLAUDE_SETUP_TOKEN_MAX_BUFFER_CHARS) {
249
+ tokenBuffer = tokenBuffer.slice(tokenBuffer.length - CLAUDE_SETUP_TOKEN_MAX_BUFFER_CHARS);
250
+ }
251
+ };
252
+ const result = (outcome, exitCode) => ({
253
+ outcome,
254
+ exitCode,
255
+ promptSurfaced,
256
+ codeSubmitted,
257
+ credentialDelivered,
258
+ });
259
+ try {
260
+ if (signal?.aborted) {
261
+ log("[paperclip] Setup-token login cancelled before start.");
262
+ return result("cancelled", null);
263
+ }
264
+ const start = driver.start(command, onData);
265
+ const raced = await raceLoginRunnerExit(start, timeoutMs, controller.signal);
266
+ // Release a pending code-input routine, then let it settle. The routine is
267
+ // self-guarding, so this await never rejects.
268
+ controller.abort();
269
+ await submitPromise;
270
+ if (raced.kind === "timeout") {
271
+ log("[paperclip] Setup-token login timed out; stopping the process.");
272
+ return result("timeout", null);
273
+ }
274
+ if (raced.kind === "cancelled") {
275
+ log("[paperclip] Setup-token login cancelled; stopping the process.");
276
+ return result("cancelled", null);
277
+ }
278
+ const exitCode = raced.exitCode;
279
+ if (exitCode !== 0) {
280
+ log("[paperclip] Setup-token login command ended with a non-zero exit code.");
281
+ return result("failure", exitCode);
282
+ }
283
+ // The command exited cleanly. Deliver the bound token through the mandatory
284
+ // sink and await it. The runner fails closed: a missing sink, a clean exit
285
+ // with no bound token, and a sink rejection each end the run as a failure. It
286
+ // reports success only after the sink resolves.
287
+ const delivered = await deliverCredential();
288
+ if (!delivered) {
289
+ log("[paperclip] Setup-token login: the credential did not land; treating the run as a failure.");
290
+ return result("failure", exitCode);
291
+ }
292
+ credentialDelivered = true;
293
+ log("[paperclip] Setup-token login command ended successfully.");
294
+ return result("success", exitCode);
295
+ }
296
+ catch {
297
+ // Convert any driver error to a fixed, non-secret error. The original error
298
+ // may embed streamed bytes, so the runner never propagates its message.
299
+ throw new Error("setup-token login failed: the sandbox login command errored.");
300
+ }
301
+ finally {
302
+ if (signal)
303
+ signal.removeEventListener("abort", onExternalAbort);
304
+ // Zero any bound token bytes that the delivery path did not consume, so a
305
+ // timeout, a cancellation, or an error never leaves the secret in memory. The
306
+ // cast restores the type that the closure assignment widens away.
307
+ const leftover = tokenBytes;
308
+ if (leftover) {
309
+ leftover.fill(0);
310
+ tokenBytes = null;
311
+ }
312
+ // Stop a pending code-input routine, then stop the child and dispose.
313
+ controller.abort();
314
+ await stopAndDispose(driver, log);
315
+ }
316
+ }
317
+ //# sourceMappingURL=setup-token-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-token-runner.js","sourceRoot":"","sources":["../../src/server/setup-token-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAKpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,yBAAyB,EACzB,qBAAqB,GAEtB,MAAM,wBAAwB,CAAC;AAEhC,gFAAgF;AAChF,gFAAgF;AAChF,iFAAiF;AACjF,uEAAuE;AACvE,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E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0EAA0E;QAC1E,8EAA8E;QAC9E,kEAAkE;QAClE,MAAM,QAAQ,GAAG,UAA2B,CAAC;QAC7C,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjB,UAAU,GAAG,IAAI,CAAC;QACpB,CAAC;QACD,sEAAsE;QACtE,UAAU,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setup-token-runner.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-token-runner.test.d.ts","sourceRoot":"","sources":["../../src/server/setup-token-runner.test.ts"],"names":[],"mappings":""}