@proagentstore/cli 0.4.141 → 0.4.142

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.
@@ -116,6 +116,18 @@ export function parseApplyEnvelope(raw) {
116
116
  if (Object.values(limits).some((v) => !v))
117
117
  throw bad("limits are out of range");
118
118
  const opt = (v) => (typeof v === "string" && v.trim() ? v.trim().slice(0, 300) : undefined);
119
+ // #1079: the owner's kept answers, within a resume's bounds — never an instruction. One over a bound is
120
+ // dropped, never cut: a shortened answer would be grounding the owner never wrote.
121
+ const ownerAnswers = [];
122
+ for (const a of Array.isArray(o.ownerAnswers) ? o.ownerAnswers : []) {
123
+ if (ownerAnswers.length >= LOCAL_APPLY_CAPS.answers)
124
+ break;
125
+ const r = (a && typeof a === "object" ? a : {});
126
+ const question = typeof r.question === "string" ? r.question.trim() : "";
127
+ const answer = typeof r.answer === "string" ? r.answer.trim() : "";
128
+ if (question && answer && question.length <= LOCAL_APPLY_CAPS.questionChars && answer.length <= LOCAL_APPLY_CAPS.answerChars)
129
+ ownerAnswers.push({ question, answer });
130
+ }
119
131
  return {
120
132
  type: LOCAL_APPLY_TASK_TYPE,
121
133
  runId: o.runId,
@@ -132,6 +144,7 @@ export function parseApplyEnvelope(raw) {
132
144
  artifacts,
133
145
  policy: { mode: p.mode, allowDomains, ...(p.mode === "auto_submit" && gateId ? { submitGate: { gateId } } : {}), ...(p.screenshots === false ? { screenshots: false } : {}) },
134
146
  limits,
147
+ ...(ownerAnswers.length ? { ownerAnswers } : {}),
135
148
  };
136
149
  }
137
150
  /**
@@ -371,6 +384,9 @@ export class LocalApplyRuntime {
371
384
  throw new Blocked("artifact_changed", [`${v.error} Re-run tailoring for this application.`]);
372
385
  blocks.push({ label: a.kind, text: v.text });
373
386
  }
387
+ // #1079: answers the owner already gave this application, as a source — the same shape a resume's answers take.
388
+ if (e.ownerAnswers?.length)
389
+ blocks.push({ label: "owner answers", text: e.ownerAnswers.map((a) => `Q: ${a.question}\nA: ${a.answer}`).join("\n\n") });
374
390
  run.grounding = blocks.map((b) => b.text);
375
391
  const bridgeScript = this.deps.bridgeScript ?? fileURLToPath(new URL("../local-browser/bridge-stdio.js", import.meta.url));
376
392
  const spec = buildApplyEngineSpec(e, applyPrompt(e, blocks), { command: process.execPath, args: [bridgeScript], env: { [BRIDGE_ENV.url]: selfUrl, [BRIDGE_ENV.runId]: e.runId, [BRIDGE_ENV.token]: run.token } }, join(run.dir, "mcp.json"));
@@ -174,7 +174,9 @@ export class LocalBrowserRuntime {
174
174
  return { runId: same.envelope.runId, taskId: same.envelope.runId, status: same.state, existing: true };
175
175
  if (this.runs.has(envelope.runId))
176
176
  throw new RunnerInputError(`Run ${envelope.runId} already exists with another requestId`, 409);
177
- const active = [...this.runs.values()].filter((r) => r.envelope.instanceId === envelope.instanceId && r.state !== "ended").length;
177
+ // A PAUSED run waits on a person and holds no slot (#1079) — the cloud counts the same way. Its own
178
+ // resume is the owner's act and is not refused, so the cap bounds STARTS; research is read-only.
179
+ const active = [...this.runs.values()].filter((r) => r.envelope.instanceId === envelope.instanceId && r.state === "running").length;
178
180
  if (active >= envelope.limits.maxConcurrent)
179
181
  throw new RunnerInputError(`This machine is already running ${active} research run(s) for this agent (limit ${envelope.limits.maxConcurrent}).`, 409);
180
182
  const selfUrl = this.deps.selfUrl();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proagentstore/cli",
3
- "version": "0.4.141",
3
+ "version": "0.4.142",
4
4
  "description": "CLI for creating, publishing, and running ProAgentStore agents",
5
5
  "license": "MIT",
6
6
  "type": "module",