feat(environment): serve query numbers, counted values and made objects

- A query parameter accepts a number or boolean, which serving sends as its
  JSON text, as agents send page sizes and flags.
- A sequence may start at the value its first create took above every value
  its type held (Vikunja's per-project task index), and a later create's
  composed, template or started-sequence rule is adopted when it also spells
  the first create's value.
- A made-object rule explains an object the application makes with each
  created entity: members the request stamped, members holding the entity's
  own id, and counts one past the held objects' values.
- A create's answer names the id of the one object a one-element array member
  holds, so bulk creates link to their type.
- The skill reads each listed object by id before writing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Edgar ArakelyanandClaude Opus 5.5 committed 2026-10-26 15:48:57 -07:00
1 parent 4ede130550
commit c0cbf95c9c
29 files changed
+831 -38

No files matched your search

@@ -18,7 +18,10 @@ import {
} from "../../domain/analysisView/environmentStateWriteExplain.js";
import { callRenewal } from "../../domain/analysisView/environmentStateWriteGenerated.js";
import {
heldObjects,
madeObjectValue,
nestedClockValue,
nextMadeCount,
unenveloped,
} from "../../domain/analysisView/environmentStateWriteStamps.js";
import {
@@ -38,6 +41,7 @@ import {
seededInteger,
seededLike,
spelledLike,
startedSequence,
} from "../../domain/analysisView/environmentStateWriteValues.js";
import {
ownMember,
@@ -283,16 +287,41 @@ export const generator = (
exemplar,
sequence(
`${request.tool.name} ${rule.field} ${rule.scope === "collection" ? target.name : ""}`,
nextHeld(
rule.scope === "collection"
? [...target.collection, ...startedIn(target.name)]
: [...ofType, ...started],
rule.field,
exemplar,
startedSequence(
nextHeld(
rule.scope === "collection"
? [...target.collection, ...startedIn(target.name)]
: [...ofType, ...started],
rule.field,
exemplar,
),
rule.start,
),
),
),
);
case "made-object": {
const clock = formatClock(write.clockMs, rule.format);
if (clock === undefined)
return err(
`The generated clock for ${rule.field} is outside its recorded four-digit year format.`,
);
const base = ownMember(target.observed, rule.field);
const held = heldObjects(
[...ofType, ...started].map((entity) => entity.fields),
rule.field,
);
return madeObjectValue(base, rule, clock, (count) =>
sequence(
`${request.tool.name} ${rule.field}/${count.member}`,
nextMadeCount(
held,
count,
isObject(base) ? ownMember(base, count.member) : undefined,
),
),
);
}
case "unique":
return unused(rule.field, (attempt) =>
generatedIntegerDigits(exemplar) === undefined