@ordewell/core 0.10.2 → 0.10.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/{IFileSystem-j0naIoAQ.d.mts → IFileSystem-B8Nkgg4e.d.mts} +1 -1
- package/dist/{IFileSystem-CyTIoiSn.d.ts → IFileSystem-DCd-rkeH.d.ts} +1 -1
- package/dist/{IRunner-WwL-Bjqq.d.ts → IRunner-CXdYyIZo.d.mts} +202 -196
- package/dist/{IRunner---PfQVdc.d.mts → IRunner-QBdYcatb.d.ts} +202 -196
- package/dist/{ModeResolver-DrMU-5lw.d.ts → ModeResolver-BOU90Nn-.d.ts} +1 -1
- package/dist/{ModeResolver-CjQ7zqTN.d.mts → ModeResolver-geqjKkLY.d.mts} +1 -1
- package/dist/{Task-AfA1m4qW.d.mts → Task-CRVIqSfy.d.mts} +24 -5
- package/dist/{Task-AfA1m4qW.d.ts → Task-CRVIqSfy.d.ts} +24 -5
- package/dist/{chunk-4FEARWTS.mjs → chunk-645FALZX.mjs} +5 -5
- package/dist/chunk-645FALZX.mjs.map +1 -0
- package/dist/{chunk-3LNZDBCX.mjs → chunk-A57ITQE7.mjs} +35 -16
- package/dist/chunk-A57ITQE7.mjs.map +1 -0
- package/dist/{chunk-UQGR3UCA.mjs → chunk-FH6M5QZG.mjs} +136 -122
- package/dist/chunk-FH6M5QZG.mjs.map +1 -0
- package/dist/{chunk-CIL3BQIF.mjs → chunk-SM6BV6XS.mjs} +17 -3
- package/dist/chunk-SM6BV6XS.mjs.map +1 -0
- package/dist/index.d.mts +417 -39
- package/dist/index.d.ts +417 -39
- package/dist/index.js +2478 -1473
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10702 -9753
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js +12 -12
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/{plan-utils-DL7yOuJs.d.mts → plan-utils-KU1Rse82.d.mts} +1292 -1147
- package/dist/{plan-utils-gpeqV-Lp.d.ts → plan-utils-oC8bO4pN.d.ts} +1292 -1147
- package/dist/plan-utils.d.mts +4 -4
- package/dist/plan-utils.d.ts +4 -4
- package/dist/plan-utils.js +16 -0
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +7 -3
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +3 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +4 -2
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3LNZDBCX.mjs.map +0 -1
- package/dist/chunk-4FEARWTS.mjs.map +0 -1
- package/dist/chunk-CIL3BQIF.mjs.map +0 -1
- package/dist/chunk-UQGR3UCA.mjs.map +0 -1
package/dist/parsing.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as RunnerModeInfo } from './ModeResolver-
|
|
1
|
+
import { a2 as RunnerId, af as Task } from './Task-CRVIqSfy.mjs';
|
|
2
|
+
import { R as RunnerModeInfo } from './ModeResolver-geqjKkLY.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 {
|
|
2
|
-
import { R as RunnerModeInfo } from './ModeResolver-
|
|
1
|
+
import { a2 as RunnerId, af as Task } from './Task-CRVIqSfy.js';
|
|
2
|
+
import { R as RunnerModeInfo } from './ModeResolver-BOU90Nn-.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" : ""}
|
|
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}"
|
|
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
|
|
333
|
-
var MANUAL_NOT_READ_ONLY = '"readOnly" is for AI tasks
|
|
334
|
-
var OPS_NOT_READ_ONLY = `"readOnly" is not for an ops task
|
|
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
|
|
343
|
-
if (isSubtask) return "is a subtask, which runs with its parent
|
|
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 ? (
|
|
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
|
|
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}
|
|
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
|
}
|