@layernorm/overlay-agent-bridge-protocol 0.10.0 → 0.11.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 (42) hide show
  1. package/README.md +1 -1
  2. package/dist/command-output-text.d.ts +20 -0
  3. package/dist/command-output-text.d.ts.map +1 -0
  4. package/dist/command-output-text.js +43 -0
  5. package/dist/command-output-text.js.map +1 -0
  6. package/dist/command-output.d.ts +18 -0
  7. package/dist/command-output.d.ts.map +1 -0
  8. package/dist/command-output.js +19 -0
  9. package/dist/command-output.js.map +1 -0
  10. package/dist/computer-tools.d.ts +534 -4
  11. package/dist/computer-tools.d.ts.map +1 -1
  12. package/dist/computer-tools.js +199 -3
  13. package/dist/computer-tools.js.map +1 -1
  14. package/dist/index.d.ts +20 -14
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +6 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/local-tools.d.ts +39 -20
  19. package/dist/local-tools.d.ts.map +1 -1
  20. package/dist/local-tools.js +8 -1
  21. package/dist/local-tools.js.map +1 -1
  22. package/dist/project-instructions.d.ts +17 -0
  23. package/dist/project-instructions.d.ts.map +1 -0
  24. package/dist/project-instructions.js +110 -0
  25. package/dist/project-instructions.js.map +1 -0
  26. package/dist/run-plan.d.ts +11 -0
  27. package/dist/run-plan.d.ts.map +1 -0
  28. package/dist/run-plan.js +23 -0
  29. package/dist/run-plan.js.map +1 -0
  30. package/dist/run-question-tool.d.ts +18 -0
  31. package/dist/run-question-tool.d.ts.map +1 -0
  32. package/dist/run-question-tool.js +17 -0
  33. package/dist/run-question-tool.js.map +1 -0
  34. package/dist/run-questions.d.ts +33 -0
  35. package/dist/run-questions.d.ts.map +1 -0
  36. package/dist/run-questions.js +79 -0
  37. package/dist/run-questions.js.map +1 -0
  38. package/dist/run-wait.d.ts +56 -0
  39. package/dist/run-wait.d.ts.map +1 -0
  40. package/dist/run-wait.js +66 -0
  41. package/dist/run-wait.js.map +1 -0
  42. package/package.json +16 -1
package/README.md CHANGED
@@ -9,7 +9,7 @@ inputs, approval rules and browser result text (`computer-tools.ts`) and context
9
9
  Install the matching protocol and host versions together:
10
10
 
11
11
  ```sh
12
- npm install @layernorm/overlay-agent-bridge-protocol@0.10.0 @layernorm/overlay-agent-host@0.10.0
12
+ npm install @layernorm/overlay-agent-bridge-protocol@0.11.0 @layernorm/overlay-agent-host@0.11.0
13
13
  ```
14
14
 
15
15
  See the repository's `internal/develop/local-computer.md` for the trust and compatibility policy.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shortens command output. This file has no imports because the web app's browser code can load it through saved
3
+ * replies: use `@layernorm/overlay-agent-bridge-protocol/command-output-text` there, not the package index.
4
+ */
5
+ export declare const COMMAND_OUTPUT_DEFAULT_CHARS = 40000;
6
+ export declare const OUTPUT_GAP = "\n[... the middle of this output was left out ...]\n";
7
+ /** The first `maxChars` of `text`, or one fewer rather than half an emoji. */
8
+ export declare function startOfText(text: string, maxChars: number): string;
9
+ /** The start and end of `text` in at most `maxChars`, including the marked gap. The end gets two thirds. */
10
+ export declare function keepStartAndEnd(text: string, maxChars: number, gap?: string): string;
11
+ /** Fits both streams in one limit. A short stream leaves its unused share to the other. */
12
+ export declare function limitCommandOutput(output: {
13
+ stdout: string;
14
+ stderr: string;
15
+ }, maxChars?: number): {
16
+ stdout: string;
17
+ stderr: string;
18
+ truncated: boolean;
19
+ };
20
+ //# sourceMappingURL=command-output-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-output-text.d.ts","sourceRoot":"","sources":["../src/command-output-text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAA;AAClD,eAAO,MAAM,UAAU,yDAAyD,CAAA;AAahF,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,MAAM,CAMxF;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAChC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC1C,QAAQ,SAA+B,GACtC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAUxD"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Shortens command output. This file has no imports because the web app's browser code can load it through saved
3
+ * replies: use `@layernorm/overlay-agent-bridge-protocol/command-output-text` there, not the package index.
4
+ */
5
+ export const COMMAND_OUTPUT_DEFAULT_CHARS = 40_000;
6
+ export const OUTPUT_GAP = '\n[... the middle of this output was left out ...]\n';
7
+ /** Moves a cut so it never splits a surrogate pair. */
8
+ function cutBefore(text, index) {
9
+ const code = text.charCodeAt(index);
10
+ return index > 0 && code >= 0xdc00 && code <= 0xdfff ? index - 1 : index;
11
+ }
12
+ function cutAfter(text, index) {
13
+ const code = text.charCodeAt(index);
14
+ return index < text.length && code >= 0xdc00 && code <= 0xdfff ? index + 1 : index;
15
+ }
16
+ /** The first `maxChars` of `text`, or one fewer rather than half an emoji. */
17
+ export function startOfText(text, maxChars) {
18
+ return text.length <= maxChars ? text : text.slice(0, cutBefore(text, maxChars));
19
+ }
20
+ /** The start and end of `text` in at most `maxChars`, including the marked gap. The end gets two thirds. */
21
+ export function keepStartAndEnd(text, maxChars, gap = OUTPUT_GAP) {
22
+ if (text.length <= maxChars)
23
+ return text;
24
+ const room = maxChars - gap.length;
25
+ if (room < 2)
26
+ return text.slice(cutAfter(text, text.length - Math.max(0, maxChars)));
27
+ const head = Math.floor(room / 3);
28
+ return text.slice(0, cutBefore(text, head)) + gap + text.slice(cutAfter(text, text.length - (room - head)));
29
+ }
30
+ /** Fits both streams in one limit. A short stream leaves its unused share to the other. */
31
+ export function limitCommandOutput(output, maxChars = COMMAND_OUTPUT_DEFAULT_CHARS) {
32
+ const { stdout, stderr } = output;
33
+ if (stdout.length + stderr.length <= maxChars)
34
+ return { stdout, stderr, truncated: false };
35
+ const half = Math.floor(maxChars / 2);
36
+ const forStderr = Math.min(stderr.length, Math.max(half, maxChars - stdout.length));
37
+ return {
38
+ stdout: keepStartAndEnd(stdout, maxChars - forStderr),
39
+ stderr: keepStartAndEnd(stderr, forStderr),
40
+ truncated: true,
41
+ };
42
+ }
43
+ //# sourceMappingURL=command-output-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-output-text.js","sourceRoot":"","sources":["../src/command-output-text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAA;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,sDAAsD,CAAA;AAEhF,uDAAuD;AACvD,SAAS,SAAS,CAAC,IAAY,EAAE,KAAa;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACnC,OAAO,KAAK,GAAG,CAAC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC1E,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAa;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACnC,OAAO,KAAK,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AACpF,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,QAAgB;IACxD,OAAO,IAAI,CAAC,MA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AAC,CAAA;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;IACnF,OAAO;QACL,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;QACrD,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC;QAC1C,SAAS,EAAE,IAAI;KAChB,CAAA;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod/v3';
2
+ export * from './command-output-text.js';
3
+ /**
4
+ * How much of a command's output the model reads, shared by the cloud harness and the Agent Host. The end is kept as
5
+ * well as the start, because test failures and build errors usually come last. stdout and stderr share one limit, so
6
+ * a full result stays under the size at which the harness replaces it with a short excerpt.
7
+ */
8
+ export declare const COMMAND_OUTPUT_MIN_CHARS = 2000;
9
+ export declare const COMMAND_OUTPUT_MAX_CHARS = 56000;
10
+ /** The saved full log stops here. */
11
+ export declare const COMMAND_OUTPUT_LOG_MAX_BYTES: number;
12
+ /** Each saved-log folder keeps at most this many logs, for at most a day. */
13
+ export declare const COMMAND_OUTPUT_LOG_KEEP = 20;
14
+ export declare const COMMAND_OUTPUT_LOG_MAX_AGE_MS: number;
15
+ export declare const commandOutputLimitSchema: z.ZodNumber;
16
+ /** Added to each runtime's description of `computer_exec`. */
17
+ export declare const COMMAND_OUTPUT_DESCRIPTION: string;
18
+ //# sourceMappingURL=command-output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-output.d.ts","sourceRoot":"","sources":["../src/command-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,cAAc,0BAA0B,CAAA;AAExC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAQ,CAAA;AAC7C,eAAO,MAAM,wBAAwB,QAAS,CAAA;AAC9C,qCAAqC;AACrC,eAAO,MAAM,4BAA4B,QAAmB,CAAA;AAC5D,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,KAAK,CAAA;AACzC,eAAO,MAAM,6BAA6B,QAAsB,CAAA;AAEhE,eAAO,MAAM,wBAAwB,aAA+E,CAAA;AAEpH,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,QAEmD,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod/v3';
2
+ export * from './command-output-text.js';
3
+ /**
4
+ * How much of a command's output the model reads, shared by the cloud harness and the Agent Host. The end is kept as
5
+ * well as the start, because test failures and build errors usually come last. stdout and stderr share one limit, so
6
+ * a full result stays under the size at which the harness replaces it with a short excerpt.
7
+ */
8
+ export const COMMAND_OUTPUT_MIN_CHARS = 2_000;
9
+ export const COMMAND_OUTPUT_MAX_CHARS = 56_000;
10
+ /** The saved full log stops here. */
11
+ export const COMMAND_OUTPUT_LOG_MAX_BYTES = 10 * 1024 * 1024;
12
+ /** Each saved-log folder keeps at most this many logs, for at most a day. */
13
+ export const COMMAND_OUTPUT_LOG_KEEP = 20;
14
+ export const COMMAND_OUTPUT_LOG_MAX_AGE_MS = 24 * 60 * 60 * 1000;
15
+ export const commandOutputLimitSchema = z.number().int().min(COMMAND_OUTPUT_MIN_CHARS).max(COMMAND_OUTPUT_MAX_CHARS);
16
+ /** Added to each runtime's description of `computer_exec`. */
17
+ export const COMMAND_OUTPUT_DESCRIPTION = 'Long output keeps its start and end, with the gap marked. When some is left out, outputPath (if returned) is the saved log on that computer: '
18
+ + 'search it with rg or read some of its lines. Use maxOutputChars to see less or more.';
19
+ //# sourceMappingURL=command-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-output.js","sourceRoot":"","sources":["../src/command-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,cAAc,0BAA0B,CAAA;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAA;AAC7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAA;AAC9C,qCAAqC;AACrC,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAC5D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAA;AACzC,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEhE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;AAEpH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GACrC,+IAA+I;MAC7I,sFAAsF,CAAA"}