@truefoundry/trueforge-core 0.1.2 → 0.1.4-rc.0

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 (117) 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 -5
  30. package/dist/core/sandbox/Sandbox.d.ts.map +1 -1
  31. package/dist/core/sandbox/Sandbox.js +200 -84
  32. package/dist/core/sandbox/Sandbox.js.map +1 -1
  33. package/dist/core/sandbox/Sandbox.mjs +201 -85
  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/sandboxScripts.gen.d.ts +1 -1
  91. package/dist/core/sandbox/sandboxScripts.gen.d.ts.map +1 -1
  92. package/dist/core/sandbox/sandboxScripts.gen.js +1 -1
  93. package/dist/core/sandbox/sandboxScripts.gen.js.map +1 -1
  94. package/dist/core/sandbox/sandboxScripts.gen.mjs +1 -1
  95. package/dist/core/sandbox/sandboxScripts.gen.mjs.map +1 -1
  96. package/dist/core/sandbox/skills/ISkillMounter.d.ts +7 -2
  97. package/dist/core/sandbox/skills/ISkillMounter.d.ts.map +1 -1
  98. package/dist/core/sandbox/skills/ISkillMounter.js.map +1 -1
  99. package/dist/core/sandbox/skills/SkillMounter.d.ts +7 -2
  100. package/dist/core/sandbox/skills/SkillMounter.d.ts.map +1 -1
  101. package/dist/core/sandbox/skills/SkillMounter.js +5 -6
  102. package/dist/core/sandbox/skills/SkillMounter.js.map +1 -1
  103. package/dist/core/sandbox/skills/SkillMounter.mjs +5 -6
  104. package/dist/core/sandbox/skills/SkillMounter.mjs.map +1 -1
  105. package/dist/core/sandbox/skills/constants.d.ts +4 -2
  106. package/dist/core/sandbox/skills/constants.d.ts.map +1 -1
  107. package/dist/core/sandbox/skills/constants.js +2 -5
  108. package/dist/core/sandbox/skills/constants.js.map +1 -1
  109. package/dist/core/sandbox/skills/constants.mjs +2 -4
  110. package/dist/core/sandbox/skills/constants.mjs.map +1 -1
  111. package/dist/core/sandbox/skills/index.d.ts +1 -1
  112. package/dist/core/sandbox/skills/index.d.ts.map +1 -1
  113. package/dist/core/sandbox/skills/index.js +0 -2
  114. package/dist/core/sandbox/skills/index.js.map +1 -1
  115. package/dist/core/sandbox/skills/index.mjs +1 -2
  116. package/dist/core/sandbox/skills/index.mjs.map +1 -1
  117. package/package.json +1 -1
@@ -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';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC/F,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/sandbox/skills/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
@@ -20,7 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/core/sandbox/skills/index.ts
21
21
  var skills_exports = {};
22
22
  __export(skills_exports, {
23
- SKILLS_DIR: () => import_constants.SKILLS_DIR,
24
23
  SKILLS_PREAMBLE: () => import_constants.SKILLS_PREAMBLE,
25
24
  SkillMounter: () => import_SkillMounter.SkillMounter,
26
25
  getSkillPath: () => import_constants.getSkillPath,
@@ -31,7 +30,6 @@ var import_constants = require("./constants.js");
31
30
  var import_SkillMounter = require("./SkillMounter.js");
32
31
  // Annotate the CommonJS export names for ESM import in node:
33
32
  0 && (module.exports = {
34
- SKILLS_DIR,
35
33
  SKILLS_PREAMBLE,
36
34
  SkillMounter,
37
35
  getSkillPath,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/sandbox/skills/index.ts"],"sourcesContent":["export { SKILLS_DIR, SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nexport type { ISkillMounter } from './ISkillMounter';\nexport { SkillMounter } from './SkillMounter';\nexport type { GitSkill } from './SkillMounter';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAiF;AAEjF,0BAA6B;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/sandbox/skills/index.ts"],"sourcesContent":["export { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nexport type { ISkillMounter } from './ISkillMounter';\nexport { SkillMounter } from './SkillMounter';\nexport type { GitSkill } from './SkillMounter';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqE;AAErE,0BAA6B;","names":[]}
@@ -1,8 +1,7 @@
1
1
  // src/core/sandbox/skills/index.ts
2
- import { SKILLS_DIR, SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from "./constants.mjs";
2
+ import { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from "./constants.mjs";
3
3
  import { SkillMounter } from "./SkillMounter.mjs";
4
4
  export {
5
- SKILLS_DIR,
6
5
  SKILLS_PREAMBLE,
7
6
  SkillMounter,
8
7
  getSkillPath,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/sandbox/skills/index.ts"],"sourcesContent":["export { SKILLS_DIR, SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nexport type { ISkillMounter } from './ISkillMounter';\nexport { SkillMounter } from './SkillMounter';\nexport type { GitSkill } from './SkillMounter';\n"],"mappings":";AAAA,SAAS,YAAY,iBAAiB,cAAc,6BAA6B;AAEjF,SAAS,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/sandbox/skills/index.ts"],"sourcesContent":["export { SKILLS_PREAMBLE, getSkillPath, renderSkillPromptBody } from './constants';\nexport type { ISkillMounter } from './ISkillMounter';\nexport { SkillMounter } from './SkillMounter';\nexport type { GitSkill } from './SkillMounter';\n"],"mappings":";AAAA,SAAS,iBAAiB,cAAc,6BAA6B;AAErE,SAAS,oBAAoB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truefoundry/trueforge-core",
3
- "version": "0.1.2",
3
+ "version": "0.1.4-rc.0",
4
4
  "description": "TrueForge Agent Harness library.",
5
5
  "author": "TrueFoundry",
6
6
  "license": "MIT",