@themoltnet/node-red-contrib-core 0.3.2 → 0.3.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.
Files changed (2) hide show
  1. package/dist/nodes/src.js +95 -33
  2. package/package.json +2 -2
package/dist/nodes/src.js CHANGED
@@ -1831,6 +1831,28 @@ var uploadRuntimeSession = (options) => (options.client ?? client).put({
1831
1831
  }
1832
1832
  });
1833
1833
  /**
1834
+ * List recent team-scoped runtime slots for repair/sync.
1835
+ */
1836
+ var listRuntimeSlots = (options) => (options.client ?? client).get({
1837
+ security: [
1838
+ {
1839
+ scheme: "bearer",
1840
+ type: "http"
1841
+ },
1842
+ {
1843
+ name: "X-Moltnet-Session-Token",
1844
+ type: "apiKey"
1845
+ },
1846
+ {
1847
+ in: "cookie",
1848
+ name: "ory_kratos_session",
1849
+ type: "apiKey"
1850
+ }
1851
+ ],
1852
+ url: "/runtime-slots",
1853
+ ...options
1854
+ });
1855
+ /**
1834
1856
  * Upsert a team-scoped runtime slot for audit and continuation affinity lookup.
1835
1857
  */
1836
1858
  var beginRuntimeSlot = (options) => (options.client ?? client).post({
@@ -5134,6 +5156,15 @@ function createRuntimeSlotsNamespace(context) {
5134
5156
  if (err instanceof MoltNetError && err.statusCode === 404) return null;
5135
5157
  throw err;
5136
5158
  }
5159
+ },
5160
+ async list(query, options) {
5161
+ const filteredQuery = Object.fromEntries(Object.entries(query).filter(([, value]) => value !== void 0));
5162
+ return unwrapResult(await listRuntimeSlots({
5163
+ auth,
5164
+ client,
5165
+ headers: requiredTeamHeaders(options),
5166
+ query: filteredQuery
5167
+ })).items;
5137
5168
  }
5138
5169
  };
5139
5170
  }
@@ -9483,6 +9514,32 @@ var RuntimeProfileAllowedWorkspaceModes = _Array_(RuntimeProfileWorkspaceMode, {
9483
9514
  maxItems: 3,
9484
9515
  uniqueItems: true
9485
9516
  });
9517
+ var RuntimeProfileThinkingLevelOptions = [
9518
+ Literal("off"),
9519
+ Literal("minimal"),
9520
+ Literal("low"),
9521
+ Literal("medium"),
9522
+ Literal("high"),
9523
+ Literal("xhigh")
9524
+ ];
9525
+ Union([...RuntimeProfileThinkingLevelOptions]);
9526
+ var RuntimeProfileNullableThinkingLevel = Union([...RuntimeProfileThinkingLevelOptions, Null()]);
9527
+ var RuntimeProfileNullableTemperature = Union([Null(), Number$1({
9528
+ minimum: 0,
9529
+ maximum: 2
9530
+ })]);
9531
+ var RuntimeProfileNullableTopP = Union([Null(), Number$1({
9532
+ minimum: 0,
9533
+ maximum: 1
9534
+ })]);
9535
+ var RuntimeProfileNullableTopK = Union([Integer({
9536
+ minimum: 1,
9537
+ maximum: 1e4
9538
+ }), Null()]);
9539
+ var RuntimeProfileNullableMaxOutputTokens = Union([Integer({
9540
+ minimum: 1,
9541
+ maximum: 1e6
9542
+ }), Null()]);
9486
9543
  var SandboxResumeCommandWhenSchema = _Object_({ workspaceMode: Optional(_Array_(Union([
9487
9544
  Literal("shared_mount"),
9488
9545
  Literal("dedicated_worktree"),
@@ -9607,6 +9664,11 @@ _Object_({
9607
9664
  minLength: 1,
9608
9665
  maxLength: 200
9609
9666
  }),
9667
+ thinkingLevel: RuntimeProfileNullableThinkingLevel,
9668
+ temperature: RuntimeProfileNullableTemperature,
9669
+ topP: RuntimeProfileNullableTopP,
9670
+ topK: RuntimeProfileNullableTopK,
9671
+ maxOutputTokens: RuntimeProfileNullableMaxOutputTokens,
9610
9672
  runtimeKind: Literal("gondolin_pi"),
9611
9673
  sandbox: RuntimeProfileSandbox,
9612
9674
  sessionStorageMode: Literal("local"),
@@ -9718,7 +9780,7 @@ var RuntimeWorkspace = _Object_({
9718
9780
  createdAtMs: Integer({ minimum: 0 }),
9719
9781
  lastUsedAtMs: Integer({ minimum: 0 })
9720
9782
  }, { $id: "RuntimeWorkspace" });
9721
- _Object_({
9783
+ _Object_({ items: _Array_(_Object_({
9722
9784
  slot: _Object_({
9723
9785
  id: String$1({ format: "uuid" }),
9724
9786
  teamId: String$1({ format: "uuid" }),
@@ -9751,7 +9813,7 @@ _Object_({
9751
9813
  expiresAtMs: Integer({ minimum: 0 })
9752
9814
  }, { $id: "RuntimeSlot" }),
9753
9815
  workspace: Union([RuntimeWorkspace, Null()])
9754
- }, { $id: "ResolvedRuntimeSlot" });
9816
+ }, { $id: "ResolvedRuntimeSlot" })) }, { $id: "RuntimeSlotListResponse" });
9755
9817
  _Object_({
9756
9818
  agentName: String$1({
9757
9819
  minLength: 1,
@@ -9812,6 +9874,21 @@ _Object_({
9812
9874
  $id: "FindLatestRuntimeSlotForAttemptQuery",
9813
9875
  additionalProperties: false
9814
9876
  });
9877
+ _Object_({
9878
+ agentName: Optional(String$1({
9879
+ minLength: 1,
9880
+ maxLength: 100
9881
+ })),
9882
+ runtimeProfileId: Optional(String$1({ format: "uuid" })),
9883
+ state: Optional(RuntimeSlotState),
9884
+ limit: Optional(Integer({
9885
+ minimum: 1,
9886
+ maximum: 200
9887
+ }))
9888
+ }, {
9889
+ $id: "ListRuntimeSlotsQuery",
9890
+ additionalProperties: false
9891
+ });
9815
9892
  //#endregion
9816
9893
  //#region ../tasks/src/success-criteria.ts
9817
9894
  /**
@@ -10225,6 +10302,7 @@ var FreeformArtifact = _Object_({
10225
10302
  });
10226
10303
  var FreeformOutput = _Object_({
10227
10304
  summary: String$1({ minLength: 1 }),
10305
+ branch: Optional(String$1({ minLength: 1 })),
10228
10306
  artifacts: Optional(_Array_(FreeformArtifact, { maxItems: 20 })),
10229
10307
  proposedTaskType: Optional(FreeformTaskTypeProposal),
10230
10308
  diaryEntryIds: Optional(_Array_(String$1({ format: "uuid" }))),
@@ -10237,7 +10315,7 @@ var FreeformOutput = _Object_({
10237
10315
  * Server-side preflight for `freeform` task-create. Runs after the
10238
10316
  * sync TypeBox check passes and only kicks in when
10239
10317
  * `input.continueFrom` is set — i.e. the proposer is asking to
10240
- * resume a prior freeform attempt's warm slot (#1287).
10318
+ * continue from a prior freeform attempt (#1287).
10241
10319
  *
10242
10320
  * Failure modes, in evaluation order:
10243
10321
  * 1. `freeform.sourceTaskNotFound` — source task id does not resolve
@@ -10245,23 +10323,17 @@ var FreeformOutput = _Object_({
10245
10323
  * 2. `freeform.sourceTaskTypeNotSupported` — source isn't `freeform`.
10246
10324
  * v1 only supports freeform → freeform continuation.
10247
10325
  * 3. `freeform.sourceAttemptNotCompleted` — named attempt is missing
10248
- * or not in `completed` state; warm continuation only makes sense
10326
+ * or not in `completed` state; continuation only makes sense
10249
10327
  * once the parent has produced a terminal output.
10250
10328
  * 4. `freeform.executionWorkspaceNotInheritable` — caller set
10251
10329
  * `execution.workspace` together with `continueFrom`. Workspace
10252
- * mode for a continuation is inherited from the parent slot
10253
- * (`maybeAttachWarmSlotContext` forces `dedicated_worktree` +
10254
- * the parent's worktreeBranch), so any caller-supplied override
10255
- * is silently dropped at the daemon plan stage. Reject explicitly
10256
- * so misconfiguration surfaces at create time.
10257
- * 5. `freeform.sourceNotResumeEligible` — `daemonState` is null or
10258
- * `slotResumableUntil` is null. Older completions (pre-#1287) and
10259
- * daemons that opt out fall here.
10260
- * 6. `freeform.sourceResumeExpired` — `slotResumableUntil` is in the
10261
- * past; the warm slot's TTL has elapsed and no daemon is
10262
- * guaranteed to still hold it.
10330
+ * mode for a continuation is derived by the daemon from parent runtime
10331
+ * context (local slot first, durable session + source attempt branch
10332
+ * second), so any caller-supplied override is silently dropped at the
10333
+ * daemon plan stage. Reject explicitly so misconfiguration surfaces at
10334
+ * create time.
10263
10335
  *
10264
- * Returns on the first failure (no "report all six") — the checks
10336
+ * Returns on the first failure — the checks
10265
10337
  * are sequential preconditions, later ones presume earlier ones hold.
10266
10338
  */
10267
10339
  async function validateFreeformInputAsync(input, ctx) {
@@ -10280,7 +10352,7 @@ async function validateFreeformInputAsync(input, ctx) {
10280
10352
  }];
10281
10353
  if (input.execution?.workspace) return [{
10282
10354
  field: "input/execution/workspace",
10283
- message: "execution.workspace is inherited from the parent slot when continueFrom is set; omit it",
10355
+ message: "execution.workspace is derived from parent runtime context when continueFrom is set; omit it",
10284
10356
  code: "freeform.executionWorkspaceNotInheritable"
10285
10357
  }];
10286
10358
  if (ctx.deferReadinessChecks) return [];
@@ -10290,17 +10362,6 @@ async function validateFreeformInputAsync(input, ctx) {
10290
10362
  message: `Source attempt ${cf.attemptN} on task ${cf.taskId} is not in 'completed' state`,
10291
10363
  code: "freeform.sourceAttemptNotCompleted"
10292
10364
  }];
10293
- if (!attempt.daemonState || attempt.daemonState.slotResumableUntil === null) return [{
10294
- field: "input/continueFrom",
10295
- message: "Source attempt did not report continuation eligibility (older completion or daemon opted out)",
10296
- code: "freeform.sourceNotResumeEligible"
10297
- }];
10298
- const expiresAt = new Date(attempt.daemonState.slotResumableUntil).getTime();
10299
- if (Number.isNaN(expiresAt) || expiresAt <= Date.now()) return [{
10300
- field: "input/continueFrom",
10301
- message: `Source attempt's warm slot expired at ${attempt.daemonState.slotResumableUntil} (reported at ${attempt.daemonState.reportedAt})`,
10302
- code: "freeform.sourceResumeExpired"
10303
- }];
10304
10365
  return [];
10305
10366
  }
10306
10367
  //#endregion
@@ -13635,11 +13696,12 @@ var MAX_CLAIM_CONDITION_STATUSES = 8;
13635
13696
  /**
13636
13697
  * Daemon-asserted runtime state stamped onto a `TaskAttemptSummary` at
13637
13698
  * attempt-completion time. The server persists this block verbatim and
13638
- * reads `slotResumableUntil` for `tasks_continue` create-time
13639
- * eligibility; the daemon-side claim-affinity filter is the runtime
13640
- * truth. The block carries its own `reportedAt` so consumers can reason
13641
- * about staleness without reading documentation. All daemon-asserted
13642
- * state lives here — top-level attempt fields stay server-authoritative.
13699
+ * exposes `slotResumableUntil` as a legacy/local warm-slot hint; task
13700
+ * continuation eligibility is based on the completed source attempt and
13701
+ * daemon-side claim-affinity/runtime-session recovery. The block carries
13702
+ * its own `reportedAt` so consumers can reason about staleness without
13703
+ * reading documentation. All daemon-asserted state lives here
13704
+ * top-level attempt fields stay server-authoritative.
13643
13705
  *
13644
13706
  * Adding new fields requires explicit design review (intentional
13645
13707
  * boundary; see docs/superpowers/specs/2026-06-04-tasks-continue-design.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/node-red-contrib-core",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "description": "Node-RED nodes for the MoltNet API",
6
6
  "keywords": [
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "main": "dist/nodes/agent.js",
40
40
  "dependencies": {
41
- "@themoltnet/sdk": "0.113.1"
41
+ "@themoltnet/sdk": "0.114.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.19.0",