@odla-ai/harness 0.11.18 → 0.11.19

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 (39) hide show
  1. package/dist/{chunk-T2IW7MYQ.js → chunk-4TG55ATB.js} +2 -2
  2. package/dist/{chunk-O47JCUGI.js → chunk-7NP3YOMY.js} +33 -5
  3. package/dist/chunk-7NP3YOMY.js.map +1 -0
  4. package/dist/{chunk-3ON6UAOV.js → chunk-A5B3CEK2.js} +3 -3
  5. package/dist/{chunk-EXSEQEZ6.js → chunk-M6BNH25Z.js} +4 -4
  6. package/dist/{chunk-ONYW2VSB.js → chunk-O4QLHUGO.js} +1 -1
  7. package/dist/chunk-O4QLHUGO.js.map +1 -0
  8. package/dist/{chunk-6T26HEWI.js → chunk-SMN2FWQE.js} +17 -3
  9. package/dist/{chunk-6T26HEWI.js.map → chunk-SMN2FWQE.js.map} +1 -1
  10. package/dist/cli.cjs.map +1 -1
  11. package/dist/cli.js +4 -4
  12. package/dist/code-runtime-cli.cjs +42 -3
  13. package/dist/code-runtime-cli.cjs.map +1 -1
  14. package/dist/code-runtime-cli.js +5 -5
  15. package/dist/code-session-event-data-C6mQB76s.d.cts +134 -0
  16. package/dist/code-session-event-data-wCQc2py3.d.ts +134 -0
  17. package/dist/index.cjs +19 -2
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +15 -4
  20. package/dist/index.d.ts +15 -4
  21. package/dist/index.js +9 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/node.cjs +42 -3
  24. package/dist/node.cjs.map +1 -1
  25. package/dist/node.d.cts +8 -1
  26. package/dist/node.d.ts +8 -1
  27. package/dist/node.js +6 -6
  28. package/dist/testing.cjs.map +1 -1
  29. package/dist/testing.d.cts +1 -1
  30. package/dist/testing.d.ts +1 -1
  31. package/dist/testing.js +1 -1
  32. package/dist/{types-D-Kv1svf.d.ts → types-DM-UgoBN.d.cts} +2 -118
  33. package/dist/{types-D-Kv1svf.d.cts → types-DM-UgoBN.d.ts} +2 -118
  34. package/package.json +1 -1
  35. package/dist/chunk-O47JCUGI.js.map +0 -1
  36. package/dist/chunk-ONYW2VSB.js.map +0 -1
  37. /package/dist/{chunk-T2IW7MYQ.js.map → chunk-4TG55ATB.js.map} +0 -0
  38. /package/dist/{chunk-3ON6UAOV.js.map → chunk-A5B3CEK2.js.map} +0 -0
  39. /package/dist/{chunk-EXSEQEZ6.js.map → chunk-M6BNH25Z.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HARNESS_PROTOCOL_VERSION
3
- } from "./chunk-ONYW2VSB.js";
3
+ } from "./chunk-O4QLHUGO.js";
4
4
 
5
5
  // src/protocol.ts
6
6
  var CONTROL = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/;
@@ -90,4 +90,4 @@ export {
90
90
  encodeAgentInput,
91
91
  makeHarnessEvent
92
92
  };
93
- //# sourceMappingURL=chunk-T2IW7MYQ.js.map
93
+ //# sourceMappingURL=chunk-4TG55ATB.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  observedBroker
3
- } from "./chunk-6T26HEWI.js";
3
+ } from "./chunk-SMN2FWQE.js";
4
4
  import {
5
5
  SECRET_WORKSPACE_FILE,
6
6
  SKIP_WORKSPACE_DIRS,
@@ -8,10 +8,10 @@ import {
8
8
  stageWorkspace,
9
9
  stageWorkspacePair,
10
10
  verifyContainerEngineBoundary
11
- } from "./chunk-3ON6UAOV.js";
11
+ } from "./chunk-A5B3CEK2.js";
12
12
  import {
13
13
  HARNESS_PROTOCOL_VERSION
14
- } from "./chunk-ONYW2VSB.js";
14
+ } from "./chunk-O4QLHUGO.js";
15
15
 
16
16
  // src/workspace-digest.ts
17
17
  import { createHash } from "crypto";
@@ -1708,11 +1708,16 @@ function codeCommandMetadata(payload, resume) {
1708
1708
  if (!Number.isSafeInteger(maxTokensPerInteraction) || Number(maxTokensPerInteraction) < 4e3 || Number(maxTokensPerInteraction) > 2e5) {
1709
1709
  throw new TypeError(`invalid Code ${resume ? "resume" : "start"} interaction token limit`);
1710
1710
  }
1711
+ const eventDetail = payload.eventDetail ?? "standard";
1712
+ if (eventDetail !== "standard" && eventDetail !== "verbose") {
1713
+ throw new TypeError(`invalid Code ${resume ? "resume" : "start"} event detail`);
1714
+ }
1711
1715
  return {
1712
1716
  role,
1713
1717
  readOnly,
1714
1718
  title,
1715
1719
  prompt,
1720
+ eventDetail,
1716
1721
  proof: codeCommandProof(payload.proof, resume),
1717
1722
  maxTokensPerInteraction: Number(maxTokensPerInteraction),
1718
1723
  planningInputDigest: typeof planning === "string" && /^sha256:[0-9a-f]{64}$/.test(planning) ? planning : null,
@@ -2420,6 +2425,20 @@ async function sessionSkillsFor(options, command) {
2420
2425
 
2421
2426
  // src/code-runtime-inference.ts
2422
2427
  var inferWithBackoff = (infer, wait2, onRetry) => withOverloadRetry(infer, wait2, (cause, delayMs) => onRetry(cause, delayMs), transientControlFailure);
2428
+ var MAX_VERBOSE_TEXT = 4e3;
2429
+ var clip = (text) => text.length <= MAX_VERBOSE_TEXT ? text : `${text.slice(0, MAX_VERBOSE_TEXT - 1)}\u2026`;
2430
+ function verboseTurnEvents(response2, durationMs) {
2431
+ const events = [];
2432
+ const interim = response2.response.stopReason === "tool_use";
2433
+ for (const block of response2.response.content) {
2434
+ if (block.type === "thinking" && block.thinking.trim()) {
2435
+ events.push({ type: "thinking", available: true, durationMs, text: clip(block.thinking.trim()) });
2436
+ } else if (block.type === "text" && interim && block.text.trim()) {
2437
+ events.push({ type: "text", text: clip(block.text.trim()) });
2438
+ }
2439
+ }
2440
+ return events;
2441
+ }
2423
2442
  async function handleCodeRuntimeInference(input) {
2424
2443
  const { command, request, state } = input;
2425
2444
  const startedAt = Date.now();
@@ -2437,6 +2456,11 @@ async function handleCodeRuntimeInference(input) {
2437
2456
  message: `Code control plane overloaded (${cause.code}); retrying the model call in ${delayMs / 1e3}s`
2438
2457
  }).catch(() => void 0)
2439
2458
  );
2459
+ if (input.metadata.eventDetail === "verbose") {
2460
+ for (const event of verboseTurnEvents(response2, Date.now() - startedAt)) {
2461
+ await input.event(event).catch(() => void 0);
2462
+ }
2463
+ }
2440
2464
  state.tokens += response2.receipt.inputTokens + response2.receipt.outputTokens;
2441
2465
  const { costUsd } = response2.receipt;
2442
2466
  if (costUsd === void 0) state.costKnown = false;
@@ -3978,6 +4002,7 @@ var TheseusRuntimeEngine = class {
3978
4002
  buildPolicyDigest: resolvedRecipes.buildPolicyDigest,
3979
4003
  role: metadata.role,
3980
4004
  readOnly: metadata.readOnly,
4005
+ eventDetail: metadata.eventDetail,
3981
4006
  title: metadata.title,
3982
4007
  proof: metadata.proof,
3983
4008
  maxTokensPerInteraction: metadata.maxTokensPerInteraction,
@@ -4045,6 +4070,7 @@ var TheseusRuntimeEngine = class {
4045
4070
  prompt,
4046
4071
  proof: active.proof,
4047
4072
  maxTokensPerInteraction: active.maxTokensPerInteraction,
4073
+ eventDetail: active.eventDetail,
4048
4074
  planningInputDigest: active.planningInputDigest,
4049
4075
  attestationDigest: "pursue",
4050
4076
  repository: active.repository,
@@ -4089,6 +4115,7 @@ var TheseusRuntimeEngine = class {
4089
4115
  prompt,
4090
4116
  proof: active.proof,
4091
4117
  maxTokensPerInteraction: active.maxTokensPerInteraction,
4118
+ eventDetail: active.eventDetail,
4092
4119
  planningInputDigest: active.planningInputDigest,
4093
4120
  attestationDigest: "follow-up",
4094
4121
  repository: active.repository,
@@ -4172,7 +4199,8 @@ var TheseusRuntimeEngine = class {
4172
4199
  return observedBroker({
4173
4200
  broker,
4174
4201
  operationIdFor: (requestId) => digestRuntimeValue(`${command.commandId}:${requestId}`),
4175
- emit: (event) => this.#event(command, event, active.conversationRefs).catch(() => void 0)
4202
+ emit: (event) => this.#event(command, event, active.conversationRefs).catch(() => void 0),
4203
+ detail: active.eventDetail
4176
4204
  });
4177
4205
  }
4178
4206
  async #checkpoint(command) {
@@ -4259,4 +4287,4 @@ export {
4259
4287
  withProofRecipes,
4260
4288
  TheseusRuntimeEngine
4261
4289
  };
4262
- //# sourceMappingURL=chunk-O47JCUGI.js.map
4290
+ //# sourceMappingURL=chunk-7NP3YOMY.js.map