@pipod/cli 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -18533,6 +18533,11 @@ async function showCmd(client, args) {
18533
18533
  info("bake script:");
18534
18534
  out(t.bakeScript);
18535
18535
  }
18536
+ if (t.agentInstructions) {
18537
+ out("");
18538
+ info("agent instructions:");
18539
+ out(t.agentInstructions);
18540
+ }
18536
18541
  if (t.piSettings && Object.keys(t.piSettings).length > 0) {
18537
18542
  info(`Pi settings ${describePiSettings(flatPiSettings(t.piSettings))}`);
18538
18543
  }
@@ -18611,6 +18616,12 @@ function parseOpts(args) {
18611
18616
  opts.bakeScript = fs30.readFileSync(file, "utf8");
18612
18617
  break;
18613
18618
  }
18619
+ case "--agent-instructions": {
18620
+ const file = next();
18621
+ if (!fs30.existsSync(file)) throw new PiPodError(`no such agent instructions file: ${file}`);
18622
+ opts.agentInstructions = fs30.readFileSync(file, "utf8");
18623
+ break;
18624
+ }
18614
18625
  default:
18615
18626
  rest.push(arg);
18616
18627
  }
@@ -18664,6 +18675,7 @@ async function createCmd(client, args, flags) {
18664
18675
  ...opts.description ? { description: opts.description } : {},
18665
18676
  ...initScript ? { initScript } : {},
18666
18677
  ...bakeScript ? { bakeScript } : {},
18678
+ ...opts.agentInstructions ? { agentInstructions: opts.agentInstructions } : {},
18667
18679
  // An explicit refresh is replacement, not merge: an empty project file set clears stale custody.
18668
18680
  ...opts.fromHere ? { piSettings: piSettings ?? {} } : {}
18669
18681
  });
@@ -18770,9 +18782,9 @@ async function editCmd(client, args) {
18770
18782
  });
18771
18783
  }
18772
18784
  const t = await findTemplate(client, rest[0]);
18773
- if (opts.name === void 0 && opts.description === void 0 && !opts.config && opts.initScript === void 0 && opts.bakeScript === void 0) {
18785
+ if (opts.name === void 0 && opts.description === void 0 && !opts.config && opts.initScript === void 0 && opts.bakeScript === void 0 && opts.agentInstructions === void 0) {
18774
18786
  throw new PiPodError("nothing to change", {
18775
- hint: "pass --name, --description, --config <file>, --init-script <file> or --bake-script <file>"
18787
+ hint: "pass --name, --description, --config <file>, --init-script <file>, --bake-script <file> or --agent-instructions <file>"
18776
18788
  });
18777
18789
  }
18778
18790
  const updated = await client.updateTemplate(t.id, {
@@ -18783,7 +18795,8 @@ async function editCmd(client, args) {
18783
18795
  ...opts.description !== void 0 ? { description: opts.description } : {},
18784
18796
  ...opts.config ? { config: opts.config } : {},
18785
18797
  ...opts.initScript !== void 0 ? { initScript: opts.initScript } : {},
18786
- ...opts.bakeScript !== void 0 ? { bakeScript: opts.bakeScript } : {}
18798
+ ...opts.bakeScript !== void 0 ? { bakeScript: opts.bakeScript } : {},
18799
+ ...opts.agentInstructions !== void 0 ? { agentInstructions: opts.agentInstructions } : {}
18787
18800
  });
18788
18801
  info(`updated template ${updated.name}`);
18789
18802
  await hintMissingCredentials(client);
@@ -19826,15 +19839,23 @@ are never stored on the server.
19826
19839
  templates: `Usage: pipod templates [action]
19827
19840
 
19828
19841
  Manage pod templates on the pi pod server. A template stores config, init and
19829
- bake scripts, Pi settings files, and named secrets. Templates are personal by
19830
- default: only their owner sees and launches them. --org at creation or
19831
- \`templates share\` makes one org-wide.
19842
+ bake scripts, Pi settings files, named secrets, and agent instructions.
19843
+ Templates are personal by default: only their owner sees and launches them.
19844
+ --org at creation or \`templates share\` makes one org-wide.
19845
+
19846
+ Agent instructions are added to the agent's system prompt in every pod launched
19847
+ from the template, with the hosts and secrets the pod actually has: say what
19848
+ access the template is meant to have. They guide the agent and enforce nothing;
19849
+ the template's secrets and egress decide what a pod can reach. A pod's child
19850
+ pods and the jobs it schedules launch from the pod's own template.
19832
19851
 
19833
19852
  Actions:
19834
19853
  list List templates with scope and key counts (default)
19835
- show <name|id> Show config, scripts, Pi settings, and secret names
19854
+ show <name|id> Show config, scripts, agent instructions, Pi settings, and
19855
+ secret names
19836
19856
  create <name> Create a template
19837
- edit <name|id> Update a template's name, description, config, or scripts
19857
+ edit <name|id> Update a template's name, description, config, scripts, or
19858
+ agent instructions
19838
19859
  share <name|id> Make a personal template org-wide (cannot be undone)
19839
19860
  rm <name|id> Delete a template (alias: delete)
19840
19861
 
@@ -19846,6 +19867,9 @@ create/edit options:
19846
19867
  scripts, and sanitized Pi files (contradicts --config)
19847
19868
  --init-script <file> Store this init script
19848
19869
  --bake-script <file> Store this bake script
19870
+ --agent-instructions <file>
19871
+ Store this file as the agent instructions (an empty
19872
+ file removes them); \`pipod push\` leaves them alone
19849
19873
  --org create only: make the template org-wide from the start
19850
19874
  --with-secrets With --from-here: also upload project env values as
19851
19875
  template secrets