@proagentstore/cli 0.4.103 → 0.4.104

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.
@@ -1,3 +1,4 @@
1
+ import { runObjectiveBlock } from "./run-objective.js";
1
2
  import { spawn } from "node:child_process";
2
3
  import { classifyCommand, commandFromToolInput, fillTargetFromResult, toolCallOk, toolResultMark } from "./engine-acts.js";
3
4
  import { parseEngineUsage } from "./engine-usage.js";
@@ -521,6 +522,10 @@ export class HeadlessSession {
521
522
  this.push("[pags] this engine keeps no memory between turns, so ProAgentStore's record of the conversation so far was delivered with this turn — a reconstruction, not the engine's own memory");
522
523
  else if (seed)
523
524
  this.push("[pags] a context brief from ProAgentStore's record was delivered with this turn — a reconstruction, not the previous conversation");
525
+ // The run's objective (#1019): to the ENGINE in full, the pane a one-line marker (same budget as the brief).
526
+ const objective = opts.objective ? runObjectiveBlock(opts.objective) : null;
527
+ if (opts.objective)
528
+ this.push(`[pags] the run's objective (${opts.objective.text.length} characters, verbatim) was delivered with this turn`);
524
529
  this.push(`\n❯ [${stamp()}] ${authorTag(opts.author)}${text}`); // ❯ — your turn, timestamped
525
530
  this.run = "thinking";
526
531
  const now = Date.now();
@@ -531,7 +536,8 @@ export class HeadlessSession {
531
536
  try {
532
537
  // Brief first, instruction second, and never the other way round: it is background for
533
538
  // the request, and an engine that reads the request last acts on the request.
534
- const withSeed = seed ? `${seed}\n\n${sent}` : sent;
539
+ // The objective sits between them: background like the brief, and above the instruction it frames.
540
+ const withSeed = [seed, objective, sent].filter(Boolean).join("\n\n");
535
541
  if (this.adapter.persistent) {
536
542
  // `role` stays "user" — the only role this protocol accepts, which is why the
537
543
  // disambiguation rides in the text instead (#505).
@@ -0,0 +1,18 @@
1
+ // The run's objective, delivered verbatim with a turn and attributed to the platform (#1019).
2
+ /** A run objective as the cloud sent it, or undefined — narrowed, because any caller can POST here (#1019). */
3
+ export function runObjective(raw) {
4
+ const o = raw;
5
+ return o && typeof o.runId === "string" && o.runId.length <= 128 && typeof o.text === "string" && o.text.trim() ? { runId: o.runId, text: o.text } : undefined;
6
+ }
7
+ /**
8
+ * The run's objective as the engine reads it (#1019): verbatim, fenced, and attributed to the platform —
9
+ * the Pilot's instruction that follows is its own turn, and owner directives sent later outrank both.
10
+ */
11
+ export function runObjectiveBlock(o) {
12
+ return [
13
+ `[pags] RUN OBJECTIVE — the owner's objective for run ${o.runId}, exactly as ProAgentStore accepted it. It was not written by the Pilot. Owner instructions sent later in this run take precedence over it.`,
14
+ "<<<OBJECTIVE",
15
+ o.text,
16
+ "OBJECTIVE>>>",
17
+ ].join("\n");
18
+ }
@@ -1,3 +1,4 @@
1
+ import { runObjective } from "./run-objective.js";
1
2
  import { homedir } from "node:os";
2
3
  import { join, resolve } from "node:path";
3
4
  import { RunnerInputError } from "../errors.js";
@@ -65,7 +66,9 @@ export class CodingRuntime {
65
66
  // a reader of the registration can see which machines can restore a branch invariant; the
66
67
  // cloud still never trusts it, because an older runner simply 404s and the policy reports
67
68
  // that it asked and was not answered.
68
- return ["coding.sessions", "coding.stream", "human.takeover", "coding.inspect", "coding.repo-write"];
69
+ // `coding.run-objective` (#1019): a message may carry the run's objective, delivered verbatim and
70
+ // attributed to the platform. Advertised so the cloud never claims delivery to a runner without it.
71
+ return ["coding.sessions", "coding.stream", "human.takeover", "coding.inspect", "coding.repo-write", "coding.run-objective"];
69
72
  }
70
73
  /**
71
74
  * Resolve the workDir for a read-only inspection. Prefer the tracked session's real
@@ -255,6 +258,7 @@ export class CodingRuntime {
255
258
  author: asTurnAuthor(action.author),
256
259
  replay: typeof action.replay === "string" ? action.replay : undefined,
257
260
  inputId: typeof action.inputId === "string" && action.inputId.length <= 128 ? action.inputId : undefined,
261
+ objective: runObjective(action.objective),
258
262
  });
259
263
  break;
260
264
  case "keys": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proagentstore/cli",
3
- "version": "0.4.103",
3
+ "version": "0.4.104",
4
4
  "description": "CLI for creating, publishing, and running ProAgentStore agents",
5
5
  "license": "MIT",
6
6
  "type": "module",