@ordewell/core 0.10.2 → 0.10.4

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 (45) hide show
  1. package/dist/{IFileSystem-CyTIoiSn.d.ts → IFileSystem-_effm8-b.d.ts} +1 -1
  2. package/dist/{IFileSystem-j0naIoAQ.d.mts → IFileSystem-vyqMdL-x.d.mts} +1 -1
  3. package/dist/{IRunner---PfQVdc.d.mts → IRunner-D_UkkMbJ.d.ts} +202 -196
  4. package/dist/{IRunner-WwL-Bjqq.d.ts → IRunner-NtTHQgLR.d.mts} +202 -196
  5. package/dist/{ModeResolver-DrMU-5lw.d.ts → ModeResolver-Dy3Ef6p-.d.ts} +1 -1
  6. package/dist/{ModeResolver-CjQ7zqTN.d.mts → ModeResolver-wnTFsDnF.d.mts} +1 -1
  7. package/dist/{Task-AfA1m4qW.d.mts → Task-DZs9eKgg.d.mts} +25 -6
  8. package/dist/{Task-AfA1m4qW.d.ts → Task-DZs9eKgg.d.ts} +25 -6
  9. package/dist/{chunk-4FEARWTS.mjs → chunk-645FALZX.mjs} +5 -5
  10. package/dist/chunk-645FALZX.mjs.map +1 -0
  11. package/dist/{chunk-3LNZDBCX.mjs → chunk-A57ITQE7.mjs} +35 -16
  12. package/dist/chunk-A57ITQE7.mjs.map +1 -0
  13. package/dist/{chunk-UQGR3UCA.mjs → chunk-FH6M5QZG.mjs} +136 -122
  14. package/dist/chunk-FH6M5QZG.mjs.map +1 -0
  15. package/dist/{chunk-CIL3BQIF.mjs → chunk-SM6BV6XS.mjs} +17 -3
  16. package/dist/chunk-SM6BV6XS.mjs.map +1 -0
  17. package/dist/index.d.mts +427 -40
  18. package/dist/index.d.ts +427 -40
  19. package/dist/index.js +2589 -1498
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +10799 -9764
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/parsing.d.mts +2 -2
  24. package/dist/parsing.d.ts +2 -2
  25. package/dist/parsing.js +12 -12
  26. package/dist/parsing.js.map +1 -1
  27. package/dist/parsing.mjs +3 -3
  28. package/dist/{plan-utils-DL7yOuJs.d.mts → plan-utils-CtKceSsQ.d.mts} +1292 -1147
  29. package/dist/{plan-utils-gpeqV-Lp.d.ts → plan-utils-POIz5d8z.d.ts} +1292 -1147
  30. package/dist/plan-utils.d.mts +4 -4
  31. package/dist/plan-utils.d.ts +4 -4
  32. package/dist/plan-utils.js +16 -0
  33. package/dist/plan-utils.js.map +1 -1
  34. package/dist/plan-utils.mjs +7 -3
  35. package/dist/testing.d.mts +3 -3
  36. package/dist/testing.d.ts +3 -3
  37. package/dist/testing.js +3 -1
  38. package/dist/testing.js.map +1 -1
  39. package/dist/testing.mjs +4 -2
  40. package/dist/testing.mjs.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-3LNZDBCX.mjs.map +0 -1
  43. package/dist/chunk-4FEARWTS.mjs.map +0 -1
  44. package/dist/chunk-CIL3BQIF.mjs.map +0 -1
  45. package/dist/chunk-UQGR3UCA.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { a1 as RunnerId, ae as Task } from './Task-AfA1m4qW.mjs';
2
- import { R as RunnerModeInfo } from './ModeResolver-CjQ7zqTN.mjs';
1
+ import { a2 as RunnerId, af as Task } from './Task-DZs9eKgg.mjs';
2
+ import { R as RunnerModeInfo } from './ModeResolver-wnTFsDnF.mjs';
3
3
 
4
4
  declare function parsePlanJson(raw: string, runners: RunnerId[], runnerModes?: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean): Task[];
5
5
 
package/dist/parsing.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a1 as RunnerId, ae as Task } from './Task-AfA1m4qW.js';
2
- import { R as RunnerModeInfo } from './ModeResolver-DrMU-5lw.js';
1
+ import { a2 as RunnerId, af as Task } from './Task-DZs9eKgg.js';
2
+ import { R as RunnerModeInfo } from './ModeResolver-Dy3Ef6p-.js';
3
3
 
4
4
  declare function parsePlanJson(raw: string, runners: RunnerId[], runnerModes?: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean): Task[];
5
5
 
package/dist/parsing.js CHANGED
@@ -274,7 +274,7 @@ function plannedMode(runner, runnerModes, { readOnly, current }, autonomousDefau
274
274
  const reason2 = unavailableModeReason(modes, taggedReadOnlyMode(modes));
275
275
  return {
276
276
  ok: false,
277
- error: `Runner "${runner}" has no read-only mode${reason2 ? " available on this host" : ""} \u2014 assign a read-only task to ${able.length > 0 ? `one of: ${able.join(", ")}` : "no runner: none of the enabled runners has one"}, or drop "readOnly"${reason2 ? `. ${reason2}` : ""}`
277
+ error: `Runner "${runner}" has no read-only mode${reason2 ? " available on this host" : ""}: assign a read-only task to ${able.length > 0 ? `one of: ${able.join(", ")}` : "no runner: none of the enabled runners has one"}, or drop "readOnly"${reason2 ? `. ${reason2}` : ""}`
278
278
  };
279
279
  }
280
280
  const keep = current !== void 0 && modes.some((m) => m.id === current) && !(readOnly === false && current === taggedReadOnlyMode(modes));
@@ -320,7 +320,7 @@ function checkModelAndModeValidity(runner, assignedModel, taskMode, catalog) {
320
320
  if (taskMode !== void 0) {
321
321
  const modes = catalog.runnerModes[runner];
322
322
  if (modes && modes.length > 0 && !modes.some((m) => m.id === taskMode)) {
323
- return { ok: false, error: `Runner "${runner}" has no task mode "${taskMode}" \u2014 valid modes: ${modes.map((m) => m.id).join(", ")}` };
323
+ return { ok: false, error: `Runner "${runner}" has no task mode "${taskMode}": valid modes: ${modes.map((m) => m.id).join(", ")}` };
324
324
  }
325
325
  const unavailable = unavailableModeReason(modes, taskMode);
326
326
  if (unavailable) return { ok: false, error: `Mode "${taskMode}" of runner "${runner}" is unavailable on this host: ${unavailable}` };
@@ -329,9 +329,9 @@ function checkModelAndModeValidity(runner, assignedModel, taskMode, catalog) {
329
329
  }
330
330
 
331
331
  // src/services/PlannedTask.ts
332
- var MODE_NOT_THE_PLANNERS = `"taskMode" is the user's to choose \u2014 set "readOnly": true on a task that must not change files, and leave it out otherwise`;
333
- var MANUAL_NOT_READ_ONLY = '"readOnly" is for AI tasks \u2014 a manual task runs in no mode';
334
- var OPS_NOT_READ_ONLY = `"readOnly" is not for an ops task \u2014 it runs commands, in the session's mode, and a read-only mode refuses them`;
332
+ var MODE_NOT_THE_PLANNERS = `"taskMode" is the user's to choose: set "readOnly": true on a task that must not change files, and leave it out otherwise`;
333
+ var MANUAL_NOT_READ_ONLY = '"readOnly" is for AI tasks: a manual task runs in no mode';
334
+ var OPS_NOT_READ_ONLY = `"readOnly" is not for an ops task: it runs commands, in the session's mode, and a read-only mode refuses them`;
335
335
  function isRecord(value) {
336
336
  return typeof value === "object" && value !== null && !Array.isArray(value);
337
337
  }
@@ -339,8 +339,8 @@ function text(value) {
339
339
  return typeof value === "string" || typeof value === "number" ? String(value) : void 0;
340
340
  }
341
341
  function opsPlacementRefusal(type, isSubtask) {
342
- if (type !== "ai") return "is a manual task \u2014 only an AI task can be an ops task";
343
- if (isSubtask) return "is a subtask, which runs with its parent \u2014 only a top-level task can be an ops task";
342
+ if (type !== "ai") return "is a manual task: only an AI task can be an ops task";
343
+ if (isSubtask) return "is a subtask, which runs with its parent: only a top-level task can be an ops task";
344
344
  return null;
345
345
  }
346
346
  function taskWhere(title, parentTitle) {
@@ -361,7 +361,7 @@ function modelOf(raw, from) {
361
361
  }
362
362
  function plannedTask(spec, catalog, at = {}) {
363
363
  const raw = isRecord(spec) ? spec : {};
364
- const { parent, from, freshIds } = at;
364
+ const { parent, from, freshIds, newId = import_uuid2.v4 } = at;
365
365
  const base = from?.fields ?? {};
366
366
  const errors = [];
367
367
  const ignored = [];
@@ -369,7 +369,7 @@ function plannedTask(spec, catalog, at = {}) {
369
369
  const title = text(raw.title) ?? "";
370
370
  const where = taskWhere(title, parent?.title);
371
371
  const plannerId = text(raw.id);
372
- const id = freshIds || !plannerId ? (0, import_uuid2.v4)() : plannerId;
372
+ const id = freshIds || !plannerId ? newId() : plannerId;
373
373
  if (freshIds && plannerId) renamed.set(plannerId, id);
374
374
  const type = raw.type === "user" || raw.type === "ai" ? raw.type : base.type ?? "ai";
375
375
  const ai = type === "ai";
@@ -400,7 +400,7 @@ function plannedTask(spec, catalog, at = {}) {
400
400
  const subtasks = [];
401
401
  if (Array.isArray(raw.subtasks)) {
402
402
  for (const s of raw.subtasks) {
403
- const child = plannedTask(s, catalog, { parent: { title, sliceType, autonomy, readOnly }, freshIds });
403
+ const child = plannedTask(s, catalog, { parent: { title, sliceType, autonomy, readOnly }, freshIds, newId });
404
404
  subtasks.push(child.task);
405
405
  errors.push(...child.errors);
406
406
  ignored.push(...child.ignored);
@@ -499,7 +499,7 @@ function parsePlanJson(raw, runners, runnerModes, autonomousDefault = true) {
499
499
  }
500
500
  if (matches.length === 0 && sawUnbalanced) {
501
501
  throw new PlanParseError(
502
- "Plan response appears truncated \u2014 the model likely hit its output length limit before finishing the JSON.",
502
+ "Plan response appears truncated: the model likely hit its output length limit before finishing the JSON.",
503
503
  raw,
504
504
  { truncated: true }
505
505
  );
@@ -539,7 +539,7 @@ function validatePlanTasks(obj, runners, runnerModes, autonomousDefault = true)
539
539
  const ignored = planned.flatMap((p) => p.ignored);
540
540
  const warnings = [
541
541
  ...ignored.some((i) => i.field === "taskMode") ? [`"taskMode" is not yours to set and was ignored: each task runs in its runner's mode for the user's autonomy level, or its read-only mode when you set "readOnly": true.`] : [],
542
- ...ignored.filter((i) => i.field === "readOnly").map((i) => `${i.message} \u2014 it was ignored.`)
542
+ ...ignored.filter((i) => i.field === "readOnly").map((i) => `${i.message}: it was ignored.`)
543
543
  ];
544
544
  return warnings.length > 0 ? { ok: true, tasks, warnings } : { ok: true, tasks };
545
545
  }