@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.
- package/dist/LICENSE +201 -0
- package/dist/THIRD-PARTY-NOTICES.md +2319 -0
- package/dist/anthropic-messages-WBFOHES5.js +7214 -0
- package/dist/azure-openai-responses-NZFH3PO6.js +253 -0
- package/dist/chunk-25XSBFX6.js +639 -0
- package/dist/chunk-2QBQZGXF.js +110 -0
- package/dist/chunk-2ZP2NBW3.js +345 -0
- package/dist/chunk-4KA63VNZ.js +2 -0
- package/dist/chunk-4M6TXTT5.js +86 -0
- package/dist/chunk-4US7ZHT3.js +20 -0
- package/dist/chunk-6M3OOCKO.js +11809 -0
- package/dist/chunk-7AXAFDPG.js +17 -0
- package/dist/chunk-7E7V6OIU.js +920 -0
- package/dist/chunk-BXA47DTF.js +548 -0
- package/dist/chunk-D2DVAH37.js +25 -0
- package/dist/chunk-FSBUS2BI.js +26 -0
- package/dist/chunk-GKDRAHLI.js +4787 -0
- package/dist/chunk-H462EFJP.js +89 -0
- package/dist/chunk-IIJQ3DW4.js +35 -0
- package/dist/chunk-JQD5EWJY.js +34 -0
- package/dist/chunk-K26BVR6O.js +61 -0
- package/dist/chunk-KAO7WIXG.js +31 -0
- package/dist/chunk-KJ4HJCTK.js +1178 -0
- package/dist/chunk-LBKI23CC.js +9810 -0
- package/dist/chunk-LKBKZEHT.js +41 -0
- package/dist/chunk-MD7TLTXZ.js +18 -0
- package/dist/chunk-MPXK7QBL.js +868 -0
- package/dist/chunk-NRLGWZJC.js +11 -0
- package/dist/chunk-QBD6EJ2Z.js +1746 -0
- package/dist/chunk-R6I3VKME.js +132 -0
- package/dist/chunk-TJON22J4.js +87 -0
- package/dist/chunk-ULY36ME4.js +33097 -0
- package/dist/chunk-XALZLRYK.js +9221 -0
- package/dist/chunk-XPQKM3L7.js +57 -0
- package/dist/chunk-YH6YJ2IB.js +1773 -0
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +13716 -580
- package/dist/console/assets/{index-Rtc_B7cs.js → index-B1vGMXKr.js} +11 -11
- package/dist/console/assets/{index-Rtc_B7cs.js.map → index-B1vGMXKr.js.map} +1 -1
- package/dist/console/index.html +1 -1
- package/dist/dist-65MDQA4Q.js +1126 -0
- package/dist/dist-KNR2XL6J.js +39 -0
- package/dist/execution.d.ts +557 -2
- package/dist/execution.js +37 -2
- package/dist/faux-runner-worker.js +128 -0
- package/dist/google-generative-ai-YMHXZSFE.js +422 -0
- package/dist/google-vertex-X6DB3ZQ6.js +471 -0
- package/dist/index.d.ts +853 -25
- package/dist/index.js +84 -385
- package/dist/kernel.d.ts +39 -2
- package/dist/kernel.js +21 -2
- package/dist/mistral-conversations-TY3MMD6G.js +718 -0
- package/dist/multipart-parser-F6M4NJZU.js +373 -0
- package/dist/openai-codex-responses-BRDUMLN5.js +1374 -0
- package/dist/openai-completions-CX634XN3.js +1139 -0
- package/dist/openai-responses-HMCXJIHT.js +300 -0
- package/dist/openrouter-images-KTWET2H2.js +148 -0
- package/dist/pi-messages-XL5OEC4K.js +307 -0
- package/dist/pi-worker.js +671 -0
- package/dist/runner-pi.d.ts +342 -2
- package/dist/runner-pi.js +46 -2
- package/dist/runner-registry-GD4BYCQC.js +22 -0
- package/dist/sqlite.d.ts +446 -2
- package/dist/sqlite.js +15 -2
- package/dist/src-F2KBSV4T.js +1398 -0
- package/dist/supervisor.d.ts +625 -2
- package/dist/supervisor.js +39 -2
- package/dist/testkit.d.ts +564 -2
- package/dist/testkit.js +127 -2
- package/dist/transcript.d.ts +84 -2
- package/dist/transcript.js +25 -2
- package/dist/verification-worker.js +72 -0
- package/package.json +2 -26
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/control.d.ts +0 -106
- package/dist/control.d.ts.map +0 -1
- package/dist/control.js +0 -242
- package/dist/control.js.map +0 -1
- package/dist/execution.d.ts.map +0 -1
- package/dist/execution.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js.map +0 -1
- package/dist/live-config.d.ts +0 -10
- package/dist/live-config.d.ts.map +0 -1
- package/dist/live-config.js +0 -44
- package/dist/live-config.js.map +0 -1
- package/dist/prompt-queue.d.ts +0 -13
- package/dist/prompt-queue.d.ts.map +0 -1
- package/dist/prompt-queue.js +0 -35
- package/dist/prompt-queue.js.map +0 -1
- package/dist/runner-pi.d.ts.map +0 -1
- package/dist/runner-pi.js.map +0 -1
- package/dist/runner-registry.d.ts +0 -8
- package/dist/runner-registry.d.ts.map +0 -1
- package/dist/runner-registry.js +0 -12
- package/dist/runner-registry.js.map +0 -1
- package/dist/searchable-select.d.ts +0 -24
- package/dist/searchable-select.d.ts.map +0 -1
- package/dist/searchable-select.js +0 -61
- package/dist/searchable-select.js.map +0 -1
- package/dist/secret-input.d.ts +0 -8
- package/dist/secret-input.d.ts.map +0 -1
- package/dist/secret-input.js +0 -14
- package/dist/secret-input.js.map +0 -1
- package/dist/setup-wizard.d.ts +0 -22
- package/dist/setup-wizard.d.ts.map +0 -1
- package/dist/setup-wizard.js +0 -154
- package/dist/setup-wizard.js.map +0 -1
- package/dist/sqlite.d.ts.map +0 -1
- package/dist/sqlite.js.map +0 -1
- package/dist/supervisor.d.ts.map +0 -1
- package/dist/supervisor.js.map +0 -1
- package/dist/testkit.d.ts.map +0 -1
- package/dist/testkit.js.map +0 -1
- package/dist/thread-inspect.d.ts +0 -47
- package/dist/thread-inspect.d.ts.map +0 -1
- package/dist/thread-inspect.js +0 -78
- package/dist/thread-inspect.js.map +0 -1
- package/dist/transcript.d.ts.map +0 -1
- package/dist/transcript.js.map +0 -1
- package/dist/tui-theme.d.ts +0 -17
- package/dist/tui-theme.d.ts.map +0 -1
- package/dist/tui-theme.js +0 -19
- package/dist/tui-theme.js.map +0 -1
- package/dist/tui.d.ts +0 -24
- package/dist/tui.d.ts.map +0 -1
- package/dist/tui.js +0 -784
- package/dist/tui.js.map +0 -1
- package/dist/update.d.ts +0 -16
- package/dist/update.d.ts.map +0 -1
- package/dist/update.js +0 -67
- package/dist/update.js.map +0 -1
- package/dist/web-console.d.ts +0 -33
- package/dist/web-console.d.ts.map +0 -1
- package/dist/web-console.js +0 -242
- package/dist/web-console.js.map +0 -1
- package/dist/welcome.d.ts +0 -30
- package/dist/welcome.d.ts.map +0 -1
- package/dist/welcome.js +0 -69
- package/dist/welcome.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/execution.d.ts +0 -544
- package/node_modules/goah-ledger-contract/dist/execution.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/execution.js +0 -52
- package/node_modules/goah-ledger-contract/dist/execution.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/index.d.ts +0 -4
- package/node_modules/goah-ledger-contract/dist/index.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/index.js +0 -4
- package/node_modules/goah-ledger-contract/dist/index.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/kernel.d.ts +0 -37
- package/node_modules/goah-ledger-contract/dist/kernel.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/kernel.js +0 -8
- package/node_modules/goah-ledger-contract/dist/kernel.js.map +0 -1
- package/node_modules/goah-ledger-contract/dist/transcript.d.ts +0 -63
- package/node_modules/goah-ledger-contract/dist/transcript.d.ts.map +0 -1
- package/node_modules/goah-ledger-contract/dist/transcript.js +0 -115
- package/node_modules/goah-ledger-contract/dist/transcript.js.map +0 -1
- package/node_modules/goah-ledger-contract/package.json +0 -28
- package/node_modules/goah-ledger-sqlite/dist/index.d.ts +0 -86
- package/node_modules/goah-ledger-sqlite/dist/index.d.ts.map +0 -1
- package/node_modules/goah-ledger-sqlite/dist/index.js +0 -1254
- package/node_modules/goah-ledger-sqlite/dist/index.js.map +0 -1
- package/node_modules/goah-ledger-sqlite/package.json +0 -26
- package/node_modules/goah-runner-pi/dist/configurator.d.ts +0 -20
- package/node_modules/goah-runner-pi/dist/configurator.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/configurator.js +0 -423
- package/node_modules/goah-runner-pi/dist/configurator.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/credential-store.d.ts +0 -14
- package/node_modules/goah-runner-pi/dist/credential-store.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/credential-store.js +0 -163
- package/node_modules/goah-runner-pi/dist/credential-store.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/env-spec.d.ts +0 -17
- package/node_modules/goah-runner-pi/dist/env-spec.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/env-spec.js +0 -95
- package/node_modules/goah-runner-pi/dist/env-spec.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/index.d.ts +0 -76
- package/node_modules/goah-runner-pi/dist/index.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/index.js +0 -326
- package/node_modules/goah-runner-pi/dist/index.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/model-provider.d.ts +0 -30
- package/node_modules/goah-runner-pi/dist/model-provider.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/model-provider.js +0 -96
- package/node_modules/goah-runner-pi/dist/model-provider.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/pi-worker.d.ts +0 -31
- package/node_modules/goah-runner-pi/dist/pi-worker.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/pi-worker.js +0 -579
- package/node_modules/goah-runner-pi/dist/pi-worker.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.d.ts +0 -2
- package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.js +0 -3
- package/node_modules/goah-runner-pi/dist/steering-no-ack.test-fixture.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.d.ts +0 -2
- package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.js +0 -5
- package/node_modules/goah-runner-pi/dist/steering-reject.test-fixture.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.d.ts +0 -2
- package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.js +0 -5
- package/node_modules/goah-runner-pi/dist/steering-worker.test-fixture.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/test-helpers.d.ts +0 -4
- package/node_modules/goah-runner-pi/dist/test-helpers.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/test-helpers.js +0 -13
- package/node_modules/goah-runner-pi/dist/test-helpers.js.map +0 -1
- package/node_modules/goah-runner-pi/dist/verification-worker.d.ts +0 -2
- package/node_modules/goah-runner-pi/dist/verification-worker.d.ts.map +0 -1
- package/node_modules/goah-runner-pi/dist/verification-worker.js +0 -46
- package/node_modules/goah-runner-pi/dist/verification-worker.js.map +0 -1
- package/node_modules/goah-runner-pi/package.json +0 -28
- package/node_modules/goah-supervisor/dist/context-view.d.ts +0 -30
- package/node_modules/goah-supervisor/dist/context-view.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/context-view.js +0 -58
- package/node_modules/goah-supervisor/dist/context-view.js.map +0 -1
- package/node_modules/goah-supervisor/dist/index.d.ts +0 -96
- package/node_modules/goah-supervisor/dist/index.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/index.js +0 -1075
- package/node_modules/goah-supervisor/dist/index.js.map +0 -1
- package/node_modules/goah-supervisor/dist/roles.d.ts +0 -4
- package/node_modules/goah-supervisor/dist/roles.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/roles.js +0 -29
- package/node_modules/goah-supervisor/dist/roles.js.map +0 -1
- package/node_modules/goah-supervisor/dist/verification.d.ts +0 -61
- package/node_modules/goah-supervisor/dist/verification.d.ts.map +0 -1
- package/node_modules/goah-supervisor/dist/verification.js +0 -135
- package/node_modules/goah-supervisor/dist/verification.js.map +0 -1
- package/node_modules/goah-supervisor/package.json +0 -26
- package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts +0 -2
- package/node_modules/goah-testkit/dist/faux-runner-worker.d.ts.map +0 -1
- package/node_modules/goah-testkit/dist/faux-runner-worker.js +0 -82
- package/node_modules/goah-testkit/dist/faux-runner-worker.js.map +0 -1
- package/node_modules/goah-testkit/dist/index.d.ts +0 -49
- package/node_modules/goah-testkit/dist/index.d.ts.map +0 -1
- package/node_modules/goah-testkit/dist/index.js +0 -96
- package/node_modules/goah-testkit/dist/index.js.map +0 -1
- 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
|
+
};
|