@poe-platform/safe-js 0.1.742 → 0.1.744
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/README.md +4 -3
- package/dist/safe-js/chunks/{chunk-F6CV74HU.js → chunk-3NFTBEZR.js} +2 -3
- package/dist/safe-js/chunks/{chunk-LMS5SSTN.js → chunk-5WP5IRMP.js} +437 -388
- package/dist/safe-js/chunks/{chunk-47JWFV2B.js → chunk-6UP3B5TB.js} +7 -8
- package/dist/safe-js/chunks/{chunk-24Z6PSCN.js → chunk-6ZVFR4HR.js} +1 -2
- package/dist/safe-js/chunks/{chunk-J3CUCOMP.js → chunk-AB6ERQE5.js} +14798 -14210
- package/dist/safe-js/chunks/{chunk-4YIDX44G.js → chunk-CQ52GEHY.js} +0 -1
- package/dist/safe-js/chunks/chunk-DHGJSEFX.js +0 -0
- package/dist/safe-js/chunks/{chunk-GVKXZW53.js → chunk-DIG26TEI.js} +0 -1
- package/dist/safe-js/chunks/{chunk-JCVARKWT.js → chunk-DIMBVKHT.js} +6 -7
- package/dist/safe-js/chunks/{chunk-UQPYTZOZ.js → chunk-JCHJGIQA.js} +0 -1
- package/dist/safe-js/chunks/{chunk-IRYOK5BR.js → chunk-L265M6OS.js} +2 -3
- package/dist/safe-js/chunks/{chunk-3ITVV2R6.js → chunk-L3MIVH3T.js} +1 -2
- package/dist/safe-js/chunks/{chunk-AUVGHYM5.js → chunk-LRINZRJA.js} +2 -3
- package/dist/safe-js/chunks/{chunk-UIUJHTWG.js → chunk-MKY3MQUB.js} +3 -4
- package/dist/safe-js/chunks/{chunk-YDVEVDVT.js → chunk-MLJ4BKDX.js} +102 -20
- package/dist/safe-js/chunks/{chunk-YUQFFRUF.js → chunk-MMN3IESA.js} +1 -2
- package/dist/safe-js/chunks/{chunk-WEGFNME4.js → chunk-O3S3JVWS.js} +1 -2
- package/dist/safe-js/chunks/{chunk-2GVBG23M.js → chunk-ONWFPHUI.js} +0 -1
- package/dist/safe-js/chunks/chunk-OQYVEDRN.js +66 -0
- package/dist/safe-js/chunks/{chunk-EMH7CXQM.js → chunk-POEMWNHD.js} +1 -2
- package/dist/safe-js/chunks/{chunk-G6WTEIJJ.js → chunk-X3YCE3ZH.js} +1 -2
- package/dist/safe-js/chunks/{chunk-WWETRQCF.js → chunk-YYF5R6ML.js} +3 -4
- package/dist/safe-js/chunks/{cli-runtime-3SOHLG5M.js → cli-runtime-BGB24HNE.js} +19 -20
- package/dist/safe-js/chunks/{dump-CSLHITIE.js → dump-M7CMVXW7.js} +5 -6
- package/dist/safe-js/chunks/harness-4CPQ7WKS.js +10 -0
- package/dist/safe-js/chunks/mcp-7SNWIP5H.js +11 -0
- package/dist/safe-js/chunks/migration-file-CPBVNMLD.js +14 -0
- package/dist/safe-js/chunks/restore-FLH6OC5F.js +13 -0
- package/dist/safe-js/chunks/run-KFAD7GTT.js +19 -0
- package/dist/safe-js/chunks/runtime-modules-D6NO4KJW.js +10 -0
- package/dist/safe-js/chunks/source-files-BSDM22Y2.js +9 -0
- package/dist/safe-js/cli.js +5 -6
- package/dist/safe-js/core.d.ts +1 -1
- package/dist/safe-js/core.js +14 -15
- package/dist/safe-js/extensions.d.ts +17 -0
- package/dist/safe-js/index.d.ts +2 -2
- package/dist/safe-js/index.js +22 -23
- package/dist/safe-js/interp/arguments.d.ts +2 -0
- package/dist/safe-js/interp/collection-properties.d.ts +2 -0
- package/dist/safe-js/interp/data-copy.d.ts +2 -0
- package/dist/safe-js/interp/host-bridge.d.ts +5 -0
- package/dist/safe-js/interp/host-capabilities.d.ts +5 -0
- package/dist/safe-js/interp/internal-symbols.d.ts +1 -0
- package/dist/safe-js/interp/interpreter.d.ts +3 -1
- package/dist/safe-js/interp/regex/compile-guard.d.ts +6 -4
- package/dist/safe-js/interp/template-cache.d.ts +5 -0
- package/dist/safe-js/interp/values.d.ts +11 -0
- package/dist/safe-js/modules/fs.d.ts +4 -3
- package/dist/safe-js/modules/fs.js +8 -9
- package/dist/safe-js/platform/context.d.ts +14 -0
- package/dist/safe-js/platform/node.d.ts +16 -0
- package/dist/safe-js/platform/types.d.ts +18 -0
- package/dist/safe-js/platform/workerd.d.ts +21 -0
- package/dist/safe-js/restore.d.ts +1 -1
- package/dist/safe-js/snapshot/validation.d.ts +2 -1
- package/package.json +5 -5
- package/dist/safe-js/chunks/chunk-24Z6PSCN.js.map +0 -7
- package/dist/safe-js/chunks/chunk-2GVBG23M.js.map +0 -7
- package/dist/safe-js/chunks/chunk-3ITVV2R6.js.map +0 -7
- package/dist/safe-js/chunks/chunk-47JWFV2B.js.map +0 -7
- package/dist/safe-js/chunks/chunk-4YIDX44G.js.map +0 -7
- package/dist/safe-js/chunks/chunk-AUVGHYM5.js.map +0 -7
- package/dist/safe-js/chunks/chunk-EMH7CXQM.js.map +0 -7
- package/dist/safe-js/chunks/chunk-F6CV74HU.js.map +0 -7
- package/dist/safe-js/chunks/chunk-G6WTEIJJ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-GVKXZW53.js.map +0 -7
- package/dist/safe-js/chunks/chunk-IRYOK5BR.js.map +0 -7
- package/dist/safe-js/chunks/chunk-J3CUCOMP.js.map +0 -7
- package/dist/safe-js/chunks/chunk-JCVARKWT.js.map +0 -7
- package/dist/safe-js/chunks/chunk-LMS5SSTN.js.map +0 -7
- package/dist/safe-js/chunks/chunk-U7ZNMTSQ.js +0 -1
- package/dist/safe-js/chunks/chunk-U7ZNMTSQ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-UIUJHTWG.js.map +0 -7
- package/dist/safe-js/chunks/chunk-UQPYTZOZ.js.map +0 -7
- package/dist/safe-js/chunks/chunk-V72WS373.js +0 -128
- package/dist/safe-js/chunks/chunk-V72WS373.js.map +0 -7
- package/dist/safe-js/chunks/chunk-WEGFNME4.js.map +0 -7
- package/dist/safe-js/chunks/chunk-WWETRQCF.js.map +0 -7
- package/dist/safe-js/chunks/chunk-YDVEVDVT.js.map +0 -7
- package/dist/safe-js/chunks/chunk-YUQFFRUF.js.map +0 -7
- package/dist/safe-js/chunks/cli-runtime-3SOHLG5M.js.map +0 -7
- package/dist/safe-js/chunks/dump-CSLHITIE.js.map +0 -7
- package/dist/safe-js/chunks/harness-QKPVLVOT.js +0 -11
- package/dist/safe-js/chunks/harness-QKPVLVOT.js.map +0 -7
- package/dist/safe-js/chunks/mcp-A4YKQCIS.js +0 -12
- package/dist/safe-js/chunks/mcp-A4YKQCIS.js.map +0 -7
- package/dist/safe-js/chunks/migration-file-QCZTVXEU.js +0 -15
- package/dist/safe-js/chunks/migration-file-QCZTVXEU.js.map +0 -7
- package/dist/safe-js/chunks/restore-22OGYS6N.js +0 -14
- package/dist/safe-js/chunks/restore-22OGYS6N.js.map +0 -7
- package/dist/safe-js/chunks/run-EMFOFJ22.js +0 -20
- package/dist/safe-js/chunks/run-EMFOFJ22.js.map +0 -7
- package/dist/safe-js/chunks/runtime-modules-QCVDLUVF.js +0 -11
- package/dist/safe-js/chunks/runtime-modules-QCVDLUVF.js.map +0 -7
- package/dist/safe-js/chunks/source-files-L3SGK63Z.js +0 -10
- package/dist/safe-js/chunks/source-files-L3SGK63Z.js.map +0 -7
- package/dist/safe-js/cli.js.map +0 -7
- package/dist/safe-js/core.js.map +0 -7
- package/dist/safe-js/index.js.map +0 -7
- package/dist/safe-js/modules/fs.js.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.744",
|
|
4
4
|
"description": "Budgeted JavaScript interpreter with explicit host capabilities and resumable execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@poe-platform/safe-fs": "0.1.
|
|
61
|
+
"@poe-platform/safe-fs": "0.1.744",
|
|
62
62
|
"@petamoriken/float16": "^3.9.3",
|
|
63
63
|
"@noble/hashes": "2.4.0",
|
|
64
64
|
"@formatjs/intl-localematcher": "0.8.13",
|
|
65
65
|
"@formatjs/bigdecimal": "0.2.7",
|
|
66
66
|
"temporal-polyfill": "1.0.4",
|
|
67
67
|
"@formatjs/intl-durationformat": "0.10.18",
|
|
68
|
-
"
|
|
69
|
-
"yaml": "2.9.0",
|
|
68
|
+
"@types/node": "^25.2.2",
|
|
70
69
|
"@formatjs/intl-numberformat": "9.4.0",
|
|
71
|
-
"
|
|
70
|
+
"jose": "^6.1.3",
|
|
71
|
+
"yaml": "2.9.0"
|
|
72
72
|
},
|
|
73
73
|
"imports": {
|
|
74
74
|
"#safe-js-platform": {
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/modules/harness.ts"],
|
|
4
|
-
"sourcesContent": ["import { deepCopyToSandbox, type SandboxValue } from \"../interp/values.js\";\n\nexport type HarnessFrontmatter = Record<string, SandboxValue>;\n\nexport type HarnessModuleMeta = {\n kind: SandboxValue;\n version: SandboxValue;\n filepath: string;\n frontmatter: HarnessFrontmatter;\n};\n\nexport type HarnessModule = {\n tasks: SandboxValue;\n agents: SandboxValue;\n meta: HarnessModuleMeta;\n applyConstraints: (prompt: string) => string;\n};\n\nexport function makeHarnessModule(\n frontmatter: Record<string, unknown>,\n meta: {\n kind: unknown;\n version: unknown;\n filepath: string;\n }\n): HarnessModule {\n const copiedFrontmatter = copyHarnessValue(frontmatter) as HarnessFrontmatter;\n const constraints = readConstraints(copiedFrontmatter);\n\n return {\n tasks: copyHarnessValue(copiedFrontmatter.tasks),\n agents: copyHarnessValue(copiedFrontmatter.agents),\n meta: {\n kind: copyHarnessValue(meta.kind),\n version: copyHarnessValue(meta.version),\n filepath: meta.filepath,\n frontmatter: copiedFrontmatter\n },\n applyConstraints: (prompt: string) => applyConstraints(prompt, constraints)\n };\n}\n\nfunction copyHarnessValue(value: unknown): SandboxValue {\n return deepCopyToSandbox(value);\n}\n\nfunction readConstraints(frontmatter: HarnessFrontmatter): string[] {\n const constraints = new Set<string>();\n\n appendConstraintValues(constraints, frontmatter.principles);\n appendConstraintValues(constraints, frontmatter.constraints);\n\n return [...constraints];\n}\n\nfunction appendConstraintValues(constraints: Set<string>, value: SandboxValue): void {\n if (!Array.isArray(value)) {\n return;\n }\n\n for (const item of value) {\n if (typeof item !== \"string\") {\n throw new Error(\"constraints/principles must be strings\");\n }\n\n constraints.add(item);\n }\n}\n\nfunction applyConstraints(prompt: string, constraints: readonly string[]): string {\n if (constraints.length === 0) {\n return prompt;\n }\n\n const preamble = `CONSTRAINTS (hard rules, honor all):\\n${constraints\n .map((constraint) => `- ${constraint}`)\n .join(\"\\n\")}`;\n\n return prompt.length === 0 ? preamble : `${preamble}\\n\\n${prompt}`;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAkBO,SAAS,kBACd,aACA,MAKe;AACf,QAAM,oBAAoB,iBAAiB,WAAW;AACtD,QAAM,cAAc,gBAAgB,iBAAiB;AAErD,SAAO;AAAA,IACL,OAAO,iBAAiB,kBAAkB,KAAK;AAAA,IAC/C,QAAQ,iBAAiB,kBAAkB,MAAM;AAAA,IACjD,MAAM;AAAA,MACJ,MAAM,iBAAiB,KAAK,IAAI;AAAA,MAChC,SAAS,iBAAiB,KAAK,OAAO;AAAA,MACtC,UAAU,KAAK;AAAA,MACf,aAAa;AAAA,IACf;AAAA,IACA,kBAAkB,CAAC,WAAmB,iBAAiB,QAAQ,WAAW;AAAA,EAC5E;AACF;AAEA,SAAS,iBAAiB,OAA8B;AACtD,SAAO,kBAAkB,KAAK;AAChC;AAEA,SAAS,gBAAgB,aAA2C;AAClE,QAAM,cAAc,oBAAI,IAAY;AAEpC,yBAAuB,aAAa,YAAY,UAAU;AAC1D,yBAAuB,aAAa,YAAY,WAAW;AAE3D,SAAO,CAAC,GAAG,WAAW;AACxB;AAEA,SAAS,uBAAuB,aAA0B,OAA2B;AACnF,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AACzB;AAAA,EACF;AAEA,aAAW,QAAQ,OAAO;AACxB,QAAI,OAAO,SAAS,UAAU;AAC5B,YAAM,IAAI,MAAM,wCAAwC;AAAA,IAC1D;AAEA,gBAAY,IAAI,IAAI;AAAA,EACtB;AACF;AAEA,SAAS,iBAAiB,QAAgB,aAAwC;AAChF,MAAI,YAAY,WAAW,GAAG;AAC5B,WAAO;AAAA,EACT;AAEA,QAAM,WAAW;AAAA,EAAyC,YACvD,IAAI,CAAC,eAAe,KAAK,UAAU,EAAE,EACrC,KAAK,IAAI,CAAC;AAEb,SAAO,OAAO,WAAW,IAAI,WAAW,GAAG,QAAQ;AAAA;AAAA,EAAO,MAAM;AAClE;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/error-codes.ts"],
|
|
4
|
-
"sourcesContent": ["export function getOwnErrorCode(error: unknown): string | undefined {\n if (\n typeof error !== \"object\" ||\n error === null ||\n !Object.prototype.hasOwnProperty.call(error, \"code\")\n ) {\n return undefined;\n }\n\n const code = (error as { code?: unknown }).code;\n return typeof code === \"string\" ? code : undefined;\n}\n\nexport function hasOwnErrorCode(error: unknown, code: string): error is NodeJS.ErrnoException {\n return getOwnErrorCode(error) === code;\n}\n\nexport type SystemError = Error & { code?: string; errno?: number; syscall?: string; path?: string; dest?: string };\n"],
|
|
5
|
-
"mappings": ";AAAO,SAAS,gBAAgB,OAAoC;AAClE,MACE,OAAO,UAAU,YACjB,UAAU,QACV,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,MAAM,GACnD;AACA,WAAO;AAAA,EACT;AAEA,QAAM,OAAQ,MAA6B;AAC3C,SAAO,OAAO,SAAS,WAAW,OAAO;AAC3C;AAEO,SAAS,gBAAgB,OAAgB,MAA8C;AAC5F,SAAO,gBAAgB,KAAK,MAAM;AACpC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|