@treeseed/sdk 0.13.0-rc.116 → 0.13.0-rc.117
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/.treeseed-build-complete.json +1 -1
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +2 -2
- package/dist/operator-contracts/canonical-command-tree.js +3 -2
- package/dist/operator-contracts/catalog/workdays/selection-commands.d.ts +3 -0
- package/dist/operator-contracts/catalog/workdays/selection-commands.js +15 -0
- package/dist/operator-contracts/command-tree.d.ts +1 -0
- package/dist/operator-contracts/workday-lifecycle.d.ts +5 -0
- package/dist/operator-contracts/workday-lifecycle.js +25 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"completedAt":"2026-09-
|
|
1
|
+
{"completedAt":"2026-09-11T13:05:00.879Z"}
|
|
@@ -157,6 +157,7 @@ export declare const agentForensicPayloadSchema: z.ZodObject<{
|
|
|
157
157
|
severity: "error" | "warning" | "info";
|
|
158
158
|
}>, "many">>;
|
|
159
159
|
}, "strict", z.ZodTypeAny, {
|
|
160
|
+
activity: AgentActivityEvent;
|
|
160
161
|
diagnostics: {
|
|
161
162
|
code: string;
|
|
162
163
|
path: string;
|
|
@@ -164,7 +165,6 @@ export declare const agentForensicPayloadSchema: z.ZodObject<{
|
|
|
164
165
|
severity: "error" | "warning" | "info";
|
|
165
166
|
}[];
|
|
166
167
|
contract: "treeseed.agent-forensic-payload/v1";
|
|
167
|
-
activity: AgentActivityEvent;
|
|
168
168
|
payload?: Record<string, unknown> | undefined;
|
|
169
169
|
transcript?: {
|
|
170
170
|
entries: Record<string, unknown>[];
|
|
@@ -177,8 +177,8 @@ export declare const agentForensicPayloadSchema: z.ZodObject<{
|
|
|
177
177
|
redactionStatus: "sanitized" | "partially-redacted" | "withheld";
|
|
178
178
|
} | undefined;
|
|
179
179
|
}, {
|
|
180
|
-
contract: "treeseed.agent-forensic-payload/v1";
|
|
181
180
|
activity: AgentActivityEvent;
|
|
181
|
+
contract: "treeseed.agent-forensic-payload/v1";
|
|
182
182
|
payload?: Record<string, unknown> | undefined;
|
|
183
183
|
diagnostics?: {
|
|
184
184
|
code: string;
|
|
@@ -2,6 +2,7 @@ import { commandPaths } from "./catalog/infrastructure/command-tree-paths.js";
|
|
|
2
2
|
import { managedSecretCommands } from "./catalog/services/secret-commands.js";
|
|
3
3
|
import { identityLoginCommand } from "./catalog/services/identity-commands.js";
|
|
4
4
|
import { WORKDAY_PROFILE_COMMAND_BINDINGS } from "./catalog/workdays/profile-commands.js";
|
|
5
|
+
import { WORKDAY_PLAN_OPTIONS, WORKDAY_SELECTION_INPUTS } from "./catalog/workdays/selection-commands.js";
|
|
5
6
|
import { hostProviderEnvironmentBranch, PROVIDER_ENVIRONMENT_COMMAND_BINDINGS, providerEnvironmentBranches } from "./catalog/provider-environment-commands.js";
|
|
6
7
|
const unavailable = (reason = "This capability is not enabled until its control-plane operation is accepted.") => ({
|
|
7
8
|
kind: "unavailable",
|
|
@@ -132,7 +133,7 @@ const operationBindings = {
|
|
|
132
133
|
"seeds verify": operation("seeds.verify", [field("path", "name", "argument", "seed", true)]),
|
|
133
134
|
"plans list": operation("plans.list", [field("path", "decisionId", "option", "decision", true), ...page()]),
|
|
134
135
|
"plans show": operation("plans.show", [field("path", "capacityPlanId", "argument", "plan", true)]),
|
|
135
|
-
"workdays plan": operation("workdays.plan", [field("path", "teamId", "context", "team", true), field("body", "profileId", "option", "profile"), field("body", "projects", "option", "projects", false, "csv"), field("body", "startsAt", "option", "start"), field("body", "endsAt", "option", "end"), field("body", "durationSeconds", "option", "duration", false, "integer"), field("body", "objectiveFilters", "option", "objective", false, "csv")]),
|
|
136
|
+
"workdays plan": operation("workdays.plan", [field("path", "teamId", "context", "team", true), field("body", "profileId", "option", "profile"), field("body", "projects", "option", "projects", false, "csv"), field("body", "startsAt", "option", "start"), field("body", "endsAt", "option", "end"), field("body", "durationSeconds", "option", "duration", false, "integer"), field("body", "objectiveFilters", "option", "objective", false, "csv"), ...WORKDAY_SELECTION_INPUTS]),
|
|
136
137
|
...WORKDAY_PROFILE_COMMAND_BINDINGS,
|
|
137
138
|
"workdays start": operation("workdays.start", [field("path", "teamId", "context", "team", true), field("body", "preflightId", "option", "preflight", true), field("body", "preflightDigest", "option", "digest", true)]),
|
|
138
139
|
"workdays list": operation("workdays.list", [field("path", "teamId", "context", "team", true), ...page()]),
|
|
@@ -457,7 +458,7 @@ const commandTree = {
|
|
|
457
458
|
branch("plans", [leaf("list"), leaf("show", "read", "plan"), leaf("explain", "read", "plan"), { nodeType: "leaf", segment: "diff", description: "Compare two API-derived plans.", kind: "read", arguments: [{ name: "left", description: "Left plan identity.", required: true }, { name: "right", description: "Right plan identity.", required: true }], resultSchemaId: "treeseed.command.plans.diff/v1", execution: unavailable() }]),
|
|
458
459
|
branch("workdays", [
|
|
459
460
|
branch("profiles", [leaf("list"), leaf("show", "read", "profile"), leaf("reconcile", "mutation", "project", "authority"), leaf("validate", "read", "file")]),
|
|
460
|
-
leaf("plan", "mutation"),
|
|
461
|
+
{ ...leaf("plan", "mutation"), nodeType: "leaf", segment: "plan", kind: "mutation", description: "Plan a workday with optional targeted cooperative planning; acting stays decision-governed.", resultSchemaId: "treeseed.command.workdays.plan/v1", options: WORKDAY_PLAN_OPTIONS },
|
|
461
462
|
leaf("start", "mutation", void 0, "authority"),
|
|
462
463
|
leaf("list"),
|
|
463
464
|
leaf("show", "read", "workday"),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const WORKDAY_SELECTION_INPUTS = [
|
|
2
|
+
{ target: "body", field: "agentSelection.agentSlugs", source: "option", name: "agent", transform: "csv" },
|
|
3
|
+
{ target: "body", field: "agentSelection.activityTypes", source: "option", name: "activity", transform: "csv" },
|
|
4
|
+
{ target: "body", field: "agentSelection.classSlugs", source: "option", name: "class", transform: "csv" }
|
|
5
|
+
];
|
|
6
|
+
const WORKDAY_PLAN_OPTIONS = [
|
|
7
|
+
{ name: "--plan", description: "Return the request without creating a preflight.", type: "boolean" },
|
|
8
|
+
{ name: "--agent", description: "Planning agent slug; repeat or comma-separate. Intersects with class/activity selectors.", type: "string[]" },
|
|
9
|
+
{ name: "--activity", description: "Planning activity: planning, estimating, reviewing, reporting, or chat; repeat or comma-separate.", type: "string[]" },
|
|
10
|
+
{ name: "--class", description: "Planning class slug; repeat or comma-separate. Acting remains governed by accepted decisions.", type: "string[]" }
|
|
11
|
+
];
|
|
12
|
+
export {
|
|
13
|
+
WORKDAY_PLAN_OPTIONS,
|
|
14
|
+
WORKDAY_SELECTION_INPUTS
|
|
15
|
+
};
|
|
@@ -23,6 +23,7 @@ export interface CommandAuthorizationDescriptor {
|
|
|
23
23
|
export type CommandInputSource = 'argument' | 'context' | 'option';
|
|
24
24
|
export type CommandInputTarget = 'path' | 'query' | 'body';
|
|
25
25
|
export interface CommandInputBinding {
|
|
26
|
+
/** Dot-separated object path in the selected target; unsafe prototype keys are forbidden. */
|
|
26
27
|
field: string;
|
|
27
28
|
source: CommandInputSource;
|
|
28
29
|
name: string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type WorkdayBorrowingEvidence } from './workday-profile.js';
|
|
2
|
+
import type { WorkdayAgentSelection } from '../agent-capacity/workday.js';
|
|
3
|
+
export { normalizeWorkdayAgentSelection } from '../agent-capacity/workday.js';
|
|
2
4
|
export type WorkdayDemandMode = 'planning' | 'acting';
|
|
3
5
|
export interface WorkdayIntent {
|
|
4
6
|
schemaVersion: 'treeseed.workday-intent/v1';
|
|
@@ -9,6 +11,8 @@ export interface WorkdayIntent {
|
|
|
9
11
|
endsAt?: string;
|
|
10
12
|
durationSeconds?: number;
|
|
11
13
|
objectiveFilters?: string[];
|
|
14
|
+
/** Limits cooperative planning; acting still requires accepted decision/estimate authority. */
|
|
15
|
+
agentSelection?: Partial<WorkdayAgentSelection>;
|
|
12
16
|
operatorConstraints?: {
|
|
13
17
|
providerIds?: string[];
|
|
14
18
|
maxConcurrency?: number;
|
|
@@ -151,6 +155,7 @@ export interface WorkdayLifecycleDiagnostic {
|
|
|
151
155
|
message: string;
|
|
152
156
|
}
|
|
153
157
|
export declare function validateWorkdayIntent(intent: WorkdayIntent): WorkdayLifecycleDiagnostic[];
|
|
158
|
+
export declare function validateWorkdayIntentSelection(value: unknown): WorkdayLifecycleDiagnostic[];
|
|
154
159
|
export declare function validateSelectedDemand(demand: WorkdaySelectedDemand): WorkdayLifecycleDiagnostic[];
|
|
155
160
|
export declare function validateWorkdayPreflight(receipt: WorkdayPreflightReceipt, now?: Date): WorkdayLifecycleDiagnostic[];
|
|
156
161
|
export declare function validateWorkdayPreflightFreshness(receipt: WorkdayPreflightReceipt, observed: WorkdayPreflightObservation): WorkdayLifecycleDiagnostic[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validateWorkdayBorrowingEvidence } from "./workday-profile.js";
|
|
2
|
+
import { normalizeWorkdayAgentSelection } from "../agent-capacity/workday.js";
|
|
2
3
|
function validateWorkdayIntent(intent) {
|
|
3
4
|
const diagnostics = [];
|
|
4
5
|
if (intent.schemaVersion !== "treeseed.workday-intent/v1") diagnostics.push({ code: "schema_version_invalid", path: "schemaVersion", message: "Unsupported workday intent schema." });
|
|
@@ -9,6 +10,28 @@ function validateWorkdayIntent(intent) {
|
|
|
9
10
|
if (!Number.isFinite(start)) diagnostics.push({ code: "start_invalid", path: "startsAt", message: "startsAt must be an ISO timestamp." });
|
|
10
11
|
if (intent.endsAt !== void 0 && (!Number.isFinite(Date.parse(intent.endsAt)) || Date.parse(intent.endsAt) <= start)) diagnostics.push({ code: "end_invalid", path: "endsAt", message: "endsAt must be a valid timestamp after startsAt." });
|
|
11
12
|
if (intent.durationSeconds !== void 0 && (!Number.isInteger(intent.durationSeconds) || intent.durationSeconds <= 0)) diagnostics.push({ code: "duration_invalid", path: "durationSeconds", message: "durationSeconds must be a positive integer." });
|
|
13
|
+
if (intent.agentSelection !== void 0) diagnostics.push(...validateWorkdayIntentSelection(intent.agentSelection));
|
|
14
|
+
return diagnostics;
|
|
15
|
+
}
|
|
16
|
+
function validateWorkdayIntentSelection(value) {
|
|
17
|
+
const invalid = (path, message) => ({ code: "agent_selection_invalid", path: `agentSelection${path ? `.${path}` : ""}`, message });
|
|
18
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [invalid("", "Agent selection must be an object.")];
|
|
19
|
+
const selection = value, diagnostics = [];
|
|
20
|
+
const fields = ["classIds", "classSlugs", "agentSlugs", "activityTypes"];
|
|
21
|
+
for (const key of Object.keys(selection)) if (![...fields, "mode"].includes(key)) diagnostics.push(invalid(key, "Unknown selection field."));
|
|
22
|
+
if (selection.mode !== void 0 && !["intersection", "union"].includes(String(selection.mode))) diagnostics.push(invalid("mode", "Select intersection or union."));
|
|
23
|
+
let selected = 0;
|
|
24
|
+
for (const field of fields) {
|
|
25
|
+
const entries = selection[field];
|
|
26
|
+
if (entries === void 0) continue;
|
|
27
|
+
if (!Array.isArray(entries) || entries.length > 128 || entries.some((entry) => typeof entry !== "string" || !entry.trim() || entry.length > 128)) {
|
|
28
|
+
diagnostics.push(invalid(field, "Selectors must be a bounded array of nonempty strings."));
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
selected += entries.length;
|
|
32
|
+
if (field === "activityTypes" && entries.some((entry) => !["planning", "estimating", "reviewing", "reporting", "chat"].includes(String(entry).trim()))) diagnostics.push(invalid(field, "Select a planning activity; acting is controlled by accepted decisions and estimates."));
|
|
33
|
+
}
|
|
34
|
+
if (!selected) diagnostics.push(invalid("", "Explicit selection must select an agent, class, or activity; omit it to select all."));
|
|
12
35
|
return diagnostics;
|
|
13
36
|
}
|
|
14
37
|
function validateSelectedDemand(demand) {
|
|
@@ -57,8 +80,10 @@ function validateWorkdaySettlement(settlement) {
|
|
|
57
80
|
return diagnostics;
|
|
58
81
|
}
|
|
59
82
|
export {
|
|
83
|
+
normalizeWorkdayAgentSelection,
|
|
60
84
|
validateSelectedDemand,
|
|
61
85
|
validateWorkdayIntent,
|
|
86
|
+
validateWorkdayIntentSelection,
|
|
62
87
|
validateWorkdayPreflight,
|
|
63
88
|
validateWorkdayPreflightFreshness,
|
|
64
89
|
validateWorkdaySettlement
|