@goah/cli 0.13.0 → 0.13.2

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 (236) hide show
  1. package/dist/LICENSE +201 -0
  2. package/dist/THIRD-PARTY-NOTICES.md +2319 -0
  3. package/dist/anthropic-messages-WBFOHES5.js +7214 -0
  4. package/dist/azure-openai-responses-NZFH3PO6.js +253 -0
  5. package/dist/chunk-25XSBFX6.js +639 -0
  6. package/dist/chunk-2QBQZGXF.js +110 -0
  7. package/dist/chunk-2ZP2NBW3.js +345 -0
  8. package/dist/chunk-4KA63VNZ.js +2 -0
  9. package/dist/chunk-4M6TXTT5.js +86 -0
  10. package/dist/chunk-4US7ZHT3.js +20 -0
  11. package/dist/chunk-6M3OOCKO.js +11809 -0
  12. package/dist/chunk-7AXAFDPG.js +17 -0
  13. package/dist/chunk-7E7V6OIU.js +920 -0
  14. package/dist/chunk-BXA47DTF.js +548 -0
  15. package/dist/chunk-D2DVAH37.js +25 -0
  16. package/dist/chunk-FSBUS2BI.js +26 -0
  17. package/dist/chunk-GKDRAHLI.js +4787 -0
  18. package/dist/chunk-H462EFJP.js +89 -0
  19. package/dist/chunk-IIJQ3DW4.js +35 -0
  20. package/dist/chunk-JQD5EWJY.js +34 -0
  21. package/dist/chunk-K26BVR6O.js +61 -0
  22. package/dist/chunk-KAO7WIXG.js +31 -0
  23. package/dist/chunk-KJ4HJCTK.js +1178 -0
  24. package/dist/chunk-LBKI23CC.js +9810 -0
  25. package/dist/chunk-LKBKZEHT.js +41 -0
  26. package/dist/chunk-MD7TLTXZ.js +18 -0
  27. package/dist/chunk-MPXK7QBL.js +868 -0
  28. package/dist/chunk-NRLGWZJC.js +11 -0
  29. package/dist/chunk-QBD6EJ2Z.js +1746 -0
  30. package/dist/chunk-R6I3VKME.js +132 -0
  31. package/dist/chunk-TJON22J4.js +87 -0
  32. package/dist/chunk-ULY36ME4.js +33097 -0
  33. package/dist/chunk-XALZLRYK.js +9221 -0
  34. package/dist/chunk-XPQKM3L7.js +57 -0
  35. package/dist/chunk-YH6YJ2IB.js +1773 -0
  36. package/dist/cli.d.ts +0 -2
  37. package/dist/cli.js +13716 -580
  38. package/dist/console/assets/{index-Rtc_B7cs.js → index-B1vGMXKr.js} +11 -11
  39. package/dist/console/assets/{index-Rtc_B7cs.js.map → index-B1vGMXKr.js.map} +1 -1
  40. package/dist/console/index.html +1 -1
  41. package/dist/dist-65MDQA4Q.js +1126 -0
  42. package/dist/dist-KNR2XL6J.js +39 -0
  43. package/dist/execution.d.ts +557 -2
  44. package/dist/execution.js +37 -2
  45. package/dist/faux-runner-worker.js +128 -0
  46. package/dist/google-generative-ai-YMHXZSFE.js +422 -0
  47. package/dist/google-vertex-X6DB3ZQ6.js +471 -0
  48. package/dist/index.d.ts +853 -25
  49. package/dist/index.js +84 -385
  50. package/dist/kernel.d.ts +39 -2
  51. package/dist/kernel.js +21 -2
  52. package/dist/mistral-conversations-TY3MMD6G.js +718 -0
  53. package/dist/multipart-parser-F6M4NJZU.js +373 -0
  54. package/dist/openai-codex-responses-BRDUMLN5.js +1374 -0
  55. package/dist/openai-completions-CX634XN3.js +1139 -0
  56. package/dist/openai-responses-HMCXJIHT.js +300 -0
  57. package/dist/openrouter-images-KTWET2H2.js +148 -0
  58. package/dist/pi-messages-XL5OEC4K.js +307 -0
  59. package/dist/pi-worker.js +671 -0
  60. package/dist/runner-pi.d.ts +342 -2
  61. package/dist/runner-pi.js +46 -2
  62. package/dist/runner-registry-GD4BYCQC.js +22 -0
  63. package/dist/sqlite.d.ts +446 -2
  64. package/dist/sqlite.js +15 -2
  65. package/dist/src-F2KBSV4T.js +1398 -0
  66. package/dist/supervisor.d.ts +625 -2
  67. package/dist/supervisor.js +39 -2
  68. package/dist/testkit.d.ts +564 -2
  69. package/dist/testkit.js +127 -2
  70. package/dist/transcript.d.ts +84 -2
  71. package/dist/transcript.js +25 -2
  72. package/dist/verification-worker.js +72 -0
  73. package/package.json +2 -26
  74. package/dist/cli.d.ts.map +0 -1
  75. package/dist/cli.js.map +0 -1
  76. package/dist/control.d.ts +0 -106
  77. package/dist/control.d.ts.map +0 -1
  78. package/dist/control.js +0 -242
  79. package/dist/control.js.map +0 -1
  80. package/dist/execution.d.ts.map +0 -1
  81. package/dist/execution.js.map +0 -1
  82. package/dist/index.d.ts.map +0 -1
  83. package/dist/index.js.map +0 -1
  84. package/dist/kernel.d.ts.map +0 -1
  85. package/dist/kernel.js.map +0 -1
  86. package/dist/live-config.d.ts +0 -10
  87. package/dist/live-config.d.ts.map +0 -1
  88. package/dist/live-config.js +0 -44
  89. package/dist/live-config.js.map +0 -1
  90. package/dist/prompt-queue.d.ts +0 -13
  91. package/dist/prompt-queue.d.ts.map +0 -1
  92. package/dist/prompt-queue.js +0 -35
  93. package/dist/prompt-queue.js.map +0 -1
  94. package/dist/runner-pi.d.ts.map +0 -1
  95. package/dist/runner-pi.js.map +0 -1
  96. package/dist/runner-registry.d.ts +0 -8
  97. package/dist/runner-registry.d.ts.map +0 -1
  98. package/dist/runner-registry.js +0 -12
  99. package/dist/runner-registry.js.map +0 -1
  100. package/dist/searchable-select.d.ts +0 -24
  101. package/dist/searchable-select.d.ts.map +0 -1
  102. package/dist/searchable-select.js +0 -61
  103. package/dist/searchable-select.js.map +0 -1
  104. package/dist/secret-input.d.ts +0 -8
  105. package/dist/secret-input.d.ts.map +0 -1
  106. package/dist/secret-input.js +0 -14
  107. package/dist/secret-input.js.map +0 -1
  108. package/dist/setup-wizard.d.ts +0 -22
  109. package/dist/setup-wizard.d.ts.map +0 -1
  110. package/dist/setup-wizard.js +0 -154
  111. package/dist/setup-wizard.js.map +0 -1
  112. package/dist/sqlite.d.ts.map +0 -1
  113. package/dist/sqlite.js.map +0 -1
  114. package/dist/supervisor.d.ts.map +0 -1
  115. package/dist/supervisor.js.map +0 -1
  116. package/dist/testkit.d.ts.map +0 -1
  117. package/dist/testkit.js.map +0 -1
  118. package/dist/thread-inspect.d.ts +0 -47
  119. package/dist/thread-inspect.d.ts.map +0 -1
  120. package/dist/thread-inspect.js +0 -78
  121. package/dist/thread-inspect.js.map +0 -1
  122. package/dist/transcript.d.ts.map +0 -1
  123. package/dist/transcript.js.map +0 -1
  124. package/dist/tui-theme.d.ts +0 -17
  125. package/dist/tui-theme.d.ts.map +0 -1
  126. package/dist/tui-theme.js +0 -19
  127. package/dist/tui-theme.js.map +0 -1
  128. package/dist/tui.d.ts +0 -24
  129. package/dist/tui.d.ts.map +0 -1
  130. package/dist/tui.js +0 -784
  131. package/dist/tui.js.map +0 -1
  132. package/dist/update.d.ts +0 -16
  133. package/dist/update.d.ts.map +0 -1
  134. package/dist/update.js +0 -67
  135. package/dist/update.js.map +0 -1
  136. package/dist/web-console.d.ts +0 -33
  137. package/dist/web-console.d.ts.map +0 -1
  138. package/dist/web-console.js +0 -242
  139. package/dist/web-console.js.map +0 -1
  140. package/dist/welcome.d.ts +0 -30
  141. package/dist/welcome.d.ts.map +0 -1
  142. package/dist/welcome.js +0 -69
  143. package/dist/welcome.js.map +0 -1
  144. package/node_modules/goah-ledger-contract/dist/execution.d.ts +0 -544
  145. package/node_modules/goah-ledger-contract/dist/execution.d.ts.map +0 -1
  146. package/node_modules/goah-ledger-contract/dist/execution.js +0 -52
  147. package/node_modules/goah-ledger-contract/dist/execution.js.map +0 -1
  148. package/node_modules/goah-ledger-contract/dist/index.d.ts +0 -4
  149. package/node_modules/goah-ledger-contract/dist/index.d.ts.map +0 -1
  150. package/node_modules/goah-ledger-contract/dist/index.js +0 -4
  151. package/node_modules/goah-ledger-contract/dist/index.js.map +0 -1
  152. package/node_modules/goah-ledger-contract/dist/kernel.d.ts +0 -37
  153. package/node_modules/goah-ledger-contract/dist/kernel.d.ts.map +0 -1
  154. package/node_modules/goah-ledger-contract/dist/kernel.js +0 -8
  155. package/node_modules/goah-ledger-contract/dist/kernel.js.map +0 -1
  156. package/node_modules/goah-ledger-contract/dist/transcript.d.ts +0 -63
  157. package/node_modules/goah-ledger-contract/dist/transcript.d.ts.map +0 -1
  158. package/node_modules/goah-ledger-contract/dist/transcript.js +0 -115
  159. package/node_modules/goah-ledger-contract/dist/transcript.js.map +0 -1
  160. package/node_modules/goah-ledger-contract/package.json +0 -28
  161. package/node_modules/goah-ledger-sqlite/dist/index.d.ts +0 -86
  162. package/node_modules/goah-ledger-sqlite/dist/index.d.ts.map +0 -1
  163. package/node_modules/goah-ledger-sqlite/dist/index.js +0 -1254
  164. package/node_modules/goah-ledger-sqlite/dist/index.js.map +0 -1
  165. package/node_modules/goah-ledger-sqlite/package.json +0 -26
  166. package/node_modules/goah-runner-pi/dist/configurator.d.ts +0 -20
  167. package/node_modules/goah-runner-pi/dist/configurator.d.ts.map +0 -1
  168. package/node_modules/goah-runner-pi/dist/configurator.js +0 -423
  169. package/node_modules/goah-runner-pi/dist/configurator.js.map +0 -1
  170. package/node_modules/goah-runner-pi/dist/credential-store.d.ts +0 -14
  171. package/node_modules/goah-runner-pi/dist/credential-store.d.ts.map +0 -1
  172. package/node_modules/goah-runner-pi/dist/credential-store.js +0 -163
  173. package/node_modules/goah-runner-pi/dist/credential-store.js.map +0 -1
  174. package/node_modules/goah-runner-pi/dist/env-spec.d.ts +0 -17
  175. package/node_modules/goah-runner-pi/dist/env-spec.d.ts.map +0 -1
  176. package/node_modules/goah-runner-pi/dist/env-spec.js +0 -95
  177. package/node_modules/goah-runner-pi/dist/env-spec.js.map +0 -1
  178. package/node_modules/goah-runner-pi/dist/index.d.ts +0 -76
  179. package/node_modules/goah-runner-pi/dist/index.d.ts.map +0 -1
  180. package/node_modules/goah-runner-pi/dist/index.js +0 -326
  181. package/node_modules/goah-runner-pi/dist/index.js.map +0 -1
  182. package/node_modules/goah-runner-pi/dist/model-provider.d.ts +0 -30
  183. package/node_modules/goah-runner-pi/dist/model-provider.d.ts.map +0 -1
  184. package/node_modules/goah-runner-pi/dist/model-provider.js +0 -96
  185. package/node_modules/goah-runner-pi/dist/model-provider.js.map +0 -1
  186. package/node_modules/goah-runner-pi/dist/pi-worker.d.ts +0 -31
  187. package/node_modules/goah-runner-pi/dist/pi-worker.d.ts.map +0 -1
  188. package/node_modules/goah-runner-pi/dist/pi-worker.js +0 -579
  189. package/node_modules/goah-runner-pi/dist/pi-worker.js.map +0 -1
  190. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.d.ts +0 -2
  191. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.d.ts.map +0 -1
  192. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.js +0 -3
  193. package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.js.map +0 -1
  194. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.d.ts +0 -2
  195. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.d.ts.map +0 -1
  196. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.js +0 -5
  197. package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.js.map +0 -1
  198. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.d.ts +0 -2
  199. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.d.ts.map +0 -1
  200. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.js +0 -5
  201. package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.js.map +0 -1
  202. package/node_modules/goah-runner-pi/dist/test-helpers.d.ts +0 -4
  203. package/node_modules/goah-runner-pi/dist/test-helpers.d.ts.map +0 -1
  204. package/node_modules/goah-runner-pi/dist/test-helpers.js +0 -13
  205. package/node_modules/goah-runner-pi/dist/test-helpers.js.map +0 -1
  206. package/node_modules/goah-runner-pi/dist/verification-worker.d.ts +0 -2
  207. package/node_modules/goah-runner-pi/dist/verification-worker.d.ts.map +0 -1
  208. package/node_modules/goah-runner-pi/dist/verification-worker.js +0 -46
  209. package/node_modules/goah-runner-pi/dist/verification-worker.js.map +0 -1
  210. package/node_modules/goah-runner-pi/package.json +0 -28
  211. package/node_modules/goah-supervisor/dist/context-view.d.ts +0 -30
  212. package/node_modules/goah-supervisor/dist/context-view.d.ts.map +0 -1
  213. package/node_modules/goah-supervisor/dist/context-view.js +0 -58
  214. package/node_modules/goah-supervisor/dist/context-view.js.map +0 -1
  215. package/node_modules/goah-supervisor/dist/index.d.ts +0 -96
  216. package/node_modules/goah-supervisor/dist/index.d.ts.map +0 -1
  217. package/node_modules/goah-supervisor/dist/index.js +0 -1075
  218. package/node_modules/goah-supervisor/dist/index.js.map +0 -1
  219. package/node_modules/goah-supervisor/dist/roles.d.ts +0 -4
  220. package/node_modules/goah-supervisor/dist/roles.d.ts.map +0 -1
  221. package/node_modules/goah-supervisor/dist/roles.js +0 -29
  222. package/node_modules/goah-supervisor/dist/roles.js.map +0 -1
  223. package/node_modules/goah-supervisor/dist/verification.d.ts +0 -61
  224. package/node_modules/goah-supervisor/dist/verification.d.ts.map +0 -1
  225. package/node_modules/goah-supervisor/dist/verification.js +0 -135
  226. package/node_modules/goah-supervisor/dist/verification.js.map +0 -1
  227. package/node_modules/goah-supervisor/package.json +0 -26
  228. package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts +0 -2
  229. package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts.map +0 -1
  230. package/node_modules/goah-testkit/dist/faux-runner-worker.js +0 -82
  231. package/node_modules/goah-testkit/dist/faux-runner-worker.js.map +0 -1
  232. package/node_modules/goah-testkit/dist/index.d.ts +0 -49
  233. package/node_modules/goah-testkit/dist/index.d.ts.map +0 -1
  234. package/node_modules/goah-testkit/dist/index.js +0 -96
  235. package/node_modules/goah-testkit/dist/index.js.map +0 -1
  236. package/node_modules/goah-testkit/package.json +0 -29
@@ -0,0 +1,89 @@
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+
4
+ // ../../node_modules/@earendil-works/pi-ai/dist/utils/error-body.js
5
+ var MAX_PROVIDER_ERROR_BODY_CHARS = 4e3;
6
+ function normalizeProviderError(error) {
7
+ if (!(error instanceof Error)) {
8
+ return { message: safeJsonStringify(error), messageCarriesBody: false };
9
+ }
10
+ const sdkError = error;
11
+ const status = extractStatus(sdkError);
12
+ const body = extractBody(sdkError);
13
+ const messageCarriesBody = body === void 0 || error.message.includes(body);
14
+ return {
15
+ status,
16
+ body,
17
+ message: error.message,
18
+ messageCarriesBody
19
+ };
20
+ }
21
+ function extractStatus(error) {
22
+ if (typeof error.statusCode === "number")
23
+ return error.statusCode;
24
+ if (typeof error.status === "number")
25
+ return error.status;
26
+ if (typeof error.$metadata?.httpStatusCode === "number")
27
+ return error.$metadata.httpStatusCode;
28
+ if (typeof error.$response?.statusCode === "number")
29
+ return error.$response.statusCode;
30
+ return void 0;
31
+ }
32
+ function extractBody(error) {
33
+ const bodyText = pickBodyText(error);
34
+ if (bodyText === void 0)
35
+ return void 0;
36
+ const trimmed = bodyText.trim();
37
+ if (trimmed.length === 0)
38
+ return void 0;
39
+ return truncateErrorText(trimmed, MAX_PROVIDER_ERROR_BODY_CHARS);
40
+ }
41
+ function pickBodyText(error) {
42
+ if (typeof error.body === "string")
43
+ return error.body;
44
+ if (isPlainNonEmptyObject(error.error))
45
+ return safeJsonStringify(error.error);
46
+ const responseBody = error.$response?.body;
47
+ if (typeof responseBody === "string")
48
+ return responseBody;
49
+ if (isReadableStreamLike(responseBody))
50
+ return void 0;
51
+ if (isPlainNonEmptyObject(responseBody))
52
+ return safeJsonStringify(responseBody);
53
+ return void 0;
54
+ }
55
+ function isReadableStreamLike(value) {
56
+ return typeof value === "object" && value !== null && "pipe" in value && typeof value.pipe === "function";
57
+ }
58
+ function isPlainNonEmptyObject(value) {
59
+ if (typeof value !== "object" || value === null)
60
+ return false;
61
+ const proto = Object.getPrototypeOf(value);
62
+ if (proto !== Object.prototype && proto !== null)
63
+ return false;
64
+ return Object.keys(value).length > 0;
65
+ }
66
+ function formatProviderError(norm, prefix) {
67
+ if (norm.messageCarriesBody || norm.status === void 0 || norm.body === void 0) {
68
+ return prefix !== void 0 && norm.status !== void 0 ? `${prefix} (${norm.status}): ${norm.message}` : norm.message;
69
+ }
70
+ return prefix !== void 0 ? `${prefix} (${norm.status}): ${norm.body}` : `${norm.status}: ${norm.body}`;
71
+ }
72
+ function truncateErrorText(text, maxChars) {
73
+ if (text.length <= maxChars)
74
+ return text;
75
+ return `${text.slice(0, maxChars)}... [truncated ${text.length - maxChars} chars]`;
76
+ }
77
+ function safeJsonStringify(value) {
78
+ try {
79
+ const serialized = JSON.stringify(value);
80
+ return serialized === void 0 ? String(value) : serialized;
81
+ } catch {
82
+ return String(value);
83
+ }
84
+ }
85
+
86
+ export {
87
+ normalizeProviderError,
88
+ formatProviderError
89
+ };
@@ -0,0 +1,35 @@
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+ import {
4
+ __require
5
+ } from "./chunk-XPQKM3L7.js";
6
+
7
+ // ../../node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js
8
+ var procEnvCache = null;
9
+ function getBunSandboxEnvValue(name) {
10
+ if (typeof process === "undefined" || !process.versions?.bun || Object.keys(process.env).length > 0) {
11
+ return void 0;
12
+ }
13
+ if (procEnvCache === null) {
14
+ procEnvCache = /* @__PURE__ */ new Map();
15
+ try {
16
+ const { readFileSync } = __require("node:fs");
17
+ const data = readFileSync("/proc/self/environ", "utf-8");
18
+ for (const entry of data.split("\0")) {
19
+ const idx = entry.indexOf("=");
20
+ if (idx > 0) {
21
+ procEnvCache.set(entry.slice(0, idx), entry.slice(idx + 1));
22
+ }
23
+ }
24
+ } catch {
25
+ }
26
+ }
27
+ return procEnvCache.get(name);
28
+ }
29
+ function getProviderEnvValue(name, env) {
30
+ return env?.[name] || (typeof process !== "undefined" ? process.env[name] : void 0) || getBunSandboxEnvValue(name) || void 0;
31
+ }
32
+
33
+ export {
34
+ getProviderEnvValue
35
+ };
@@ -0,0 +1,34 @@
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+
4
+ // ../../node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js
5
+ function inferCopilotInitiator(messages) {
6
+ const last = messages[messages.length - 1];
7
+ return last && last.role !== "user" ? "agent" : "user";
8
+ }
9
+ function hasCopilotVisionInput(messages) {
10
+ return messages.some((msg) => {
11
+ if (msg.role === "user" && Array.isArray(msg.content)) {
12
+ return msg.content.some((c) => c.type === "image");
13
+ }
14
+ if (msg.role === "toolResult" && Array.isArray(msg.content)) {
15
+ return msg.content.some((c) => c.type === "image");
16
+ }
17
+ return false;
18
+ });
19
+ }
20
+ function buildCopilotDynamicHeaders(params) {
21
+ const headers = {
22
+ "X-Initiator": inferCopilotInitiator(params.messages),
23
+ "Openai-Intent": "conversation-edits"
24
+ };
25
+ if (params.hasImages) {
26
+ headers["Copilot-Vision-Request"] = "true";
27
+ }
28
+ return headers;
29
+ }
30
+
31
+ export {
32
+ hasCopilotVisionInput,
33
+ buildCopilotDynamicHeaders
34
+ };
@@ -0,0 +1,61 @@
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+
4
+ // ../../node_modules/@earendil-works/pi-ai/dist/session-resources.js
5
+ var sessionResourceCleanups = /* @__PURE__ */ new Set();
6
+ function registerSessionResourceCleanup(cleanup) {
7
+ sessionResourceCleanups.add(cleanup);
8
+ return () => {
9
+ sessionResourceCleanups.delete(cleanup);
10
+ };
11
+ }
12
+
13
+ // ../../node_modules/@earendil-works/pi-ai/dist/utils/uuid.js
14
+ var lastTimestamp = -Infinity;
15
+ var sequence = 0;
16
+ function fillRandomBytes(bytes) {
17
+ if (globalThis.crypto?.getRandomValues) {
18
+ globalThis.crypto.getRandomValues(bytes);
19
+ return;
20
+ }
21
+ for (let i = 0; i < bytes.length; i++) {
22
+ bytes[i] = Math.floor(Math.random() * 256);
23
+ }
24
+ }
25
+ function uuidv7() {
26
+ const random = new Uint8Array(16);
27
+ fillRandomBytes(random);
28
+ const timestamp = Date.now();
29
+ if (timestamp > lastTimestamp) {
30
+ sequence = random[6] * 16777216 + random[7] * 65536 + random[8] * 256 + random[9];
31
+ lastTimestamp = timestamp;
32
+ } else {
33
+ sequence = sequence + 1 >>> 0;
34
+ if (sequence === 0)
35
+ lastTimestamp++;
36
+ }
37
+ const bytes = new Uint8Array(16);
38
+ bytes[0] = lastTimestamp / 1099511627776 & 255;
39
+ bytes[1] = lastTimestamp / 4294967296 & 255;
40
+ bytes[2] = lastTimestamp / 16777216 & 255;
41
+ bytes[3] = lastTimestamp / 65536 & 255;
42
+ bytes[4] = lastTimestamp / 256 & 255;
43
+ bytes[5] = lastTimestamp & 255;
44
+ bytes[6] = 112 | sequence >>> 28 & 15;
45
+ bytes[7] = sequence >>> 20 & 255;
46
+ bytes[8] = 128 | sequence >>> 14 & 63;
47
+ bytes[9] = sequence >>> 6 & 255;
48
+ bytes[10] = (sequence & 63) << 2 | random[10] & 3;
49
+ bytes[11] = random[11];
50
+ bytes[12] = random[12];
51
+ bytes[13] = random[13];
52
+ bytes[14] = random[14];
53
+ bytes[15] = random[15];
54
+ const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0"));
55
+ return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10, 16).join("")}`;
56
+ }
57
+
58
+ export {
59
+ registerSessionResourceCleanup,
60
+ uuidv7
61
+ };
@@ -0,0 +1,31 @@
1
+ import { createRequire as __goahCreateRequire } from "node:module";
2
+ const require = __goahCreateRequire(import.meta.url);
3
+
4
+ // node_modules/goah-ledger-contract/dist/kernel.js
5
+ var CONTRACT_VERSION = "0.13.0";
6
+ var CONTRACT_STABILITY = "experimental";
7
+ function wakeStream(wakeId) {
8
+ return `wake:${wakeId}`;
9
+ }
10
+ function controlStream(actor = "supervisor") {
11
+ return `control:${actor}`;
12
+ }
13
+ function goalStream(goalId) {
14
+ return `goal:${goalId}`;
15
+ }
16
+ function workRecordStream(goalId) {
17
+ return `work-record:${goalId}`;
18
+ }
19
+ function memoryStream(agent) {
20
+ return `memory:${agent}`;
21
+ }
22
+
23
+ export {
24
+ CONTRACT_VERSION,
25
+ CONTRACT_STABILITY,
26
+ wakeStream,
27
+ controlStream,
28
+ goalStream,
29
+ workRecordStream,
30
+ memoryStream
31
+ };