@themoltnet/pi-extension 0.27.2 → 0.27.3
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/index.js +20 -32
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -10269,6 +10269,7 @@ var FreeformArtifact = _Object_({
|
|
|
10269
10269
|
});
|
|
10270
10270
|
var FreeformOutput = _Object_({
|
|
10271
10271
|
summary: String$1({ minLength: 1 }),
|
|
10272
|
+
branch: Optional(String$1({ minLength: 1 })),
|
|
10272
10273
|
artifacts: Optional(_Array_(FreeformArtifact, { maxItems: 20 })),
|
|
10273
10274
|
proposedTaskType: Optional(FreeformTaskTypeProposal),
|
|
10274
10275
|
diaryEntryIds: Optional(_Array_(String$1({ format: "uuid" }))),
|
|
@@ -10281,7 +10282,7 @@ var FreeformOutput = _Object_({
|
|
|
10281
10282
|
* Server-side preflight for `freeform` task-create. Runs after the
|
|
10282
10283
|
* sync TypeBox check passes and only kicks in when
|
|
10283
10284
|
* `input.continueFrom` is set — i.e. the proposer is asking to
|
|
10284
|
-
*
|
|
10285
|
+
* continue from a prior freeform attempt (#1287).
|
|
10285
10286
|
*
|
|
10286
10287
|
* Failure modes, in evaluation order:
|
|
10287
10288
|
* 1. `freeform.sourceTaskNotFound` — source task id does not resolve
|
|
@@ -10289,23 +10290,17 @@ var FreeformOutput = _Object_({
|
|
|
10289
10290
|
* 2. `freeform.sourceTaskTypeNotSupported` — source isn't `freeform`.
|
|
10290
10291
|
* v1 only supports freeform → freeform continuation.
|
|
10291
10292
|
* 3. `freeform.sourceAttemptNotCompleted` — named attempt is missing
|
|
10292
|
-
* or not in `completed` state;
|
|
10293
|
+
* or not in `completed` state; continuation only makes sense
|
|
10293
10294
|
* once the parent has produced a terminal output.
|
|
10294
10295
|
* 4. `freeform.executionWorkspaceNotInheritable` — caller set
|
|
10295
10296
|
* `execution.workspace` together with `continueFrom`. Workspace
|
|
10296
|
-
* mode for a continuation is
|
|
10297
|
-
* (
|
|
10298
|
-
*
|
|
10299
|
-
*
|
|
10300
|
-
*
|
|
10301
|
-
* 5. `freeform.sourceNotResumeEligible` — `daemonState` is null or
|
|
10302
|
-
* `slotResumableUntil` is null. Older completions (pre-#1287) and
|
|
10303
|
-
* daemons that opt out fall here.
|
|
10304
|
-
* 6. `freeform.sourceResumeExpired` — `slotResumableUntil` is in the
|
|
10305
|
-
* past; the warm slot's TTL has elapsed and no daemon is
|
|
10306
|
-
* guaranteed to still hold it.
|
|
10297
|
+
* mode for a continuation is derived by the daemon from parent runtime
|
|
10298
|
+
* context (local slot first, durable session + source attempt branch
|
|
10299
|
+
* second), so any caller-supplied override is silently dropped at the
|
|
10300
|
+
* daemon plan stage. Reject explicitly so misconfiguration surfaces at
|
|
10301
|
+
* create time.
|
|
10307
10302
|
*
|
|
10308
|
-
* Returns on the first failure
|
|
10303
|
+
* Returns on the first failure — the checks
|
|
10309
10304
|
* are sequential preconditions, later ones presume earlier ones hold.
|
|
10310
10305
|
*/
|
|
10311
10306
|
async function validateFreeformInputAsync(input, ctx) {
|
|
@@ -10324,7 +10319,7 @@ async function validateFreeformInputAsync(input, ctx) {
|
|
|
10324
10319
|
}];
|
|
10325
10320
|
if (input.execution?.workspace) return [{
|
|
10326
10321
|
field: "input/execution/workspace",
|
|
10327
|
-
message: "execution.workspace is
|
|
10322
|
+
message: "execution.workspace is derived from parent runtime context when continueFrom is set; omit it",
|
|
10328
10323
|
code: "freeform.executionWorkspaceNotInheritable"
|
|
10329
10324
|
}];
|
|
10330
10325
|
if (ctx.deferReadinessChecks) return [];
|
|
@@ -10334,17 +10329,6 @@ async function validateFreeformInputAsync(input, ctx) {
|
|
|
10334
10329
|
message: `Source attempt ${cf.attemptN} on task ${cf.taskId} is not in 'completed' state`,
|
|
10335
10330
|
code: "freeform.sourceAttemptNotCompleted"
|
|
10336
10331
|
}];
|
|
10337
|
-
if (!attempt.daemonState || attempt.daemonState.slotResumableUntil === null) return [{
|
|
10338
|
-
field: "input/continueFrom",
|
|
10339
|
-
message: "Source attempt did not report continuation eligibility (older completion or daemon opted out)",
|
|
10340
|
-
code: "freeform.sourceNotResumeEligible"
|
|
10341
|
-
}];
|
|
10342
|
-
const expiresAt = new Date(attempt.daemonState.slotResumableUntil).getTime();
|
|
10343
|
-
if (Number.isNaN(expiresAt) || expiresAt <= Date.now()) return [{
|
|
10344
|
-
field: "input/continueFrom",
|
|
10345
|
-
message: `Source attempt's warm slot expired at ${attempt.daemonState.slotResumableUntil} (reported at ${attempt.daemonState.reportedAt})`,
|
|
10346
|
-
code: "freeform.sourceResumeExpired"
|
|
10347
|
-
}];
|
|
10348
10332
|
return [];
|
|
10349
10333
|
}
|
|
10350
10334
|
//#endregion
|
|
@@ -13688,11 +13672,12 @@ var MAX_CLAIM_CONDITION_STATUSES = 8;
|
|
|
13688
13672
|
/**
|
|
13689
13673
|
* Daemon-asserted runtime state stamped onto a `TaskAttemptSummary` at
|
|
13690
13674
|
* attempt-completion time. The server persists this block verbatim and
|
|
13691
|
-
*
|
|
13692
|
-
* eligibility
|
|
13693
|
-
*
|
|
13694
|
-
*
|
|
13695
|
-
*
|
|
13675
|
+
* exposes `slotResumableUntil` as a legacy/local warm-slot hint; task
|
|
13676
|
+
* continuation eligibility is based on the completed source attempt and
|
|
13677
|
+
* daemon-side claim-affinity/runtime-session recovery. The block carries
|
|
13678
|
+
* its own `reportedAt` so consumers can reason about staleness without
|
|
13679
|
+
* reading documentation. All daemon-asserted state lives here —
|
|
13680
|
+
* top-level attempt fields stay server-authoritative.
|
|
13696
13681
|
*
|
|
13697
13682
|
* Adding new fields requires explicit design review (intentional
|
|
13698
13683
|
* boundary; see docs/superpowers/specs/2026-06-04-tasks-continue-design.md).
|
|
@@ -19445,7 +19430,9 @@ function buildFreeformUserPrompt(input, ctx) {
|
|
|
19445
19430
|
"2. Gather enough context to avoid guessing.",
|
|
19446
19431
|
"3. Complete the requested work when it is safe and bounded.",
|
|
19447
19432
|
"4. If the request reveals a recurring task shape, include a",
|
|
19448
|
-
" `proposedTaskType` in the final output with a concise rationale."
|
|
19433
|
+
" `proposedTaskType` in the final output with a concise rationale.",
|
|
19434
|
+
"5. If you changed code on a branch, include that branch in",
|
|
19435
|
+
" `branch` so future continuations can recover git context."
|
|
19449
19436
|
].join("\n");
|
|
19450
19437
|
const sections = [
|
|
19451
19438
|
{
|
|
@@ -19497,6 +19484,7 @@ function buildFreeformUserPrompt(input, ctx) {
|
|
|
19497
19484
|
shapeSketch: [
|
|
19498
19485
|
"{",
|
|
19499
19486
|
" \"summary\": \"<2-5 sentence result>\",",
|
|
19487
|
+
" \"branch\": \"<branch name when code changed; omit for prose-only work>\",",
|
|
19500
19488
|
" \"artifacts\": [{ \"kind\": \"...\", \"title\": \"...\", \"description\": \"...\", \"body\": \"<inline content up to 64 KiB; preferred for textual output so it persists with the task>\", \"url\": \"...\", \"path\": \"<worktree-ephemeral; not persisted after completion>\" }],",
|
|
19501
19489
|
" \"proposedTaskType\": { \"name\": \"...\", \"rationale\": \"...\", \"inputShape\": {}, \"outputShape\": {} },",
|
|
19502
19490
|
" \"diaryEntryIds\": [\"...\"],",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themoltnet/pi-extension",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.3",
|
|
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,8 +36,8 @@
|
|
|
36
36
|
"@earendil-works/gondolin": "^0.9.1",
|
|
37
37
|
"@opentelemetry/api": "^1.9.0",
|
|
38
38
|
"typebox": "^1.2.8",
|
|
39
|
-
"@themoltnet/
|
|
40
|
-
"@themoltnet/
|
|
39
|
+
"@themoltnet/sdk": "0.113.1",
|
|
40
|
+
"@themoltnet/agent-runtime": "0.31.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@earendil-works/pi-coding-agent": ">=0.74.0",
|