@paperclipai/server 2026.830.0-canary.5 → 2026.830.0-canary.7

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 (34) hide show
  1. package/dist/build-info.json +1 -1
  2. package/dist/vendor/paperclip-runner/drivers/codex/codex-boundaries.d.ts +9 -0
  3. package/dist/vendor/paperclip-runner/drivers/codex/codex-boundaries.d.ts.map +1 -0
  4. package/dist/vendor/paperclip-runner/drivers/codex/codex-boundaries.js +172 -0
  5. package/dist/vendor/paperclip-runner/drivers/codex/codex-boundaries.js.map +1 -0
  6. package/dist/vendor/paperclip-runner/drivers/codex/codex-question-adapter.d.ts +25 -0
  7. package/dist/vendor/paperclip-runner/drivers/codex/codex-question-adapter.d.ts.map +1 -0
  8. package/dist/vendor/paperclip-runner/drivers/codex/codex-question-adapter.js +486 -0
  9. package/dist/vendor/paperclip-runner/drivers/codex/codex-question-adapter.js.map +1 -0
  10. package/dist/vendor/paperclip-runner/drivers/codex/codex-security-config.d.ts +4 -0
  11. package/dist/vendor/paperclip-runner/drivers/codex/codex-security-config.d.ts.map +1 -0
  12. package/dist/vendor/paperclip-runner/drivers/codex/codex-security-config.js +105 -0
  13. package/dist/vendor/paperclip-runner/drivers/codex/codex-security-config.js.map +1 -0
  14. package/dist/vendor/paperclip-runner/drivers/codex/codex-thread-normalization.d.ts +20 -0
  15. package/dist/vendor/paperclip-runner/drivers/codex/codex-thread-normalization.d.ts.map +1 -0
  16. package/dist/vendor/paperclip-runner/drivers/codex/codex-thread-normalization.js +179 -0
  17. package/dist/vendor/paperclip-runner/drivers/codex/codex-thread-normalization.js.map +1 -0
  18. package/dist/vendor/paperclip-runner/drivers/codex/codex-turn-diff.d.ts +12 -0
  19. package/dist/vendor/paperclip-runner/drivers/codex/codex-turn-diff.d.ts.map +1 -0
  20. package/dist/vendor/paperclip-runner/drivers/codex/codex-turn-diff.js +196 -0
  21. package/dist/vendor/paperclip-runner/drivers/codex/codex-turn-diff.js.map +1 -0
  22. package/dist/vendor/paperclip-runner/live/workspace-file-reference.d.ts +17 -0
  23. package/dist/vendor/paperclip-runner/live/workspace-file-reference.d.ts.map +1 -0
  24. package/dist/vendor/paperclip-runner/live/workspace-file-reference.js +139 -0
  25. package/dist/vendor/paperclip-runner/live/workspace-file-reference.js.map +1 -0
  26. package/dist/vendor/paperclip-runner/mock-core/codex-runner.d.ts +29 -0
  27. package/dist/vendor/paperclip-runner/mock-core/codex-runner.d.ts.map +1 -0
  28. package/dist/vendor/paperclip-runner/mock-core/codex-runner.js +474 -0
  29. package/dist/vendor/paperclip-runner/mock-core/codex-runner.js.map +1 -0
  30. package/dist/vendor/paperclip-runner/protocol/live-console-fixture.d.ts +66 -0
  31. package/dist/vendor/paperclip-runner/protocol/live-console-fixture.d.ts.map +1 -0
  32. package/dist/vendor/paperclip-runner/protocol/live-console-fixture.js +186 -0
  33. package/dist/vendor/paperclip-runner/protocol/live-console-fixture.js.map +1 -0
  34. package/package.json +18 -18
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "83243d4b5"
2
+ "commit": "a9297c3c0"
3
3
  }
@@ -0,0 +1,9 @@
1
+ import type { PrpStructuredRunResult } from "../../protocol/replay-contract.js";
2
+ export declare function validateCodexWorkingDirectory(workingDirectory: string, environment?: NodeJS.ProcessEnv): string;
3
+ export declare function boundedCodexPayload(value: Record<string, unknown>): Record<string, unknown>;
4
+ export declare function isRetainableCodexPayload(value: unknown): boolean;
5
+ export declare function isCodexSemanticTool(tool: string): boolean;
6
+ export declare function codexToolAcceptsDisposition(tool: string, disposition: PrpStructuredRunResult["reportedWorkDisposition"]): boolean;
7
+ export declare function redactCodexValue(value: unknown, depth?: number): unknown;
8
+ export declare function rejectedCodexToolCall(message: string): Record<string, unknown>;
9
+ //# sourceMappingURL=codex-boundaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-boundaries.d.ts","sourceRoot":"","sources":["../../../src/drivers/codex/codex-boundaries.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAYhF,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,MAAM,EACxB,WAAW,GAAE,MAAM,CAAC,UAAwB,GAC3C,MAAM,CAsDR;AAkED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAShE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,sBAAsB,CAAC,yBAAyB,CAAC,GAC7D,OAAO,CAQT;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,OAAO,CAmBnE;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB"}
@@ -0,0 +1,172 @@
1
+ import { realpathSync, statSync } from "node:fs";
2
+ import { basename, dirname, isAbsolute, parse, relative, resolve, sep, } from "node:path";
3
+ import { CODEX_BLOCK_TOOL_NAME, CODEX_COMPLETION_TOOL_NAME, } from "../../contracts/codex.js";
4
+ import { redactCodexDiagnostic } from "./app-server-transport.js";
5
+ const MAX_RETAINED_CODEX_PAYLOAD_BYTES = 64 * 1024;
6
+ const MAX_RETAINED_CODEX_STRING_CHARS = 32 * 1024;
7
+ function record(value) {
8
+ return typeof value === "object" && value !== null && !Array.isArray(value)
9
+ ? value
10
+ : {};
11
+ }
12
+ export function validateCodexWorkingDirectory(workingDirectory, environment = process.env) {
13
+ if (workingDirectory.trim().length === 0) {
14
+ throw new Error("Codex working directory is required");
15
+ }
16
+ const requested = resolve(workingDirectory);
17
+ let resolved;
18
+ try {
19
+ resolved = realpathSync.native(requested);
20
+ if (!statSync(resolved).isDirectory()) {
21
+ throw new Error("Codex working directory must be a directory");
22
+ }
23
+ }
24
+ catch (error) {
25
+ const code = error.code;
26
+ if (code === "ENOENT") {
27
+ throw new Error("Codex working directory must exist before provider admission");
28
+ }
29
+ throw error;
30
+ }
31
+ if (resolved === parse(resolved).root) {
32
+ throw new Error("Codex working directory cannot be a filesystem root");
33
+ }
34
+ const hostHome = canonicalConfiguredPath(environment.HOME);
35
+ if (hostHome && pathContains(resolved, hostHome)) {
36
+ throw new Error("Codex working directory cannot contain the host HOME");
37
+ }
38
+ if (hostHome && pathContains(hostHome, resolved)) {
39
+ throw new Error("Codex working directory cannot overlap the host HOME");
40
+ }
41
+ const codexHome = canonicalConfiguredPath(environment.CODEX_HOME);
42
+ if (codexHome) {
43
+ if (pathContains(resolved, codexHome) ||
44
+ pathContains(codexHome, resolved)) {
45
+ throw new Error("Codex working directory cannot overlap host CODEX_HOME");
46
+ }
47
+ }
48
+ const configuredRoot = environment.PAPERCLIP_WORKSPACE_CWD;
49
+ if (configuredRoot !== undefined && configuredRoot.trim().length > 0) {
50
+ const root = canonicalConfiguredPath(configuredRoot);
51
+ const pathFromRoot = relative(root, resolved);
52
+ if (pathFromRoot === ".." ||
53
+ pathFromRoot.startsWith(`..${sep}`) ||
54
+ isAbsolute(pathFromRoot)) {
55
+ throw new Error("Codex working directory is outside the assigned workspace");
56
+ }
57
+ }
58
+ return resolved;
59
+ }
60
+ function canonicalConfiguredPath(value) {
61
+ const configured = value?.trim();
62
+ if (!configured)
63
+ return null;
64
+ return canonicalPathWithMissingTail(resolve(configured));
65
+ }
66
+ function canonicalPathWithMissingTail(path) {
67
+ let cursor = path;
68
+ const missing = [];
69
+ while (true) {
70
+ try {
71
+ return resolve(realpathSync.native(cursor), ...missing);
72
+ }
73
+ catch (error) {
74
+ if (error.code !== "ENOENT")
75
+ throw error;
76
+ const parent = dirname(cursor);
77
+ if (parent === cursor)
78
+ return resolve(path);
79
+ missing.unshift(basename(cursor));
80
+ cursor = parent;
81
+ }
82
+ }
83
+ }
84
+ function pathContains(parent, candidate) {
85
+ const fromParent = relative(parent, candidate);
86
+ return (fromParent === "" ||
87
+ (fromParent !== ".." &&
88
+ !fromParent.startsWith(`..${sep}`) &&
89
+ !isAbsolute(fromParent)));
90
+ }
91
+ function boundedCodexValue(value, depth = 0) {
92
+ if (depth > 8)
93
+ return { truncated: true, reason: "maximum depth" };
94
+ if (typeof value === "string") {
95
+ return value.length <= MAX_RETAINED_CODEX_STRING_CHARS
96
+ ? value
97
+ : `${value.slice(0, MAX_RETAINED_CODEX_STRING_CHARS)}...[truncated]`;
98
+ }
99
+ if (Array.isArray(value)) {
100
+ const bounded = value
101
+ .slice(0, 128)
102
+ .map((entry) => boundedCodexValue(entry, depth + 1));
103
+ if (value.length > 128) {
104
+ bounded.push({ truncated: true, omittedItems: value.length - 128 });
105
+ }
106
+ return bounded;
107
+ }
108
+ if (typeof value !== "object" || value === null)
109
+ return value;
110
+ const object = record(value);
111
+ const bounded = Object.fromEntries(Object.entries(object)
112
+ .slice(0, 128)
113
+ .map(([key, entry]) => [key, boundedCodexValue(entry, depth + 1)]));
114
+ if (Object.keys(object).length > 128) {
115
+ bounded.truncatedEntries = Object.keys(object).length - 128;
116
+ }
117
+ const serialized = JSON.stringify(bounded);
118
+ return Buffer.byteLength(serialized) <= MAX_RETAINED_CODEX_PAYLOAD_BYTES
119
+ ? bounded
120
+ : { truncated: true, byteSize: Buffer.byteLength(serialized) };
121
+ }
122
+ export function boundedCodexPayload(value) {
123
+ return record(boundedCodexValue(value));
124
+ }
125
+ export function isRetainableCodexPayload(value) {
126
+ try {
127
+ return (Buffer.byteLength(JSON.stringify(value)) <=
128
+ MAX_RETAINED_CODEX_PAYLOAD_BYTES);
129
+ }
130
+ catch {
131
+ return false;
132
+ }
133
+ }
134
+ export function isCodexSemanticTool(tool) {
135
+ return tool === CODEX_COMPLETION_TOOL_NAME || tool === CODEX_BLOCK_TOOL_NAME;
136
+ }
137
+ export function codexToolAcceptsDisposition(tool, disposition) {
138
+ if (tool === CODEX_BLOCK_TOOL_NAME) {
139
+ return disposition === "blocked";
140
+ }
141
+ if (tool === CODEX_COMPLETION_TOOL_NAME) {
142
+ return disposition === "done" || disposition === "needs_review";
143
+ }
144
+ return false;
145
+ }
146
+ export function redactCodexValue(value, depth = 0) {
147
+ if (depth > 8)
148
+ return "[TRUNCATED]";
149
+ if (typeof value === "string")
150
+ return redactCodexDiagnostic(value);
151
+ if (Array.isArray(value)) {
152
+ return value
153
+ .slice(0, 128)
154
+ .map((entry) => redactCodexValue(entry, depth + 1));
155
+ }
156
+ const object = record(value);
157
+ return Object.fromEntries(Object.entries(object)
158
+ .slice(0, 128)
159
+ .map(([key, entry]) => [
160
+ key,
161
+ /(?:api[_-]?key|token|secret|password|authorization)/i.test(key)
162
+ ? "[REDACTED]"
163
+ : redactCodexValue(entry, depth + 1),
164
+ ]));
165
+ }
166
+ export function rejectedCodexToolCall(message) {
167
+ return {
168
+ success: false,
169
+ contentItems: [{ type: "inputText", text: message }],
170
+ };
171
+ }
172
+ //# sourceMappingURL=codex-boundaries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-boundaries.js","sourceRoot":"","sources":["../../../src/drivers/codex/codex-boundaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,GAAG,GACJ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,gCAAgC,GAAG,EAAE,GAAG,IAAI,CAAC;AACnD,MAAM,+BAA+B,GAAG,EAAE,GA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AAE,GAAG,CAAC;aACb,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACnB,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;SACb,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACrB,GAAG;QACH,sDAAsD,CAAC,IAAI,CAAC,GAAG,CAAC;YAC9D,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC;KACvC,CAAC,CACL,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,OAAe;IAEf,OAAO;QACL,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;KACrD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { HarnessRuntimeRequest, HarnessRuntimeRequestKind, HarnessRuntimeRequestResolution, PaperclipQuestionSet } from "../../contracts/harness-driver.js";
2
+ export interface CodexQuestionResponseContext {
3
+ readonly kind: "codex_question_response_context";
4
+ }
5
+ /** Create one private response context for one provider runtime request. */
6
+ export declare function createCodexQuestionResponseContext(): CodexQuestionResponseContext;
7
+ export declare function runtimeRequestKind(method: string): HarnessRuntimeRequestKind | null;
8
+ /**
9
+ * During the v1 migration, input requests that predate structured form data
10
+ * remain opaque runtime requests. Once a provider supplies a native form,
11
+ * however, a malformed/unsupported form must fail closed instead of silently
12
+ * degrading back to the legacy textarea presentation.
13
+ */
14
+ export declare function hasCodexQuestionForm(method: string, params: Record<string, unknown>): boolean;
15
+ export declare function runtimeRequestPrompt(kind: HarnessRuntimeRequestKind, params: Record<string, unknown>): string;
16
+ /** Codex-native requests are converted once, before they enter PRP. */
17
+ export declare function normalizeCodexQuestionSet(method: string, params: Record<string, unknown>, responseContext: CodexQuestionResponseContext): PaperclipQuestionSet | null;
18
+ export declare function runtimeRequestProtocolPayload(request: HarnessRuntimeRequest): Record<string, unknown>;
19
+ /**
20
+ * Maps an already-validated resolution onto the provider's response shape.
21
+ * `parseHarnessRuntimeRequestResolution` is the only gate on shape, so every
22
+ * branch here answers a resolution the request kind actually accepts.
23
+ */
24
+ export declare function runtimeRequestResponse(request: HarnessRuntimeRequest, resolution: HarnessRuntimeRequestResolution, responseContext: CodexQuestionResponseContext): Record<string, unknown>;
25
+ //# sourceMappingURL=codex-question-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-question-adapter.d.ts","sourceRoot":"","sources":["../../../src/drivers/codex/codex-question-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,+BAA+B,EAG/B,oBAAoB,EACrB,MAAM,mCAAmC,CAAC;AAQ3C,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,iCAAiC,CAAC;CAClD;AAOD,4EAA4E;AAC5E,wBAAgB,kCAAkC,IAAI,4BAA4B,CAMjF;AA4BD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI,CAuBnF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAQ7F;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,yBAAyB,EAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAWR;AAoJD,uEAAuE;AACvE,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,eAAe,EAAE,4BAA4B,GAC5C,oBAAoB,GAAG,IAAI,CAiL7B;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBrG;AAgFD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,qBAAqB,EAC9B,UAAU,EAAE,+BAA+B,EAC3C,eAAe,EAAE,4BAA4B,GAC5C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuEzB"}