@truefoundry/trueforge-core 0.1.3 → 0.1.4

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 (111) hide show
  1. package/dist/agent-session/TurnResourceResolver.d.ts.map +1 -1
  2. package/dist/agent-session/TurnResourceResolver.js +1 -4
  3. package/dist/agent-session/TurnResourceResolver.js.map +1 -1
  4. package/dist/agent-session/TurnResourceResolver.mjs +1 -4
  5. package/dist/agent-session/TurnResourceResolver.mjs.map +1 -1
  6. package/dist/agent-session/index.d.ts +1 -1
  7. package/dist/agent-session/index.d.ts.map +1 -1
  8. package/dist/agent-session/index.js.map +1 -1
  9. package/dist/agent-session/index.mjs.map +1 -1
  10. package/dist/agent-session/schemas/agentSpec.d.ts +7 -28
  11. package/dist/agent-session/schemas/agentSpec.d.ts.map +1 -1
  12. package/dist/agent-session/schemas/agentSpec.js +15 -43
  13. package/dist/agent-session/schemas/agentSpec.js.map +1 -1
  14. package/dist/agent-session/schemas/agentSpec.mjs +15 -43
  15. package/dist/agent-session/schemas/agentSpec.mjs.map +1 -1
  16. package/dist/agent-session/schemas/session.d.ts +0 -39
  17. package/dist/agent-session/schemas/session.d.ts.map +1 -1
  18. package/dist/core/index.d.ts +4 -1
  19. package/dist/core/index.d.ts.map +1 -1
  20. package/dist/core/index.js +12 -0
  21. package/dist/core/index.js.map +1 -1
  22. package/dist/core/index.mjs +7 -0
  23. package/dist/core/index.mjs.map +1 -1
  24. package/dist/core/runtime/AgentThread.d.ts.map +1 -1
  25. package/dist/core/runtime/AgentThread.js +25 -11
  26. package/dist/core/runtime/AgentThread.js.map +1 -1
  27. package/dist/core/runtime/AgentThread.mjs +25 -11
  28. package/dist/core/runtime/AgentThread.mjs.map +1 -1
  29. package/dist/core/sandbox/Sandbox.d.ts +15 -4
  30. package/dist/core/sandbox/Sandbox.d.ts.map +1 -1
  31. package/dist/core/sandbox/Sandbox.js +200 -80
  32. package/dist/core/sandbox/Sandbox.js.map +1 -1
  33. package/dist/core/sandbox/Sandbox.mjs +201 -81
  34. package/dist/core/sandbox/Sandbox.mjs.map +1 -1
  35. package/dist/core/sandbox/SandboxErrors.d.ts +7 -3
  36. package/dist/core/sandbox/SandboxErrors.d.ts.map +1 -1
  37. package/dist/core/sandbox/SandboxErrors.js +6 -6
  38. package/dist/core/sandbox/SandboxErrors.js.map +1 -1
  39. package/dist/core/sandbox/SandboxErrors.mjs +6 -6
  40. package/dist/core/sandbox/SandboxErrors.mjs.map +1 -1
  41. package/dist/core/sandbox/codeMode/CodeModeTransport.d.ts +22 -0
  42. package/dist/core/sandbox/codeMode/CodeModeTransport.d.ts.map +1 -1
  43. package/dist/core/sandbox/codeMode/CodeModeTransport.js.map +1 -1
  44. package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.d.ts +9 -1
  45. package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.d.ts.map +1 -1
  46. package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.js +12 -0
  47. package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.js.map +1 -1
  48. package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.mjs +12 -0
  49. package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.mjs.map +1 -1
  50. package/dist/core/sandbox/constants.d.ts +0 -2
  51. package/dist/core/sandbox/constants.d.ts.map +1 -1
  52. package/dist/core/sandbox/constants.js +2 -5
  53. package/dist/core/sandbox/constants.js.map +1 -1
  54. package/dist/core/sandbox/constants.mjs +1 -3
  55. package/dist/core/sandbox/constants.mjs.map +1 -1
  56. package/dist/core/sandbox/provider/DaytonaProvider.d.ts +4 -0
  57. package/dist/core/sandbox/provider/DaytonaProvider.d.ts.map +1 -1
  58. package/dist/core/sandbox/provider/DaytonaProvider.js +27 -5
  59. package/dist/core/sandbox/provider/DaytonaProvider.js.map +1 -1
  60. package/dist/core/sandbox/provider/DaytonaProvider.mjs +27 -4
  61. package/dist/core/sandbox/provider/DaytonaProvider.mjs.map +1 -1
  62. package/dist/core/sandbox/provider/Provider.d.ts +13 -1
  63. package/dist/core/sandbox/provider/Provider.d.ts.map +1 -1
  64. package/dist/core/sandbox/provider/Provider.js.map +1 -1
  65. package/dist/core/sandbox/provider/Provider.mjs.map +1 -1
  66. package/dist/core/sandbox/provider/TFYSandboxProvider.d.ts +17 -2
  67. package/dist/core/sandbox/provider/TFYSandboxProvider.d.ts.map +1 -1
  68. package/dist/core/sandbox/provider/TFYSandboxProvider.js +81 -17
  69. package/dist/core/sandbox/provider/TFYSandboxProvider.js.map +1 -1
  70. package/dist/core/sandbox/provider/TFYSandboxProvider.mjs +82 -13
  71. package/dist/core/sandbox/provider/TFYSandboxProvider.mjs.map +1 -1
  72. package/dist/core/sandbox/provider/execEnv.d.ts +6 -0
  73. package/dist/core/sandbox/provider/execEnv.d.ts.map +1 -0
  74. package/dist/core/sandbox/provider/execEnv.js +55 -0
  75. package/dist/core/sandbox/provider/execEnv.js.map +1 -0
  76. package/dist/core/sandbox/provider/execEnv.mjs +30 -0
  77. package/dist/core/sandbox/provider/execEnv.mjs.map +1 -0
  78. package/dist/core/sandbox/sandboxImage.d.ts +2 -5
  79. package/dist/core/sandbox/sandboxImage.d.ts.map +1 -1
  80. package/dist/core/sandbox/sandboxImage.js +8 -1
  81. package/dist/core/sandbox/sandboxImage.js.map +1 -1
  82. package/dist/core/sandbox/sandboxImage.mjs +6 -1
  83. package/dist/core/sandbox/sandboxImage.mjs.map +1 -1
  84. package/dist/core/sandbox/sandboxRef.d.ts +26 -0
  85. package/dist/core/sandbox/sandboxRef.d.ts.map +1 -0
  86. package/dist/core/sandbox/sandboxRef.js +69 -0
  87. package/dist/core/sandbox/sandboxRef.js.map +1 -0
  88. package/dist/core/sandbox/sandboxRef.mjs +41 -0
  89. package/dist/core/sandbox/sandboxRef.mjs.map +1 -0
  90. package/dist/core/sandbox/skills/ISkillMounter.d.ts +7 -2
  91. package/dist/core/sandbox/skills/ISkillMounter.d.ts.map +1 -1
  92. package/dist/core/sandbox/skills/ISkillMounter.js.map +1 -1
  93. package/dist/core/sandbox/skills/SkillMounter.d.ts +7 -2
  94. package/dist/core/sandbox/skills/SkillMounter.d.ts.map +1 -1
  95. package/dist/core/sandbox/skills/SkillMounter.js +5 -6
  96. package/dist/core/sandbox/skills/SkillMounter.js.map +1 -1
  97. package/dist/core/sandbox/skills/SkillMounter.mjs +5 -6
  98. package/dist/core/sandbox/skills/SkillMounter.mjs.map +1 -1
  99. package/dist/core/sandbox/skills/constants.d.ts +4 -2
  100. package/dist/core/sandbox/skills/constants.d.ts.map +1 -1
  101. package/dist/core/sandbox/skills/constants.js +2 -5
  102. package/dist/core/sandbox/skills/constants.js.map +1 -1
  103. package/dist/core/sandbox/skills/constants.mjs +2 -4
  104. package/dist/core/sandbox/skills/constants.mjs.map +1 -1
  105. package/dist/core/sandbox/skills/index.d.ts +1 -1
  106. package/dist/core/sandbox/skills/index.d.ts.map +1 -1
  107. package/dist/core/sandbox/skills/index.js +0 -2
  108. package/dist/core/sandbox/skills/index.js.map +1 -1
  109. package/dist/core/sandbox/skills/index.mjs +1 -2
  110. package/dist/core/sandbox/skills/index.mjs.map +1 -1
  111. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execEnv.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/provider/execEnv.ts"],"names":[],"mappings":"AAQA,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBzB"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/core/sandbox/provider/execEnv.ts
21
+ var execEnv_exports = {};
22
+ __export(execEnv_exports, {
23
+ absolutizeRelativeExecEnv: () => absolutizeRelativeExecEnv
24
+ });
25
+ module.exports = __toCommonJS(execEnv_exports);
26
+ var import_posix = require("path/posix");
27
+ var GIT_STORE_FILE_PREFIX = "store --file ";
28
+ function resolveMaybeRelative(params) {
29
+ return params.path.startsWith("/") ? params.path : (0, import_posix.join)(params.root, params.path);
30
+ }
31
+ function absolutizeRelativeExecEnv(params) {
32
+ const out = {};
33
+ for (const [key, value] of Object.entries(params.env)) {
34
+ if (key === "PATH" || key === "PYTHONPATH") {
35
+ out[key] = value.split(":").map((part) => part.length === 0 ? part : resolveMaybeRelative({ root: params.root, path: part })).join(":");
36
+ continue;
37
+ }
38
+ if (key === "TFY_SKILLS_DIR" || key === "VIRTUAL_ENV") {
39
+ out[key] = resolveMaybeRelative({ root: params.root, path: value });
40
+ continue;
41
+ }
42
+ if (key.startsWith("GIT_CONFIG_VALUE_") && value.startsWith(GIT_STORE_FILE_PREFIX)) {
43
+ const file = value.slice(GIT_STORE_FILE_PREFIX.length);
44
+ out[key] = `${GIT_STORE_FILE_PREFIX}${resolveMaybeRelative({ root: params.root, path: file })}`;
45
+ continue;
46
+ }
47
+ out[key] = value;
48
+ }
49
+ return out;
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ absolutizeRelativeExecEnv
54
+ });
55
+ //# sourceMappingURL=execEnv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/sandbox/provider/execEnv.ts"],"sourcesContent":["import { join } from 'node:path/posix';\n\nconst GIT_STORE_FILE_PREFIX = 'store --file ';\n\nfunction resolveMaybeRelative(params: { root: string; path: string }): string {\n return params.path.startsWith('/') ? params.path : join(params.root, params.path);\n}\n\n/** Make cwd-relative PATH / PYTHONPATH / GIT_CONFIG store --file / TFY_SKILLS_DIR usable from any cwd. */\nexport function absolutizeRelativeExecEnv(params: {\n root: string;\n env: Record<string, string>;\n}): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of Object.entries(params.env)) {\n if (key === 'PATH' || key === 'PYTHONPATH') {\n out[key] = value\n .split(':')\n .map(part => (part.length === 0 ? part : resolveMaybeRelative({ root: params.root, path: part })))\n .join(':');\n continue;\n }\n if (key === 'TFY_SKILLS_DIR' || key === 'VIRTUAL_ENV') {\n out[key] = resolveMaybeRelative({ root: params.root, path: value });\n continue;\n }\n if (key.startsWith('GIT_CONFIG_VALUE_') && value.startsWith(GIT_STORE_FILE_PREFIX)) {\n const file = value.slice(GIT_STORE_FILE_PREFIX.length);\n out[key] = `${GIT_STORE_FILE_PREFIX}${resolveMaybeRelative({ root: params.root, path: file })}`;\n continue;\n }\n out[key] = value;\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqB;AAErB,IAAM,wBAAwB;AAE9B,SAAS,qBAAqB,QAAgD;AAC5E,SAAO,OAAO,KAAK,WAAW,GAAG,IAAI,OAAO,WAAO,mBAAK,OAAO,MAAM,OAAO,IAAI;AAClF;AAGO,SAAS,0BAA0B,QAGf;AACzB,QAAM,MAA8B,CAAC;AACrC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG,GAAG;AACrD,QAAI,QAAQ,UAAU,QAAQ,cAAc;AAC1C,UAAI,GAAG,IAAI,MACR,MAAM,GAAG,EACT,IAAI,UAAS,KAAK,WAAW,IAAI,OAAO,qBAAqB,EAAE,MAAM,OAAO,MAAM,MAAM,KAAK,CAAC,CAAE,EAChG,KAAK,GAAG;AACX;AAAA,IACF;AACA,QAAI,QAAQ,oBAAoB,QAAQ,eAAe;AACrD,UAAI,GAAG,IAAI,qBAAqB,EAAE,MAAM,OAAO,MAAM,MAAM,MAAM,CAAC;AAClE;AAAA,IACF;AACA,QAAI,IAAI,WAAW,mBAAmB,KAAK,MAAM,WAAW,qBAAqB,GAAG;AAClF,YAAM,OAAO,MAAM,MAAM,sBAAsB,MAAM;AACrD,UAAI,GAAG,IAAI,GAAG,qBAAqB,GAAG,qBAAqB,EAAE,MAAM,OAAO,MAAM,MAAM,KAAK,CAAC,CAAC;AAC7F;AAAA,IACF;AACA,QAAI,GAAG,IAAI;AAAA,EACb;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,30 @@
1
+ // src/core/sandbox/provider/execEnv.ts
2
+ import { join } from "path/posix";
3
+ var GIT_STORE_FILE_PREFIX = "store --file ";
4
+ function resolveMaybeRelative(params) {
5
+ return params.path.startsWith("/") ? params.path : join(params.root, params.path);
6
+ }
7
+ function absolutizeRelativeExecEnv(params) {
8
+ const out = {};
9
+ for (const [key, value] of Object.entries(params.env)) {
10
+ if (key === "PATH" || key === "PYTHONPATH") {
11
+ out[key] = value.split(":").map((part) => part.length === 0 ? part : resolveMaybeRelative({ root: params.root, path: part })).join(":");
12
+ continue;
13
+ }
14
+ if (key === "TFY_SKILLS_DIR" || key === "VIRTUAL_ENV") {
15
+ out[key] = resolveMaybeRelative({ root: params.root, path: value });
16
+ continue;
17
+ }
18
+ if (key.startsWith("GIT_CONFIG_VALUE_") && value.startsWith(GIT_STORE_FILE_PREFIX)) {
19
+ const file = value.slice(GIT_STORE_FILE_PREFIX.length);
20
+ out[key] = `${GIT_STORE_FILE_PREFIX}${resolveMaybeRelative({ root: params.root, path: file })}`;
21
+ continue;
22
+ }
23
+ out[key] = value;
24
+ }
25
+ return out;
26
+ }
27
+ export {
28
+ absolutizeRelativeExecEnv
29
+ };
30
+ //# sourceMappingURL=execEnv.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/sandbox/provider/execEnv.ts"],"sourcesContent":["import { join } from 'node:path/posix';\n\nconst GIT_STORE_FILE_PREFIX = 'store --file ';\n\nfunction resolveMaybeRelative(params: { root: string; path: string }): string {\n return params.path.startsWith('/') ? params.path : join(params.root, params.path);\n}\n\n/** Make cwd-relative PATH / PYTHONPATH / GIT_CONFIG store --file / TFY_SKILLS_DIR usable from any cwd. */\nexport function absolutizeRelativeExecEnv(params: {\n root: string;\n env: Record<string, string>;\n}): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of Object.entries(params.env)) {\n if (key === 'PATH' || key === 'PYTHONPATH') {\n out[key] = value\n .split(':')\n .map(part => (part.length === 0 ? part : resolveMaybeRelative({ root: params.root, path: part })))\n .join(':');\n continue;\n }\n if (key === 'TFY_SKILLS_DIR' || key === 'VIRTUAL_ENV') {\n out[key] = resolveMaybeRelative({ root: params.root, path: value });\n continue;\n }\n if (key.startsWith('GIT_CONFIG_VALUE_') && value.startsWith(GIT_STORE_FILE_PREFIX)) {\n const file = value.slice(GIT_STORE_FILE_PREFIX.length);\n out[key] = `${GIT_STORE_FILE_PREFIX}${resolveMaybeRelative({ root: params.root, path: file })}`;\n continue;\n }\n out[key] = value;\n }\n return out;\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAErB,IAAM,wBAAwB;AAE9B,SAAS,qBAAqB,QAAgD;AAC5E,SAAO,OAAO,KAAK,WAAW,GAAG,IAAI,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,IAAI;AAClF;AAGO,SAAS,0BAA0B,QAGf;AACzB,QAAM,MAA8B,CAAC;AACrC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG,GAAG;AACrD,QAAI,QAAQ,UAAU,QAAQ,cAAc;AAC1C,UAAI,GAAG,IAAI,MACR,MAAM,GAAG,EACT,IAAI,UAAS,KAAK,WAAW,IAAI,OAAO,qBAAqB,EAAE,MAAM,OAAO,MAAM,MAAM,KAAK,CAAC,CAAE,EAChG,KAAK,GAAG;AACX;AAAA,IACF;AACA,QAAI,QAAQ,oBAAoB,QAAQ,eAAe;AACrD,UAAI,GAAG,IAAI,qBAAqB,EAAE,MAAM,OAAO,MAAM,MAAM,MAAM,CAAC;AAClE;AAAA,IACF;AACA,QAAI,IAAI,WAAW,mBAAmB,KAAK,MAAM,WAAW,qBAAqB,GAAG;AAClF,YAAM,OAAO,MAAM,MAAM,sBAAsB,MAAM;AACrD,UAAI,GAAG,IAAI,GAAG,qBAAqB,GAAG,qBAAqB,EAAE,MAAM,OAAO,MAAM,MAAM,KAAK,CAAC,CAAC;AAC7F;AAAA,IACF;AACA,QAAI,GAAG,IAAI;AAAA,EACb;AACA,SAAO;AACT;","names":[]}
@@ -1,6 +1,3 @@
1
- /**
2
- * Release-owned sandbox image. In-memory for now; CI will later replace this
3
- * with the tag it pushes on each release.
4
- */
5
- export declare const SANDBOX_IMAGE_URI = "tfy.jfrog.io/tfy-images/trueforge-sandbox:ce9e802ff68514dfc6ff138ff81c8f26dbaaf724";
1
+ /** Release-owned sandbox image URI; CI rewrites `sandboxImage.json`. */
2
+ export declare const SANDBOX_IMAGE_URI: string;
6
3
  //# sourceMappingURL=sandboxImage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sandboxImage.d.ts","sourceRoot":"","sources":["../../../src/core/sandbox/sandboxImage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,uFAAuF,CAAC"}
1
+ {"version":3,"file":"sandboxImage.d.ts","sourceRoot":"","sources":["../../../src/core/sandbox/sandboxImage.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,QAAmB,CAAC"}
@@ -23,7 +23,14 @@ __export(sandboxImage_exports, {
23
23
  SANDBOX_IMAGE_URI: () => SANDBOX_IMAGE_URI
24
24
  });
25
25
  module.exports = __toCommonJS(sandboxImage_exports);
26
- var SANDBOX_IMAGE_URI = "tfy.jfrog.io/tfy-images/trueforge-sandbox:ce9e802ff68514dfc6ff138ff81c8f26dbaaf724";
26
+
27
+ // src/core/sandbox/sandboxImage.json
28
+ var sandboxImage_default = {
29
+ uri: "tfy.jfrog.io/tfy-images/trueforge-sandbox:0dab475d3d20a8333cff41f25f88e7134c424cf9"
30
+ };
31
+
32
+ // src/core/sandbox/sandboxImage.ts
33
+ var SANDBOX_IMAGE_URI = sandboxImage_default.uri;
27
34
  // Annotate the CommonJS export names for ESM import in node:
28
35
  0 && (module.exports = {
29
36
  SANDBOX_IMAGE_URI
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/sandbox/sandboxImage.ts"],"sourcesContent":["/**\n * Release-owned sandbox image. In-memory for now; CI will later replace this\n * with the tag it pushes on each release.\n */\nexport const SANDBOX_IMAGE_URI = 'tfy.jfrog.io/tfy-images/trueforge-sandbox:ce9e802ff68514dfc6ff138ff81c8f26dbaaf724';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../src/core/sandbox/sandboxImage.ts","../../../src/core/sandbox/sandboxImage.json"],"sourcesContent":["import sandboxImage from './sandboxImage.json' with { type: 'json' };\n\n/** Release-owned sandbox image URI; CI rewrites `sandboxImage.json`. */\nexport const SANDBOX_IMAGE_URI = sandboxImage.uri;\n","{\n \"uri\": \"tfy.jfrog.io/tfy-images/trueforge-sandbox:0dab475d3d20a8333cff41f25f88e7134c424cf9\"\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA,EACE,KAAO;AACT;;;ADCO,IAAM,oBAAoB,qBAAa;","names":[]}
@@ -1,5 +1,10 @@
1
+ // src/core/sandbox/sandboxImage.json
2
+ var sandboxImage_default = {
3
+ uri: "tfy.jfrog.io/tfy-images/trueforge-sandbox:0dab475d3d20a8333cff41f25f88e7134c424cf9"
4
+ };
5
+
1
6
  // src/core/sandbox/sandboxImage.ts
2
- var SANDBOX_IMAGE_URI = "tfy.jfrog.io/tfy-images/trueforge-sandbox:ce9e802ff68514dfc6ff138ff81c8f26dbaaf724";
7
+ var SANDBOX_IMAGE_URI = sandboxImage_default.uri;
3
8
  export {
4
9
  SANDBOX_IMAGE_URI
5
10
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/sandbox/sandboxImage.ts"],"sourcesContent":["/**\n * Release-owned sandbox image. In-memory for now; CI will later replace this\n * with the tag it pushes on each release.\n */\nexport const SANDBOX_IMAGE_URI = 'tfy.jfrog.io/tfy-images/trueforge-sandbox:ce9e802ff68514dfc6ff138ff81c8f26dbaaf724';\n"],"mappings":";AAIO,IAAM,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../src/core/sandbox/sandboxImage.json","../../../src/core/sandbox/sandboxImage.ts"],"sourcesContent":["{\n \"uri\": \"tfy.jfrog.io/tfy-images/trueforge-sandbox:0dab475d3d20a8333cff41f25f88e7134c424cf9\"\n}\n","import sandboxImage from './sandboxImage.json' with { type: 'json' };\n\n/** Release-owned sandbox image URI; CI rewrites `sandboxImage.json`. */\nexport const SANDBOX_IMAGE_URI = sandboxImage.uri;\n"],"mappings":";AAAA;AAAA,EACE,KAAO;AACT;;;ACCO,IAAM,oBAAoB,qBAAa;","names":[]}
@@ -0,0 +1,26 @@
1
+ export interface SandboxRefParts {
2
+ /** Provider kind from `SandboxProvider.type` (e.g. `daytona`, `local`) — plain string, not a closed union. */
3
+ providerType: string;
4
+ rawId: string;
5
+ }
6
+ /** `v1:type:raw` — raw may contain `:` (split only on the first two colons after version). */
7
+ export declare function formatSandboxId(parts: SandboxRefParts): string;
8
+ /**
9
+ * Parse a fancy id. No `v1:` prefix, or a malformed `v1:` (too few segments),
10
+ * → `{ kind: 'legacy', rawId: fullString }` so carry-forward stays safe.
11
+ */
12
+ export declare function parseSandboxId(sandboxId: string): {
13
+ kind: 'v1';
14
+ parts: SandboxRefParts;
15
+ } | {
16
+ kind: 'legacy';
17
+ rawId: string;
18
+ };
19
+ /** Raw id for provider calls. Legacy ids pass through unchanged. */
20
+ export declare function rawSandboxId(sandboxId: string): string;
21
+ /** Carry-forward gate for turn admit / download. Type mismatch drops the id (create fresh). */
22
+ export declare function existingSandboxIdForProvider(params: {
23
+ existingSandboxId: string | undefined;
24
+ currentProviderType: string;
25
+ }): string | undefined;
26
+ //# sourceMappingURL=sandboxRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandboxRef.d.ts","sourceRoot":"","sources":["../../../src/core/sandbox/sandboxRef.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,8GAA8G;IAC9G,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAKD,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAE9D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAa5E;AAED,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,+FAA+F;AAC/F,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,mBAAmB,EAAE,MAAM,CAAC;CAC7B,GAAG,MAAM,GAAG,SAAS,CASrB"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/core/sandbox/sandboxRef.ts
21
+ var sandboxRef_exports = {};
22
+ __export(sandboxRef_exports, {
23
+ existingSandboxIdForProvider: () => existingSandboxIdForProvider,
24
+ formatSandboxId: () => formatSandboxId,
25
+ parseSandboxId: () => parseSandboxId,
26
+ rawSandboxId: () => rawSandboxId
27
+ });
28
+ module.exports = __toCommonJS(sandboxRef_exports);
29
+ var SANDBOX_ID_VERSION = "v1";
30
+ var SANDBOX_ID_PREFIX = `${SANDBOX_ID_VERSION}:`;
31
+ function formatSandboxId(parts) {
32
+ return `${SANDBOX_ID_PREFIX}${parts.providerType}:${parts.rawId}`;
33
+ }
34
+ function parseSandboxId(sandboxId) {
35
+ if (!sandboxId.startsWith(SANDBOX_ID_PREFIX)) {
36
+ return { kind: "legacy", rawId: sandboxId };
37
+ }
38
+ const rest = sandboxId.slice(SANDBOX_ID_PREFIX.length);
39
+ const colon = rest.indexOf(":");
40
+ if (colon <= 0 || colon === rest.length - 1) {
41
+ return { kind: "legacy", rawId: sandboxId };
42
+ }
43
+ return {
44
+ kind: "v1",
45
+ parts: { providerType: rest.slice(0, colon), rawId: rest.slice(colon + 1) }
46
+ };
47
+ }
48
+ function rawSandboxId(sandboxId) {
49
+ const parsed = parseSandboxId(sandboxId);
50
+ return parsed.kind === "v1" ? parsed.parts.rawId : parsed.rawId;
51
+ }
52
+ function existingSandboxIdForProvider(params) {
53
+ if (params.existingSandboxId === void 0) {
54
+ return void 0;
55
+ }
56
+ const parsed = parseSandboxId(params.existingSandboxId);
57
+ if (parsed.kind === "v1" && parsed.parts.providerType !== params.currentProviderType) {
58
+ return void 0;
59
+ }
60
+ return params.existingSandboxId;
61
+ }
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ existingSandboxIdForProvider,
65
+ formatSandboxId,
66
+ parseSandboxId,
67
+ rawSandboxId
68
+ });
69
+ //# sourceMappingURL=sandboxRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/sandbox/sandboxRef.ts"],"sourcesContent":["export interface SandboxRefParts {\n /** Provider kind from `SandboxProvider.type` (e.g. `daytona`, `local`) — plain string, not a closed union. */\n providerType: string;\n rawId: string;\n}\n\nconst SANDBOX_ID_VERSION = 'v1';\nconst SANDBOX_ID_PREFIX = `${SANDBOX_ID_VERSION}:`;\n\n/** `v1:type:raw` — raw may contain `:` (split only on the first two colons after version). */\nexport function formatSandboxId(parts: SandboxRefParts): string {\n return `${SANDBOX_ID_PREFIX}${parts.providerType}:${parts.rawId}`;\n}\n\n/**\n * Parse a fancy id. No `v1:` prefix, or a malformed `v1:` (too few segments),\n * → `{ kind: 'legacy', rawId: fullString }` so carry-forward stays safe.\n */\nexport function parseSandboxId(\n sandboxId: string,\n): { kind: 'v1'; parts: SandboxRefParts } | { kind: 'legacy'; rawId: string } {\n if (!sandboxId.startsWith(SANDBOX_ID_PREFIX)) {\n return { kind: 'legacy', rawId: sandboxId };\n }\n const rest = sandboxId.slice(SANDBOX_ID_PREFIX.length);\n const colon = rest.indexOf(':');\n if (colon <= 0 || colon === rest.length - 1) {\n return { kind: 'legacy', rawId: sandboxId };\n }\n return {\n kind: 'v1',\n parts: { providerType: rest.slice(0, colon), rawId: rest.slice(colon + 1) },\n };\n}\n\n/** Raw id for provider calls. Legacy ids pass through unchanged. */\nexport function rawSandboxId(sandboxId: string): string {\n const parsed = parseSandboxId(sandboxId);\n return parsed.kind === 'v1' ? parsed.parts.rawId : parsed.rawId;\n}\n\n/** Carry-forward gate for turn admit / download. Type mismatch drops the id (create fresh). */\nexport function existingSandboxIdForProvider(params: {\n existingSandboxId: string | undefined;\n currentProviderType: string;\n}): string | undefined {\n if (params.existingSandboxId === undefined) {\n return undefined;\n }\n const parsed = parseSandboxId(params.existingSandboxId);\n if (parsed.kind === 'v1' && parsed.parts.providerType !== params.currentProviderType) {\n return undefined;\n }\n return params.existingSandboxId;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB,GAAG,kBAAkB;AAGxC,SAAS,gBAAgB,OAAgC;AAC9D,SAAO,GAAG,iBAAiB,GAAG,MAAM,YAAY,IAAI,MAAM,KAAK;AACjE;AAMO,SAAS,eACd,WAC4E;AAC5E,MAAI,CAAC,UAAU,WAAW,iBAAiB,GAAG;AAC5C,WAAO,EAAE,MAAM,UAAU,OAAO,UAAU;AAAA,EAC5C;AACA,QAAM,OAAO,UAAU,MAAM,kBAAkB,MAAM;AACrD,QAAM,QAAQ,KAAK,QAAQ,GAAG;AAC9B,MAAI,SAAS,KAAK,UAAU,KAAK,SAAS,GAAG;AAC3C,WAAO,EAAE,MAAM,UAAU,OAAO,UAAU;AAAA,EAC5C;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO,EAAE,cAAc,KAAK,MAAM,GAAG,KAAK,GAAG,OAAO,KAAK,MAAM,QAAQ,CAAC,EAAE;AAAA,EAC5E;AACF;AAGO,SAAS,aAAa,WAA2B;AACtD,QAAM,SAAS,eAAe,SAAS;AACvC,SAAO,OAAO,SAAS,OAAO,OAAO,MAAM,QAAQ,OAAO;AAC5D;AAGO,SAAS,6BAA6B,QAGtB;AACrB,MAAI,OAAO,sBAAsB,QAAW;AAC1C,WAAO;AAAA,EACT;AACA,QAAM,SAAS,eAAe,OAAO,iBAAiB;AACtD,MAAI,OAAO,SAAS,QAAQ,OAAO,MAAM,iBAAiB,OAAO,qBAAqB;AACpF,WAAO;AAAA,EACT;AACA,SAAO,OAAO;AAChB;","names":[]}
@@ -0,0 +1,41 @@
1
+ // src/core/sandbox/sandboxRef.ts
2
+ var SANDBOX_ID_VERSION = "v1";
3
+ var SANDBOX_ID_PREFIX = `${SANDBOX_ID_VERSION}:`;
4
+ function formatSandboxId(parts) {
5
+ return `${SANDBOX_ID_PREFIX}${parts.providerType}:${parts.rawId}`;
6
+ }
7
+ function parseSandboxId(sandboxId) {
8
+ if (!sandboxId.startsWith(SANDBOX_ID_PREFIX)) {
9
+ return { kind: "legacy", rawId: sandboxId };
10
+ }
11
+ const rest = sandboxId.slice(SANDBOX_ID_PREFIX.length);
12
+ const colon = rest.indexOf(":");
13
+ if (colon <= 0 || colon === rest.length - 1) {
14
+ return { kind: "legacy", rawId: sandboxId };
15
+ }
16
+ return {
17
+ kind: "v1",
18
+ parts: { providerType: rest.slice(0, colon), rawId: rest.slice(colon + 1) }
19
+ };
20
+ }
21
+ function rawSandboxId(sandboxId) {
22
+ const parsed = parseSandboxId(sandboxId);
23
+ return parsed.kind === "v1" ? parsed.parts.rawId : parsed.rawId;
24
+ }
25
+ function existingSandboxIdForProvider(params) {
26
+ if (params.existingSandboxId === void 0) {
27
+ return void 0;
28
+ }
29
+ const parsed = parseSandboxId(params.existingSandboxId);
30
+ if (parsed.kind === "v1" && parsed.parts.providerType !== params.currentProviderType) {
31
+ return void 0;
32
+ }
33
+ return params.existingSandboxId;
34
+ }
35
+ export {
36
+ existingSandboxIdForProvider,
37
+ formatSandboxId,
38
+ parseSandboxId,
39
+ rawSandboxId
40
+ };
41
+ //# sourceMappingURL=sandboxRef.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/sandbox/sandboxRef.ts"],"sourcesContent":["export interface SandboxRefParts {\n /** Provider kind from `SandboxProvider.type` (e.g. `daytona`, `local`) — plain string, not a closed union. */\n providerType: string;\n rawId: string;\n}\n\nconst SANDBOX_ID_VERSION = 'v1';\nconst SANDBOX_ID_PREFIX = `${SANDBOX_ID_VERSION}:`;\n\n/** `v1:type:raw` — raw may contain `:` (split only on the first two colons after version). */\nexport function formatSandboxId(parts: SandboxRefParts): string {\n return `${SANDBOX_ID_PREFIX}${parts.providerType}:${parts.rawId}`;\n}\n\n/**\n * Parse a fancy id. No `v1:` prefix, or a malformed `v1:` (too few segments),\n * → `{ kind: 'legacy', rawId: fullString }` so carry-forward stays safe.\n */\nexport function parseSandboxId(\n sandboxId: string,\n): { kind: 'v1'; parts: SandboxRefParts } | { kind: 'legacy'; rawId: string } {\n if (!sandboxId.startsWith(SANDBOX_ID_PREFIX)) {\n return { kind: 'legacy', rawId: sandboxId };\n }\n const rest = sandboxId.slice(SANDBOX_ID_PREFIX.length);\n const colon = rest.indexOf(':');\n if (colon <= 0 || colon === rest.length - 1) {\n return { kind: 'legacy', rawId: sandboxId };\n }\n return {\n kind: 'v1',\n parts: { providerType: rest.slice(0, colon), rawId: rest.slice(colon + 1) },\n };\n}\n\n/** Raw id for provider calls. Legacy ids pass through unchanged. */\nexport function rawSandboxId(sandboxId: string): string {\n const parsed = parseSandboxId(sandboxId);\n return parsed.kind === 'v1' ? parsed.parts.rawId : parsed.rawId;\n}\n\n/** Carry-forward gate for turn admit / download. Type mismatch drops the id (create fresh). */\nexport function existingSandboxIdForProvider(params: {\n existingSandboxId: string | undefined;\n currentProviderType: string;\n}): string | undefined {\n if (params.existingSandboxId === undefined) {\n return undefined;\n }\n const parsed = parseSandboxId(params.existingSandboxId);\n if (parsed.kind === 'v1' && parsed.parts.providerType !== params.currentProviderType) {\n return undefined;\n }\n return params.existingSandboxId;\n}\n"],"mappings":";AAMA,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB,GAAG,kBAAkB;AAGxC,SAAS,gBAAgB,OAAgC;AAC9D,SAAO,GAAG,iBAAiB,GAAG,MAAM,YAAY,IAAI,MAAM,KAAK;AACjE;AAMO,SAAS,eACd,WAC4E;AAC5E,MAAI,CAAC,UAAU,WAAW,iBAAiB,GAAG;AAC5C,WAAO,EAAE,MAAM,UAAU,OAAO,UAAU;AAAA,EAC5C;AACA,QAAM,OAAO,UAAU,MAAM,kBAAkB,MAAM;AACrD,QAAM,QAAQ,KAAK,QAAQ,GAAG;AAC9B,MAAI,SAAS,KAAK,UAAU,KAAK,SAAS,GAAG;AAC3C,WAAO,EAAE,MAAM,UAAU,OAAO,UAAU;AAAA,EAC5C;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO,EAAE,cAAc,KAAK,MAAM,GAAG,KAAK,GAAG,OAAO,KAAK,MAAM,QAAQ,CAAC,EAAE;AAAA,EAC5E;AACF;AAGO,SAAS,aAAa,WAA2B;AACtD,QAAM,SAAS,eAAe,SAAS;AACvC,SAAO,OAAO,SAAS,OAAO,OAAO,MAAM,QAAQ,OAAO;AAC5D;AAGO,SAAS,6BAA6B,QAGtB;AACrB,MAAI,OAAO,sBAAsB,QAAW;AAC1C,WAAO;AAAA,EACT;AACA,QAAM,SAAS,eAAe,OAAO,iBAAiB;AACtD,MAAI,OAAO,SAAS,QAAQ,OAAO,MAAM,iBAAiB,OAAO,qBAAqB;AACpF,WAAO;AAAA,EACT;AACA,SAAO,OAAO;AAChB;","names":[]}
@@ -1,7 +1,12 @@
1
1
  import type { InstructionBuilder } from '../../InstructionBuilder';
2
2
  import type { SandboxInit } from '../provider/Provider';
3
3
  export interface ISkillMounter {
4
- instruction(builder: InstructionBuilder): void;
5
- getSandboxInit(): SandboxInit;
4
+ instruction(builder: InstructionBuilder, paths: {
5
+ skillsDir: string;
6
+ }): void;
7
+ getSandboxInit(paths: {
8
+ skillsDir: string;
9
+ gitDownloaderPath: string;
10
+ }): SandboxInit;
6
11
  }
7
12
  //# sourceMappingURL=ISkillMounter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISkillMounter.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/ISkillMounter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,MAAM,WAAW,aAAa;IAE5B,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAE/C,cAAc,IAAI,WAAW,CAAC;CAC/B"}
1
+ {"version":3,"file":"ISkillMounter.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/ISkillMounter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,MAAM,WAAW,aAAa;IAE5B,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAE7E,cAAc,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAA;KAAE,GAAG,WAAW,CAAC;CACtF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/sandbox/skills/ISkillMounter.ts"],"sourcesContent":["import type { InstructionBuilder } from '../../InstructionBuilder';\nimport type { SandboxInit } from '../provider/Provider';\n\n// A set of skills that describes itself in the prompt and installs itself into a sandbox. The sandbox\n// holds one mounter and never inspects individual skills.\nexport interface ISkillMounter {\n // Renders the <skills> section; adds nothing when empty, so InstructionBuilder drops the section.\n instruction(builder: InstructionBuilder): void;\n // The command (+ env, timeout) that installs these skills; Sandbox folds it into its init exec.\n getSandboxInit(): SandboxInit;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/sandbox/skills/ISkillMounter.ts"],"sourcesContent":["import type { InstructionBuilder } from '../../InstructionBuilder';\nimport type { SandboxInit } from '../provider/Provider';\n\n// A set of skills that describes itself in the prompt and installs itself into a sandbox. The sandbox\n// holds one mounter and never inspects individual skills.\nexport interface ISkillMounter {\n // Renders the <skills> section; adds nothing when empty, so InstructionBuilder drops the section.\n instruction(builder: InstructionBuilder, paths: { skillsDir: string }): void;\n // The command (+ env, timeout) that installs these skills; Sandbox folds it into its init exec.\n getSandboxInit(paths: { skillsDir: string; gitDownloaderPath: string }): SandboxInit;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -11,7 +11,12 @@ export interface GitSkill {
11
11
  export declare class SkillMounter implements ISkillMounter {
12
12
  private readonly skills;
13
13
  constructor(skills: readonly GitSkill[]);
14
- instruction(builder: InstructionBuilder): void;
15
- getSandboxInit(): SandboxInit;
14
+ instruction(builder: InstructionBuilder, paths: {
15
+ skillsDir: string;
16
+ }): void;
17
+ getSandboxInit(paths: {
18
+ skillsDir: string;
19
+ gitDownloaderPath: string;
20
+ }): SandboxInit;
16
21
  }
17
22
  //# sourceMappingURL=SkillMounter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SkillMounter.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/SkillMounter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAUD,qBAAa,YAAa,YAAW,aAAa;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAE7C,YAAY,MAAM,EAAE,SAAS,QAAQ,EAAE,EAEtC;IAED,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAgB7C;IAED,cAAc,IAAI,WAAW,CAkB5B;CACF"}
1
+ {"version":3,"file":"SkillMounter.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/SkillMounter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMrD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAUD,qBAAa,YAAa,YAAW,aAAa;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAE7C,YAAY,MAAM,EAAE,SAAS,QAAQ,EAAE,EAEtC;IAED,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAgB3E;IAED,cAAc,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAA;KAAE,GAAG,WAAW,CAkBnF;CACF"}
@@ -26,13 +26,12 @@ module.exports = __toCommonJS(SkillMounter_exports);
26
26
  var import_Sandbox = require("../Sandbox.js");
27
27
  var import_sandboxScripts = require("../sandboxScripts.gen.js");
28
28
  var import_constants = require("./constants.js");
29
- var GIT_DOWNLOADER_PATH = "/opt/tfy/git_downloader.py";
30
29
  var SkillMounter = class {
31
30
  skills;
32
31
  constructor(skills) {
33
32
  this.skills = skills;
34
33
  }
35
- instruction(builder) {
34
+ instruction(builder, paths) {
36
35
  if (this.skills.length === 0) {
37
36
  return;
38
37
  }
@@ -41,7 +40,7 @@ var SkillMounter = class {
41
40
  builder.addSection(
42
41
  "skill",
43
42
  (0, import_constants.renderSkillPromptBody)({
44
- path: (0, import_constants.getSkillPath)(skill.name),
43
+ path: (0, import_constants.getSkillPath)({ skillsDir: paths.skillsDir, skillName: skill.name }),
45
44
  name: skill.name,
46
45
  description: skill.description,
47
46
  preloadContent: null
@@ -49,7 +48,7 @@ var SkillMounter = class {
49
48
  );
50
49
  }
51
50
  }
52
- getSandboxInit() {
51
+ getSandboxInit(paths) {
53
52
  const specs = this.skills.map((skill) => ({
54
53
  name: skill.name,
55
54
  url: skill.url,
@@ -59,11 +58,11 @@ var SkillMounter = class {
59
58
  const gitSkillsB64 = Buffer.from(JSON.stringify(specs)).toString("base64");
60
59
  return {
61
60
  command: (0, import_Sandbox.buildWriteAndRunScriptCommand)({
62
- scriptPath: GIT_DOWNLOADER_PATH,
61
+ scriptPath: paths.gitDownloaderPath,
63
62
  // Bundled at build time (sandboxScripts.gen.ts) so the packaged library has no loose files.
64
63
  scriptContent: import_sandboxScripts.sandboxScripts.gitDownloader
65
64
  }),
66
- env: { AGENT_GIT_SKILLS: gitSkillsB64 },
65
+ env: { AGENT_GIT_SKILLS: gitSkillsB64, TFY_SKILLS_DIR: paths.skillsDir },
67
66
  timeoutSeconds: import_Sandbox.SKILL_DOWNLOAD_TIMEOUT_SECONDS
68
67
  };
69
68
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/sandbox/skills/SkillMounter.ts"],"sourcesContent":["import type { InstructionBuilder } from '../../InstructionBuilder';\nimport type { SandboxInit } from '../provider/Provider';\nimport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, buildWriteAndRunScriptCommand } from '../Sandbox';\nimport { sandboxScripts } from '../sandboxScripts.gen';\nimport { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nimport type { ISkillMounter } from './ISkillMounter';\n\n// Absolute path the git skill downloader script is uploaded to before it is run.\nconst GIT_DOWNLOADER_PATH = '/opt/tfy/git_downloader.py';\n\n// A git-sourced skill materialized by a sparse clone in the sandbox (git_downloader.py). Git skills\n// never preload — their SKILL.md is read from disk at runtime (only name/description/path are\n// advertised in the prompt). Wire fields match the agent_spec git mount (`url`/`path`/`name`/`ref`);\n// the downloader resolves `ref` inside the sandbox before fetching.\nexport interface GitSkill {\n readonly name: string;\n readonly description: string;\n // Canonical https clone URL of the github.com/gitlab.com repo (host-validated by the caller).\n readonly url: string;\n // Subdirectory within the repo that holds the skill (empty = repo root).\n readonly path: string;\n // Branch, tag, or full object id — resolved and fetched by git_downloader.py in the sandbox.\n readonly ref: string;\n}\n\n// Serializable descriptor handed to git_downloader.py (base64 JSON); keys match its GitSkill model.\ninterface GitSkillSpec {\n name: string;\n url: string;\n path: string;\n ref: string;\n}\n\nexport class SkillMounter implements ISkillMounter {\n private readonly skills: readonly GitSkill[];\n\n constructor(skills: readonly GitSkill[]) {\n this.skills = skills;\n }\n\n instruction(builder: InstructionBuilder): void {\n if (this.skills.length === 0) {\n return;\n }\n builder.addContent(SKILLS_PREAMBLE);\n for (const skill of this.skills) {\n builder.addSection(\n 'skill',\n renderSkillPromptBody({\n path: getSkillPath(skill.name),\n name: skill.name,\n description: skill.description,\n preloadContent: null,\n }),\n );\n }\n }\n\n getSandboxInit(): SandboxInit {\n // An empty desired set is also the source-neutral cleanup path for a reused sandbox.\n const specs: GitSkillSpec[] = this.skills.map(skill => ({\n name: skill.name,\n url: skill.url,\n path: skill.path,\n ref: skill.ref,\n }));\n const gitSkillsB64 = Buffer.from(JSON.stringify(specs)).toString('base64');\n return {\n command: buildWriteAndRunScriptCommand({\n scriptPath: GIT_DOWNLOADER_PATH,\n // Bundled at build time (sandboxScripts.gen.ts) so the packaged library has no loose files.\n scriptContent: sandboxScripts.gitDownloader,\n }),\n env: { AGENT_GIT_SKILLS: gitSkillsB64 },\n timeoutSeconds: SKILL_DOWNLOAD_TIMEOUT_SECONDS,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAA8E;AAC9E,4BAA+B;AAC/B,uBAAqE;AAIrE,IAAM,sBAAsB;AAyBrB,IAAM,eAAN,MAA4C;AAAA,EAChC;AAAA,EAEjB,YAAY,QAA6B;AACvC,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,YAAY,SAAmC;AAC7C,QAAI,KAAK,OAAO,WAAW,GAAG;AAC5B;AAAA,IACF;AACA,YAAQ,WAAW,gCAAe;AAClC,eAAW,SAAS,KAAK,QAAQ;AAC/B,cAAQ;AAAA,QACN;AAAA,YACA,wCAAsB;AAAA,UACpB,UAAM,+BAAa,MAAM,IAAI;AAAA,UAC7B,MAAM,MAAM;AAAA,UACZ,aAAa,MAAM;AAAA,UACnB,gBAAgB;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAA8B;AAE5B,UAAM,QAAwB,KAAK,OAAO,IAAI,YAAU;AAAA,MACtD,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,MACX,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,IACb,EAAE;AACF,UAAM,eAAe,OAAO,KAAK,KAAK,UAAU,KAAK,CAAC,EAAE,SAAS,QAAQ;AACzE,WAAO;AAAA,MACL,aAAS,8CAA8B;AAAA,QACrC,YAAY;AAAA;AAAA,QAEZ,eAAe,qCAAe;AAAA,MAChC,CAAC;AAAA,MACD,KAAK,EAAE,kBAAkB,aAAa;AAAA,MACtC,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/sandbox/skills/SkillMounter.ts"],"sourcesContent":["import type { InstructionBuilder } from '../../InstructionBuilder';\nimport type { SandboxInit } from '../provider/Provider';\nimport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, buildWriteAndRunScriptCommand } from '../Sandbox';\nimport { sandboxScripts } from '../sandboxScripts.gen';\nimport { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nimport type { ISkillMounter } from './ISkillMounter';\n\n// A git-sourced skill materialized by a sparse clone in the sandbox (git_downloader.py). Git skills\n// never preload — their SKILL.md is read from disk at runtime (only name/description/path are\n// advertised in the prompt). Wire fields match the agent_spec git mount (`url`/`path`/`name`/`ref`);\n// the downloader resolves `ref` inside the sandbox before fetching.\nexport interface GitSkill {\n readonly name: string;\n readonly description: string;\n // Canonical https clone URL of the github.com/gitlab.com repo (host-validated by the caller).\n readonly url: string;\n // Subdirectory within the repo that holds the skill (empty = repo root).\n readonly path: string;\n // Branch, tag, or full object id — resolved and fetched by git_downloader.py in the sandbox.\n readonly ref: string;\n}\n\n// Serializable descriptor handed to git_downloader.py (base64 JSON); keys match its GitSkill model.\ninterface GitSkillSpec {\n name: string;\n url: string;\n path: string;\n ref: string;\n}\n\nexport class SkillMounter implements ISkillMounter {\n private readonly skills: readonly GitSkill[];\n\n constructor(skills: readonly GitSkill[]) {\n this.skills = skills;\n }\n\n instruction(builder: InstructionBuilder, paths: { skillsDir: string }): void {\n if (this.skills.length === 0) {\n return;\n }\n builder.addContent(SKILLS_PREAMBLE);\n for (const skill of this.skills) {\n builder.addSection(\n 'skill',\n renderSkillPromptBody({\n path: getSkillPath({ skillsDir: paths.skillsDir, skillName: skill.name }),\n name: skill.name,\n description: skill.description,\n preloadContent: null,\n }),\n );\n }\n }\n\n getSandboxInit(paths: { skillsDir: string; gitDownloaderPath: string }): SandboxInit {\n // An empty desired set is also the source-neutral cleanup path for a reused sandbox.\n const specs: GitSkillSpec[] = this.skills.map(skill => ({\n name: skill.name,\n url: skill.url,\n path: skill.path,\n ref: skill.ref,\n }));\n const gitSkillsB64 = Buffer.from(JSON.stringify(specs)).toString('base64');\n return {\n command: buildWriteAndRunScriptCommand({\n scriptPath: paths.gitDownloaderPath,\n // Bundled at build time (sandboxScripts.gen.ts) so the packaged library has no loose files.\n scriptContent: sandboxScripts.gitDownloader,\n }),\n env: { AGENT_GIT_SKILLS: gitSkillsB64, TFY_SKILLS_DIR: paths.skillsDir },\n timeoutSeconds: SKILL_DOWNLOAD_TIMEOUT_SECONDS,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAA8E;AAC9E,4BAA+B;AAC/B,uBAAqE;AA0B9D,IAAM,eAAN,MAA4C;AAAA,EAChC;AAAA,EAEjB,YAAY,QAA6B;AACvC,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,YAAY,SAA6B,OAAoC;AAC3E,QAAI,KAAK,OAAO,WAAW,GAAG;AAC5B;AAAA,IACF;AACA,YAAQ,WAAW,gCAAe;AAClC,eAAW,SAAS,KAAK,QAAQ;AAC/B,cAAQ;AAAA,QACN;AAAA,YACA,wCAAsB;AAAA,UACpB,UAAM,+BAAa,EAAE,WAAW,MAAM,WAAW,WAAW,MAAM,KAAK,CAAC;AAAA,UACxE,MAAM,MAAM;AAAA,UACZ,aAAa,MAAM;AAAA,UACnB,gBAAgB;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EAEA,eAAe,OAAsE;AAEnF,UAAM,QAAwB,KAAK,OAAO,IAAI,YAAU;AAAA,MACtD,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,MACX,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,IACb,EAAE;AACF,UAAM,eAAe,OAAO,KAAK,KAAK,UAAU,KAAK,CAAC,EAAE,SAAS,QAAQ;AACzE,WAAO;AAAA,MACL,aAAS,8CAA8B;AAAA,QACrC,YAAY,MAAM;AAAA;AAAA,QAElB,eAAe,qCAAe;AAAA,MAChC,CAAC;AAAA,MACD,KAAK,EAAE,kBAAkB,cAAc,gBAAgB,MAAM,UAAU;AAAA,MACvE,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF;","names":[]}
@@ -2,13 +2,12 @@
2
2
  import { SKILL_DOWNLOAD_TIMEOUT_SECONDS, buildWriteAndRunScriptCommand } from "../Sandbox.mjs";
3
3
  import { sandboxScripts } from "../sandboxScripts.gen.mjs";
4
4
  import { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from "./constants.mjs";
5
- var GIT_DOWNLOADER_PATH = "/opt/tfy/git_downloader.py";
6
5
  var SkillMounter = class {
7
6
  skills;
8
7
  constructor(skills) {
9
8
  this.skills = skills;
10
9
  }
11
- instruction(builder) {
10
+ instruction(builder, paths) {
12
11
  if (this.skills.length === 0) {
13
12
  return;
14
13
  }
@@ -17,7 +16,7 @@ var SkillMounter = class {
17
16
  builder.addSection(
18
17
  "skill",
19
18
  renderSkillPromptBody({
20
- path: getSkillPath(skill.name),
19
+ path: getSkillPath({ skillsDir: paths.skillsDir, skillName: skill.name }),
21
20
  name: skill.name,
22
21
  description: skill.description,
23
22
  preloadContent: null
@@ -25,7 +24,7 @@ var SkillMounter = class {
25
24
  );
26
25
  }
27
26
  }
28
- getSandboxInit() {
27
+ getSandboxInit(paths) {
29
28
  const specs = this.skills.map((skill) => ({
30
29
  name: skill.name,
31
30
  url: skill.url,
@@ -35,11 +34,11 @@ var SkillMounter = class {
35
34
  const gitSkillsB64 = Buffer.from(JSON.stringify(specs)).toString("base64");
36
35
  return {
37
36
  command: buildWriteAndRunScriptCommand({
38
- scriptPath: GIT_DOWNLOADER_PATH,
37
+ scriptPath: paths.gitDownloaderPath,
39
38
  // Bundled at build time (sandboxScripts.gen.ts) so the packaged library has no loose files.
40
39
  scriptContent: sandboxScripts.gitDownloader
41
40
  }),
42
- env: { AGENT_GIT_SKILLS: gitSkillsB64 },
41
+ env: { AGENT_GIT_SKILLS: gitSkillsB64, TFY_SKILLS_DIR: paths.skillsDir },
43
42
  timeoutSeconds: SKILL_DOWNLOAD_TIMEOUT_SECONDS
44
43
  };
45
44
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/sandbox/skills/SkillMounter.ts"],"sourcesContent":["import type { InstructionBuilder } from '../../InstructionBuilder';\nimport type { SandboxInit } from '../provider/Provider';\nimport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, buildWriteAndRunScriptCommand } from '../Sandbox';\nimport { sandboxScripts } from '../sandboxScripts.gen';\nimport { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nimport type { ISkillMounter } from './ISkillMounter';\n\n// Absolute path the git skill downloader script is uploaded to before it is run.\nconst GIT_DOWNLOADER_PATH = '/opt/tfy/git_downloader.py';\n\n// A git-sourced skill materialized by a sparse clone in the sandbox (git_downloader.py). Git skills\n// never preload — their SKILL.md is read from disk at runtime (only name/description/path are\n// advertised in the prompt). Wire fields match the agent_spec git mount (`url`/`path`/`name`/`ref`);\n// the downloader resolves `ref` inside the sandbox before fetching.\nexport interface GitSkill {\n readonly name: string;\n readonly description: string;\n // Canonical https clone URL of the github.com/gitlab.com repo (host-validated by the caller).\n readonly url: string;\n // Subdirectory within the repo that holds the skill (empty = repo root).\n readonly path: string;\n // Branch, tag, or full object id — resolved and fetched by git_downloader.py in the sandbox.\n readonly ref: string;\n}\n\n// Serializable descriptor handed to git_downloader.py (base64 JSON); keys match its GitSkill model.\ninterface GitSkillSpec {\n name: string;\n url: string;\n path: string;\n ref: string;\n}\n\nexport class SkillMounter implements ISkillMounter {\n private readonly skills: readonly GitSkill[];\n\n constructor(skills: readonly GitSkill[]) {\n this.skills = skills;\n }\n\n instruction(builder: InstructionBuilder): void {\n if (this.skills.length === 0) {\n return;\n }\n builder.addContent(SKILLS_PREAMBLE);\n for (const skill of this.skills) {\n builder.addSection(\n 'skill',\n renderSkillPromptBody({\n path: getSkillPath(skill.name),\n name: skill.name,\n description: skill.description,\n preloadContent: null,\n }),\n );\n }\n }\n\n getSandboxInit(): SandboxInit {\n // An empty desired set is also the source-neutral cleanup path for a reused sandbox.\n const specs: GitSkillSpec[] = this.skills.map(skill => ({\n name: skill.name,\n url: skill.url,\n path: skill.path,\n ref: skill.ref,\n }));\n const gitSkillsB64 = Buffer.from(JSON.stringify(specs)).toString('base64');\n return {\n command: buildWriteAndRunScriptCommand({\n scriptPath: GIT_DOWNLOADER_PATH,\n // Bundled at build time (sandboxScripts.gen.ts) so the packaged library has no loose files.\n scriptContent: sandboxScripts.gitDownloader,\n }),\n env: { AGENT_GIT_SKILLS: gitSkillsB64 },\n timeoutSeconds: SKILL_DOWNLOAD_TIMEOUT_SECONDS,\n };\n }\n}\n"],"mappings":";AAEA,SAAS,gCAAgC,qCAAqC;AAC9E,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB,cAAc,6BAA6B;AAIrE,IAAM,sBAAsB;AAyBrB,IAAM,eAAN,MAA4C;AAAA,EAChC;AAAA,EAEjB,YAAY,QAA6B;AACvC,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,YAAY,SAAmC;AAC7C,QAAI,KAAK,OAAO,WAAW,GAAG;AAC5B;AAAA,IACF;AACA,YAAQ,WAAW,eAAe;AAClC,eAAW,SAAS,KAAK,QAAQ;AAC/B,cAAQ;AAAA,QACN;AAAA,QACA,sBAAsB;AAAA,UACpB,MAAM,aAAa,MAAM,IAAI;AAAA,UAC7B,MAAM,MAAM;AAAA,UACZ,aAAa,MAAM;AAAA,UACnB,gBAAgB;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAA8B;AAE5B,UAAM,QAAwB,KAAK,OAAO,IAAI,YAAU;AAAA,MACtD,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,MACX,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,IACb,EAAE;AACF,UAAM,eAAe,OAAO,KAAK,KAAK,UAAU,KAAK,CAAC,EAAE,SAAS,QAAQ;AACzE,WAAO;AAAA,MACL,SAAS,8BAA8B;AAAA,QACrC,YAAY;AAAA;AAAA,QAEZ,eAAe,eAAe;AAAA,MAChC,CAAC;AAAA,MACD,KAAK,EAAE,kBAAkB,aAAa;AAAA,MACtC,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/sandbox/skills/SkillMounter.ts"],"sourcesContent":["import type { InstructionBuilder } from '../../InstructionBuilder';\nimport type { SandboxInit } from '../provider/Provider';\nimport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, buildWriteAndRunScriptCommand } from '../Sandbox';\nimport { sandboxScripts } from '../sandboxScripts.gen';\nimport { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nimport type { ISkillMounter } from './ISkillMounter';\n\n// A git-sourced skill materialized by a sparse clone in the sandbox (git_downloader.py). Git skills\n// never preload — their SKILL.md is read from disk at runtime (only name/description/path are\n// advertised in the prompt). Wire fields match the agent_spec git mount (`url`/`path`/`name`/`ref`);\n// the downloader resolves `ref` inside the sandbox before fetching.\nexport interface GitSkill {\n readonly name: string;\n readonly description: string;\n // Canonical https clone URL of the github.com/gitlab.com repo (host-validated by the caller).\n readonly url: string;\n // Subdirectory within the repo that holds the skill (empty = repo root).\n readonly path: string;\n // Branch, tag, or full object id — resolved and fetched by git_downloader.py in the sandbox.\n readonly ref: string;\n}\n\n// Serializable descriptor handed to git_downloader.py (base64 JSON); keys match its GitSkill model.\ninterface GitSkillSpec {\n name: string;\n url: string;\n path: string;\n ref: string;\n}\n\nexport class SkillMounter implements ISkillMounter {\n private readonly skills: readonly GitSkill[];\n\n constructor(skills: readonly GitSkill[]) {\n this.skills = skills;\n }\n\n instruction(builder: InstructionBuilder, paths: { skillsDir: string }): void {\n if (this.skills.length === 0) {\n return;\n }\n builder.addContent(SKILLS_PREAMBLE);\n for (const skill of this.skills) {\n builder.addSection(\n 'skill',\n renderSkillPromptBody({\n path: getSkillPath({ skillsDir: paths.skillsDir, skillName: skill.name }),\n name: skill.name,\n description: skill.description,\n preloadContent: null,\n }),\n );\n }\n }\n\n getSandboxInit(paths: { skillsDir: string; gitDownloaderPath: string }): SandboxInit {\n // An empty desired set is also the source-neutral cleanup path for a reused sandbox.\n const specs: GitSkillSpec[] = this.skills.map(skill => ({\n name: skill.name,\n url: skill.url,\n path: skill.path,\n ref: skill.ref,\n }));\n const gitSkillsB64 = Buffer.from(JSON.stringify(specs)).toString('base64');\n return {\n command: buildWriteAndRunScriptCommand({\n scriptPath: paths.gitDownloaderPath,\n // Bundled at build time (sandboxScripts.gen.ts) so the packaged library has no loose files.\n scriptContent: sandboxScripts.gitDownloader,\n }),\n env: { AGENT_GIT_SKILLS: gitSkillsB64, TFY_SKILLS_DIR: paths.skillsDir },\n timeoutSeconds: SKILL_DOWNLOAD_TIMEOUT_SECONDS,\n };\n }\n}\n"],"mappings":";AAEA,SAAS,gCAAgC,qCAAqC;AAC9E,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB,cAAc,6BAA6B;AA0B9D,IAAM,eAAN,MAA4C;AAAA,EAChC;AAAA,EAEjB,YAAY,QAA6B;AACvC,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,YAAY,SAA6B,OAAoC;AAC3E,QAAI,KAAK,OAAO,WAAW,GAAG;AAC5B;AAAA,IACF;AACA,YAAQ,WAAW,eAAe;AAClC,eAAW,SAAS,KAAK,QAAQ;AAC/B,cAAQ;AAAA,QACN;AAAA,QACA,sBAAsB;AAAA,UACpB,MAAM,aAAa,EAAE,WAAW,MAAM,WAAW,WAAW,MAAM,KAAK,CAAC;AAAA,UACxE,MAAM,MAAM;AAAA,UACZ,aAAa,MAAM;AAAA,UACnB,gBAAgB;AAAA,QAClB,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EAEA,eAAe,OAAsE;AAEnF,UAAM,QAAwB,KAAK,OAAO,IAAI,YAAU;AAAA,MACtD,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,MACX,MAAM,MAAM;AAAA,MACZ,KAAK,MAAM;AAAA,IACb,EAAE;AACF,UAAM,eAAe,OAAO,KAAK,KAAK,UAAU,KAAK,CAAC,EAAE,SAAS,QAAQ;AACzE,WAAO;AAAA,MACL,SAAS,8BAA8B;AAAA,QACrC,YAAY,MAAM;AAAA;AAAA,QAElB,eAAe,eAAe;AAAA,MAChC,CAAC;AAAA,MACD,KAAK,EAAE,kBAAkB,cAAc,gBAAgB,MAAM,UAAU;AAAA,MACvE,gBAAgB;AAAA,IAClB;AAAA,EACF;AACF;","names":[]}
@@ -1,5 +1,7 @@
1
- export declare const SKILLS_DIR = "/opt/tfy/skills";
2
- export declare function getSkillPath(skillName: string): string;
1
+ export declare function getSkillPath(params: {
2
+ skillsDir: string;
3
+ skillName: string;
4
+ }): string;
3
5
  export declare const SKILLS_PREAMBLE: string;
4
6
  export declare function renderSkillPromptBody(params: {
5
7
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAG5C,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,eAAO,MAAM,eAAe,QAQhB,CAAC;AAGb,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,MAAM,CAIT"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/constants.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAErF;AAED,eAAO,MAAM,eAAe,QAQhB,CAAC;AAGb,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,MAAM,CAIT"}
@@ -20,15 +20,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/core/sandbox/skills/constants.ts
21
21
  var constants_exports = {};
22
22
  __export(constants_exports, {
23
- SKILLS_DIR: () => SKILLS_DIR,
24
23
  SKILLS_PREAMBLE: () => SKILLS_PREAMBLE,
25
24
  getSkillPath: () => getSkillPath,
26
25
  renderSkillPromptBody: () => renderSkillPromptBody
27
26
  });
28
27
  module.exports = __toCommonJS(constants_exports);
29
- var SKILLS_DIR = "/opt/tfy/skills";
30
- function getSkillPath(skillName) {
31
- return `${SKILLS_DIR}/${skillName}`;
28
+ function getSkillPath(params) {
29
+ return `${params.skillsDir.replace(/\/+$/, "")}/${params.skillName}`;
32
30
  }
33
31
  var SKILLS_PREAMBLE = [
34
32
  "1. The skill is present in the `path` directory.",
@@ -48,7 +46,6 @@ description: ${params.description}`;
48
46
  }
49
47
  // Annotate the CommonJS export names for ESM import in node:
50
48
  0 && (module.exports = {
51
- SKILLS_DIR,
52
49
  SKILLS_PREAMBLE,
53
50
  getSkillPath,
54
51
  renderSkillPromptBody
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/sandbox/skills/constants.ts"],"sourcesContent":["// Skill prompt constants and helpers: how skills are described to the agent in the system prompt.\n\n// Directory inside the sandbox where every skill (whatever its origin) is materialized.\nexport const SKILLS_DIR = '/opt/tfy/skills';\n\n// On-disk directory a skill is materialized into, keyed by its (unique) name.\nexport function getSkillPath(skillName: string): string {\n return `${SKILLS_DIR}/${skillName}`;\n}\n\nexport const SKILLS_PREAMBLE = [\n '1. The skill is present in the `path` directory.',\n '2. SKILL.md file within the directory is the primary file, there can be other files as well.',\n '3. Use `description` to judge whether the Agent needs to use a skill.',\n '4. To use a skill:',\n '4.a. If the `SKILL.md content` is inlined, the Agent must not read `path/SKILL.md`.',\n '4.b. Otherwise the Agent must read `path/SKILL.md` first.',\n '5. The Agent must avoid listing the `path` unless there are references in `SKILL.md` and there is reason to do so given the current conversation.',\n].join('\\n');\n\n// The <skill> block body: inline preloaded SKILL.md when present, else advertise path/name/description.\nexport function renderSkillPromptBody(params: {\n path: string;\n name: string;\n description: string;\n preloadContent: string | null;\n}): string {\n return params.preloadContent\n ? `path: ${params.path}\\nSKILL.md content:\\n${params.preloadContent}`\n : `path: ${params.path}\\nname: ${params.name}\\ndescription: ${params.description}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,aAAa;AAGnB,SAAS,aAAa,WAA2B;AACtD,SAAO,GAAG,UAAU,IAAI,SAAS;AACnC;AAEO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAGJ,SAAS,sBAAsB,QAK3B;AACT,SAAO,OAAO,iBACV,SAAS,OAAO,IAAI;AAAA;AAAA,EAAwB,OAAO,cAAc,KACjE,SAAS,OAAO,IAAI;AAAA,QAAW,OAAO,IAAI;AAAA,eAAkB,OAAO,WAAW;AACpF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/sandbox/skills/constants.ts"],"sourcesContent":["// Skill prompt constants and helpers: how skills are described to the agent in the system prompt.\n\n// On-disk directory a skill is materialized into, keyed by its (unique) name.\nexport function getSkillPath(params: { skillsDir: string; skillName: string }): string {\n return `${params.skillsDir.replace(/\\/+$/, '')}/${params.skillName}`;\n}\n\nexport const SKILLS_PREAMBLE = [\n '1. The skill is present in the `path` directory.',\n '2. SKILL.md file within the directory is the primary file, there can be other files as well.',\n '3. Use `description` to judge whether the Agent needs to use a skill.',\n '4. To use a skill:',\n '4.a. If the `SKILL.md content` is inlined, the Agent must not read `path/SKILL.md`.',\n '4.b. Otherwise the Agent must read `path/SKILL.md` first.',\n '5. The Agent must avoid listing the `path` unless there are references in `SKILL.md` and there is reason to do so given the current conversation.',\n].join('\\n');\n\n// The <skill> block body: inline preloaded SKILL.md when present, else advertise path/name/description.\nexport function renderSkillPromptBody(params: {\n path: string;\n name: string;\n description: string;\n preloadContent: string | null;\n}): string {\n return params.preloadContent\n ? `path: ${params.path}\\nSKILL.md content:\\n${params.preloadContent}`\n : `path: ${params.path}\\nname: ${params.name}\\ndescription: ${params.description}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,aAAa,QAA0D;AACrF,SAAO,GAAG,OAAO,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO,SAAS;AACpE;AAEO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAGJ,SAAS,sBAAsB,QAK3B;AACT,SAAO,OAAO,iBACV,SAAS,OAAO,IAAI;AAAA;AAAA,EAAwB,OAAO,cAAc,KACjE,SAAS,OAAO,IAAI;AAAA,QAAW,OAAO,IAAI;AAAA,eAAkB,OAAO,WAAW;AACpF;","names":[]}
@@ -1,7 +1,6 @@
1
1
  // src/core/sandbox/skills/constants.ts
2
- var SKILLS_DIR = "/opt/tfy/skills";
3
- function getSkillPath(skillName) {
4
- return `${SKILLS_DIR}/${skillName}`;
2
+ function getSkillPath(params) {
3
+ return `${params.skillsDir.replace(/\/+$/, "")}/${params.skillName}`;
5
4
  }
6
5
  var SKILLS_PREAMBLE = [
7
6
  "1. The skill is present in the `path` directory.",
@@ -20,7 +19,6 @@ name: ${params.name}
20
19
  description: ${params.description}`;
21
20
  }
22
21
  export {
23
- SKILLS_DIR,
24
22
  SKILLS_PREAMBLE,
25
23
  getSkillPath,
26
24
  renderSkillPromptBody
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/sandbox/skills/constants.ts"],"sourcesContent":["// Skill prompt constants and helpers: how skills are described to the agent in the system prompt.\n\n// Directory inside the sandbox where every skill (whatever its origin) is materialized.\nexport const SKILLS_DIR = '/opt/tfy/skills';\n\n// On-disk directory a skill is materialized into, keyed by its (unique) name.\nexport function getSkillPath(skillName: string): string {\n return `${SKILLS_DIR}/${skillName}`;\n}\n\nexport const SKILLS_PREAMBLE = [\n '1. The skill is present in the `path` directory.',\n '2. SKILL.md file within the directory is the primary file, there can be other files as well.',\n '3. Use `description` to judge whether the Agent needs to use a skill.',\n '4. To use a skill:',\n '4.a. If the `SKILL.md content` is inlined, the Agent must not read `path/SKILL.md`.',\n '4.b. Otherwise the Agent must read `path/SKILL.md` first.',\n '5. The Agent must avoid listing the `path` unless there are references in `SKILL.md` and there is reason to do so given the current conversation.',\n].join('\\n');\n\n// The <skill> block body: inline preloaded SKILL.md when present, else advertise path/name/description.\nexport function renderSkillPromptBody(params: {\n path: string;\n name: string;\n description: string;\n preloadContent: string | null;\n}): string {\n return params.preloadContent\n ? `path: ${params.path}\\nSKILL.md content:\\n${params.preloadContent}`\n : `path: ${params.path}\\nname: ${params.name}\\ndescription: ${params.description}`;\n}\n"],"mappings":";AAGO,IAAM,aAAa;AAGnB,SAAS,aAAa,WAA2B;AACtD,SAAO,GAAG,UAAU,IAAI,SAAS;AACnC;AAEO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAGJ,SAAS,sBAAsB,QAK3B;AACT,SAAO,OAAO,iBACV,SAAS,OAAO,IAAI;AAAA;AAAA,EAAwB,OAAO,cAAc,KACjE,SAAS,OAAO,IAAI;AAAA,QAAW,OAAO,IAAI;AAAA,eAAkB,OAAO,WAAW;AACpF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/sandbox/skills/constants.ts"],"sourcesContent":["// Skill prompt constants and helpers: how skills are described to the agent in the system prompt.\n\n// On-disk directory a skill is materialized into, keyed by its (unique) name.\nexport function getSkillPath(params: { skillsDir: string; skillName: string }): string {\n return `${params.skillsDir.replace(/\\/+$/, '')}/${params.skillName}`;\n}\n\nexport const SKILLS_PREAMBLE = [\n '1. The skill is present in the `path` directory.',\n '2. SKILL.md file within the directory is the primary file, there can be other files as well.',\n '3. Use `description` to judge whether the Agent needs to use a skill.',\n '4. To use a skill:',\n '4.a. If the `SKILL.md content` is inlined, the Agent must not read `path/SKILL.md`.',\n '4.b. Otherwise the Agent must read `path/SKILL.md` first.',\n '5. The Agent must avoid listing the `path` unless there are references in `SKILL.md` and there is reason to do so given the current conversation.',\n].join('\\n');\n\n// The <skill> block body: inline preloaded SKILL.md when present, else advertise path/name/description.\nexport function renderSkillPromptBody(params: {\n path: string;\n name: string;\n description: string;\n preloadContent: string | null;\n}): string {\n return params.preloadContent\n ? `path: ${params.path}\\nSKILL.md content:\\n${params.preloadContent}`\n : `path: ${params.path}\\nname: ${params.name}\\ndescription: ${params.description}`;\n}\n"],"mappings":";AAGO,SAAS,aAAa,QAA0D;AACrF,SAAO,GAAG,OAAO,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO,SAAS;AACpE;AAEO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAGJ,SAAS,sBAAsB,QAK3B;AACT,SAAO,OAAO,iBACV,SAAS,OAAO,IAAI;AAAA;AAAA,EAAwB,OAAO,cAAc,KACjE,SAAS,OAAO,IAAI;AAAA,QAAW,OAAO,IAAI;AAAA,eAAkB,OAAO,WAAW;AACpF;","names":[]}
@@ -1,4 +1,4 @@
1
- export { SKILLS_DIR, SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';
1
+ export { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';
2
2
  export type { ISkillMounter } from './ISkillMounter';
3
3
  export { SkillMounter } from './SkillMounter';
4
4
  export type { GitSkill } from './SkillMounter';