@themoltnet/pi-extension 0.34.0 → 0.34.1

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 (2) hide show
  1. package/dist/index.js +13 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -18443,13 +18443,13 @@ function createMoltNetTools(config) {
18443
18443
  const downloadTaskArtifact = defineTool({
18444
18444
  name: "moltnet_download_task_artifact",
18445
18445
  label: "Download MoltNet Task Artifact",
18446
- description: "Download immutable task artifact bytes by taskId, attemptN, and CID into a new file in the current task workspace. Use moltnet_list_task_artifacts first to choose the correct CID for referenced task inputs.",
18446
+ description: "Download immutable task artifact bytes by taskId and CID into a new file in the current task workspace. Use moltnet_list_task_artifacts first to choose the correct CID. Omit attemptN for a bound input artifact; pass it only to require an artifact from one exact task attempt.",
18447
18447
  parameters: Type.Object({
18448
18448
  taskId: Type.Optional(Type.String({ description: "Task ID. Defaults to the active task when running inside a task attempt." })),
18449
- attemptN: Type.Integer({
18449
+ attemptN: Type.Optional(Type.Integer({
18450
18450
  minimum: 1,
18451
- description: "Attempt number that produced the artifact."
18452
- }),
18451
+ description: "Attempt number that produced the artifact. Omit for bound input artifacts, which have no producing attempt."
18452
+ })),
18453
18453
  cid: Type.String({
18454
18454
  minLength: 1,
18455
18455
  description: "Artifact CID returned by moltnet_list_task_artifacts."
@@ -18463,11 +18463,15 @@ function createMoltNetTools(config) {
18463
18463
  if (!taskId) throw new Error("moltnet_download_task_artifact requires taskId outside an active task");
18464
18464
  const cwd = config.getHostCwd?.() ?? process.cwd();
18465
18465
  const outputPath = await resolveWorkspaceOutputPath(cwd, params.outputPath);
18466
- const download = await agent.tasks.artifacts.download({
18466
+ const artifactPath = params.attemptN === void 0 ? {
18467
+ taskId,
18468
+ cid: params.cid
18469
+ } : {
18467
18470
  taskId,
18468
18471
  attemptN: params.attemptN,
18469
18472
  cid: params.cid
18470
- }, { teamId });
18473
+ };
18474
+ const download = await agent.tasks.artifacts.download(artifactPath, { teamId });
18471
18475
  await pipeline(download.stream, createWriteStream(outputPath, { flags: "wx" }));
18472
18476
  const info = await stat(outputPath);
18473
18477
  return {
@@ -18475,7 +18479,7 @@ function createMoltNetTools(config) {
18475
18479
  type: "text",
18476
18480
  text: JSON.stringify({
18477
18481
  taskId,
18478
- attemptN: params.attemptN,
18482
+ ...params.attemptN === void 0 ? {} : { attemptN: params.attemptN },
18479
18483
  cid: params.cid,
18480
18484
  artifactId: download.artifactId,
18481
18485
  contentType: download.contentType,
@@ -20334,6 +20338,8 @@ function buildFinalOutputBlock(opts) {
20334
20338
  `\`moltnet_list_task_artifacts\` for the referenced task and download the`,
20335
20339
  `specific CID you need with \`moltnet_download_task_artifact\` before judging`,
20336
20340
  `or continuing that work.`,
20341
+ `For a bound input artifact, omit \`attemptN\` because it has no producing`,
20342
+ `attempt. Pass \`attemptN\` only for an artifact from one exact task attempt.`,
20337
20343
  "",
20338
20344
  `Output shape:`,
20339
20345
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/pi-extension",
3
- "version": "0.34.0",
3
+ "version": "0.34.1",
4
4
  "type": "module",
5
5
  "description": "MoltNet pi extension — sandboxed tool execution in Gondolin VMs with MoltNet identity and persistent memory",
6
6
  "keywords": [
@@ -36,7 +36,7 @@
36
36
  "@earendil-works/gondolin": "^0.9.1",
37
37
  "@opentelemetry/api": "^1.9.0",
38
38
  "typebox": "^1.2.8",
39
- "@themoltnet/agent-runtime": "0.35.2",
39
+ "@themoltnet/agent-runtime": "0.35.3",
40
40
  "@themoltnet/sdk": "0.120.0"
41
41
  },
42
42
  "peerDependencies": {