@treeseed/sdk 0.13.0-rc.119 → 0.13.0-rc.120

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 (53) hide show
  1. package/dist/.treeseed-build-complete.json +1 -1
  2. package/dist/agent-capacity/allocation.d.ts +0 -3
  3. package/dist/agent-capacity/allocation.js +0 -221
  4. package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +280 -84
  5. package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.js +22 -1
  6. package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +5 -0
  7. package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.d.ts +82 -0
  8. package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.js +115 -0
  9. package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.d.ts +142 -0
  10. package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.js +51 -0
  11. package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.d.ts +167 -35
  12. package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.js +59 -20
  13. package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +2 -21
  14. package/dist/agent-capacity/contracts/support/execution-graph.d.ts +18 -18
  15. package/dist/agent-capacity/contracts/support/time-capacity.d.ts +0 -14
  16. package/dist/agent-capacity/contracts/support/time-capacity.js +1 -8
  17. package/dist/agent-capacity/validation/agent-definition-schema.d.ts +338 -338
  18. package/dist/capacity/agents/agent-capacity.d.ts +2 -0
  19. package/dist/capacity/agents/agent-capacity.js +2 -0
  20. package/dist/capacity-provider/client.d.ts +5 -3
  21. package/dist/capacity-provider/contracts/capacity-facts.d.ts +14 -0
  22. package/dist/capacity-provider/contracts/governance.d.ts +6 -0
  23. package/dist/capacity-provider/sandbox-contracts.d.ts +55 -1
  24. package/dist/capacity-provider/sandbox-contracts.js +4 -0
  25. package/dist/capacity-provider/source-workspace.d.ts +69 -37
  26. package/dist/capacity-provider/source-workspace.js +36 -5
  27. package/dist/content/validation/auxiliary-content-schemas.d.ts +10 -10
  28. package/dist/content/validation/content-model-schemas.d.ts +613 -613
  29. package/dist/content/validation/content-model-schemas.js +14 -2
  30. package/dist/content/validation/portable-content-data.d.ts +22 -22
  31. package/dist/deployment/postgres/requirements.d.ts +3 -2
  32. package/dist/deployment/postgres/requirements.js +3 -1
  33. package/dist/operator-contracts/canonical-command-tree.js +20 -6
  34. package/dist/operator-contracts/catalog/communication-operations.d.ts +2 -0
  35. package/dist/operator-contracts/catalog/workdays/profile-commands.js +4 -4
  36. package/dist/operator-contracts/catalog/workdays/profile-operations.d.ts +28 -3
  37. package/dist/operator-contracts/catalog/workdays/profile-operations.js +10 -8
  38. package/dist/operator-contracts/catalog/workdays/selection-commands.js +13 -0
  39. package/dist/operator-contracts/command-tree.d.ts +1 -1
  40. package/dist/operator-contracts/communication/contracts.d.ts +6 -0
  41. package/dist/operator-contracts/communication/contracts.js +2 -0
  42. package/dist/operator-contracts/control-plane-operations.d.ts +34 -3
  43. package/dist/operator-contracts/control-plane-operations.js +1 -0
  44. package/dist/operator-contracts/index.d.ts +0 -1
  45. package/dist/operator-contracts/index.js +0 -1
  46. package/dist/operator-contracts/workday-lifecycle.d.ts +8 -20
  47. package/dist/operator-contracts/workday-lifecycle.js +15 -5
  48. package/dist/secrets-capability/shared-resources.d.ts +6 -6
  49. package/package.json +1 -1
  50. package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.d.ts +0 -29
  51. package/dist/agent-capacity/policy/capacity/allocations/allocation-hierarchy.js +0 -110
  52. package/dist/operator-contracts/workday-profile.d.ts +0 -72
  53. package/dist/operator-contracts/workday-profile.js +0 -106
@@ -61,7 +61,7 @@ const executionPlanWorkItemSchema = z.object({
61
61
  workspace: z.enum(["read-only", "treedx", "git"]),
62
62
  review: z.enum(["required", "none"]),
63
63
  objective: nonEmpty,
64
- estimate: estimateSchema,
64
+ estimate: estimateSchema.optional(),
65
65
  reviewEstimate: estimateSchema.optional(),
66
66
  maximumReviewCycles: z.number().int().positive().optional(),
67
67
  dependsOn: z.array(nonEmpty.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u)),
@@ -73,7 +73,7 @@ const executionPlanWorkItemSchema = z.object({
73
73
  contextRefs: z.array(exactEntityReferenceSchema).optional(),
74
74
  acceptanceCriteria: z.array(nonEmpty).min(1)
75
75
  }).strict().superRefine((value, context) => {
76
- if (value.review === "required" && !(value.reviewEstimate && value.maximumReviewCycles)) context.addIssue({ code: z.ZodIssueCode.custom, message: "Required review needs an estimate and maximum cycle count." });
76
+ if (value.review === "required" && !value.maximumReviewCycles) context.addIssue({ code: z.ZodIssueCode.custom, message: "Required review needs a maximum cycle count." });
77
77
  if (value.review === "none" && (value.reviewEstimate || value.maximumReviewCycles)) context.addIssue({ code: z.ZodIssueCode.custom, message: "Unreviewed work cannot define review estimates or cycles." });
78
78
  if (value.workspace !== "read-only") {
79
79
  const mutable = (value.contextRefs ?? []).filter((reference) => reference.store === value.workspace);
@@ -113,6 +113,18 @@ const proposalSchema = z.object({
113
113
  discussionRef: exactEntityReferenceSchema.optional(),
114
114
  executionPlan: executionPlanSchema.optional()
115
115
  }).strict().superRefine((value, context) => {
116
+ if (["ready", "decided"].includes(value.status)) for (const [index, item] of (value.executionPlan?.workItems ?? []).entries()) {
117
+ if (!item.estimate) context.addIssue({
118
+ code: z.ZodIssueCode.custom,
119
+ path: ["executionPlan", "workItems", index, "estimate"],
120
+ message: "Ready work requires its agent-authored estimate."
121
+ });
122
+ if (item.review === "required" && !item.reviewEstimate) context.addIssue({
123
+ code: z.ZodIssueCode.custom,
124
+ path: ["executionPlan", "workItems", index, "reviewEstimate"],
125
+ message: "Ready reviewed work requires its Reviewer-authored estimate."
126
+ });
127
+ }
116
128
  if (["ready", "decided"].includes(value.status) && !value.summary) {
117
129
  context.addIssue({ code: z.ZodIssueCode.custom, path: ["summary"], message: "A ready proposal requires a summary." });
118
130
  }
@@ -40,8 +40,8 @@ export declare function validatePortableContentData(model: string, value: unknow
40
40
  handler: string;
41
41
  permissions: {
42
42
  content: {
43
- read: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
44
- write: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
43
+ read: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
44
+ write: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
45
45
  };
46
46
  tools: ("release" | "verification" | "discussion" | "source.read" | "source.write")[];
47
47
  };
@@ -60,8 +60,8 @@ export declare function validatePortableContentData(model: string, value: unknow
60
60
  handler: string;
61
61
  permissions: {
62
62
  content: {
63
- read: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
64
- write: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
63
+ read: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
64
+ write: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
65
65
  };
66
66
  tools: ("release" | "verification" | "discussion" | "source.read" | "source.write")[];
67
67
  };
@@ -80,8 +80,8 @@ export declare function validatePortableContentData(model: string, value: unknow
80
80
  handler: string;
81
81
  permissions: {
82
82
  content: {
83
- read: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
84
- write: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
83
+ read: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
84
+ write: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
85
85
  };
86
86
  tools: ("release" | "verification" | "discussion" | "source.read" | "source.write")[];
87
87
  };
@@ -100,8 +100,8 @@ export declare function validatePortableContentData(model: string, value: unknow
100
100
  handler: string;
101
101
  permissions: {
102
102
  content: {
103
- read: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
104
- write: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
103
+ read: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
104
+ write: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
105
105
  };
106
106
  tools: ("release" | "verification" | "discussion" | "source.read" | "source.write")[];
107
107
  };
@@ -120,8 +120,8 @@ export declare function validatePortableContentData(model: string, value: unknow
120
120
  handler: string;
121
121
  permissions: {
122
122
  content: {
123
- read: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
124
- write: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
123
+ read: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
124
+ write: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
125
125
  };
126
126
  tools: ("release" | "verification" | "discussion" | "source.read" | "source.write")[];
127
127
  };
@@ -140,8 +140,8 @@ export declare function validatePortableContentData(model: string, value: unknow
140
140
  handler: string;
141
141
  permissions: {
142
142
  content: {
143
- read: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
144
- write: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
143
+ read: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
144
+ write: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
145
145
  };
146
146
  tools: ("release" | "verification" | "discussion" | "source.read" | "source.write")[];
147
147
  };
@@ -273,7 +273,7 @@ export declare function validatePortableContentData(model: string, value: unknow
273
273
  teamId?: string | undefined;
274
274
  sourceRef?: string | undefined;
275
275
  } | {
276
- kind: "handler" | "workday" | "api" | "spec" | "message_chain" | "manager_worker" | "ui" | "context-query" | "context-query-set";
276
+ kind: "workday" | "handler" | "api" | "spec" | "message_chain" | "manager_worker" | "ui" | "context-query" | "context-query-set";
277
277
  agent: string;
278
278
  id: string;
279
279
  trigger: Record<string, unknown>;
@@ -485,20 +485,20 @@ export declare function validatePortableContentData(model: string, value: unknow
485
485
  workspace: "git" | "treedx" | "read-only";
486
486
  review: "required" | "none";
487
487
  agentClass: string;
488
- estimate: {
489
- minimumSeconds: number;
490
- expectedSeconds: number;
491
- maximumSeconds: number;
492
- rationale?: string | undefined;
493
- };
494
488
  acceptanceCriteria: string[];
495
489
  requestedPermissions: {
496
490
  content: {
497
- read: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
498
- write: ("agent" | "knowledge" | "decision" | "proposal" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
491
+ read: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
492
+ write: ("agent" | "knowledge" | "proposal" | "decision" | "objective" | "question" | "discussion" | "note" | "book" | "discussion-message")[];
499
493
  };
500
494
  tools: ("release" | "verification" | "discussion" | "source.read" | "source.write")[];
501
495
  };
496
+ estimate?: {
497
+ minimumSeconds: number;
498
+ expectedSeconds: number;
499
+ maximumSeconds: number;
500
+ rationale?: string | undefined;
501
+ } | undefined;
502
502
  contextRefs?: {
503
503
  id: string;
504
504
  model: string;
@@ -640,7 +640,7 @@ export declare function validatePortableContentData(model: string, value: unknow
640
640
  startLine?: number | undefined;
641
641
  endLine?: number | undefined;
642
642
  };
643
- disposition: "approved" | "rejected" | "superseded" | "deferred" | "request-changes";
643
+ disposition: "approved" | "rejected" | "deferred" | "superseded" | "request-changes";
644
644
  decisionClass: "proposal" | "work-review" | "publication";
645
645
  decisionMethod: "authority" | "vote" | "approval";
646
646
  decidedByRefs: {
@@ -1,5 +1,6 @@
1
- /** Call after artifact authenticity verification, with the complete selected
2
- * component inventory. Host configuration cannot weaken a package requirement.
1
+ /** Call after artifact authenticity verification, with every enabled component
2
+ * in the selected inventory. Disabled requirements retain their allocation
3
+ * custody but cannot activate a database or weaken an enabled package contract.
3
4
  */
4
5
  export declare function verifyHostPostgresRequirements(hostInput: unknown, releaseInputs: unknown[]): {
5
6
  verified: true;
@@ -22,7 +22,9 @@ function verifyHostPostgresRequirements(hostInput, releaseInputs) {
22
22
  supportedMajors: [...item.supportedMajors].sort((a, b) => a - b),
23
23
  extensions: [...item.extensions].sort()
24
24
  })).sort((a, b) => a.id.localeCompare(b.id));
25
- if (canonicalDeploymentJson(normalize(requirements)) !== canonicalDeploymentJson(normalize(host.postgres?.requirements ?? []))) throw new Error("Host database requirements differ from selected immutable components");
25
+ const configured = host.postgres?.requirements ?? [];
26
+ if (configured.some((item) => host.components[item.componentId]?.enabled !== item.enabled)) throw new Error("Host database requirement enablement differs from component selection");
27
+ if (canonicalDeploymentJson(normalize(requirements.filter((item) => item.enabled))) !== canonicalDeploymentJson(normalize(configured.filter((item) => item.enabled)))) throw new Error("Host database requirements differ from selected immutable components");
26
28
  return { verified: true, requirements };
27
29
  }
28
30
  export {
@@ -4,19 +4,33 @@ import { WORKDAY_PROFILE_COMMAND_BINDINGS } from "./catalog/workdays/profile-com
4
4
  import { WORKDAY_PLAN_OPTIONS, WORKDAY_SELECTION_INPUTS } from "./catalog/workdays/selection-commands.js";
5
5
  import { hostProviderEnvironmentBranch, PROVIDER_ENVIRONMENT_COMMAND_BINDINGS, providerEnvironmentBranches } from "./catalog/provider-environment-commands.js";
6
6
  import { addOptions, aiInstance, aiModeSet, aiNode, authLogin, branch, configurationAdopt, developmentCommand, field, hostInitialize, hostProviderCredentialInitialize, hostRecoveryVerify, hostReset, hostSecurityInitialize, hostSecurityRotate, hostUninstall, leaf, libraryRead, local, operation, page, planOption, protocol, unavailable, userCreate } from "./catalog/commands/command-tree-builders.js";
7
+ const workdayIntentInputs = [
8
+ field("body", "profileId", "option", "profile"),
9
+ field("body", "projects", "option", "projects", false, "csv"),
10
+ field("body", "executionMode", "option", "executionMode"),
11
+ field("body", "startsAt", "option", "start"),
12
+ field("body", "endsAt", "option", "end"),
13
+ field("body", "durationSeconds", "option", "duration", false, "integer"),
14
+ field("body", "objectiveFilters", "option", "objective", false, "csv"),
15
+ field("body", "planningOnly", "option", "planningOnly"),
16
+ field("body", "proposalIds", "option", "proposal", false, "csv"),
17
+ field("body", "decisionIds", "option", "decision", false, "csv"),
18
+ ...WORKDAY_SELECTION_INPUTS
19
+ ];
7
20
  const operationBindings = {
8
21
  ...PROVIDER_ENVIRONMENT_COMMAND_BINDINGS,
9
22
  "auth login": protocol("protocol.identity.login"),
10
23
  "auth logout": protocol("protocol.oauth.revoke"),
11
24
  "auth status": operation("accounts.current.show"),
12
25
  "users create": protocol("protocol.accounts.create"),
13
- "send": operation("communications.send", [field("path", "teamId", "context", "team", true), field("path", "channel", "argument", "channel"), field("body", "message", "argument", "message"), field("body", "recipients", "option", "to"), field("body", "timeoutSeconds", "option", "timeout", false, "integer")]),
26
+ "send": operation("communications.send", [field("path", "teamId", "context", "team", true), field("path", "channel", "argument", "channel"), field("body", "message", "argument", "message"), field("body", "recipients", "option", "to"), field("body", "proposalId", "option", "proposal"), field("body", "parentWorkdayId", "option", "workday"), field("body", "timeoutSeconds", "option", "timeout", false, "integer")]),
14
27
  "topics list": operation("communications.topics.list", [field("path", "teamId", "context", "team", true), ...page()]),
15
28
  "topics show": operation("communications.topics.show", [field("path", "teamId", "context", "team", true), field("path", "channel", "argument", "topic", true)]),
16
29
  "topics subscribe": operation("communications.topics.subscriptions.put", [field("path", "teamId", "context", "team", true), field("path", "channel", "argument", "topic", true), field("body", "agent", "argument", "agent", true)]),
17
30
  "topics unsubscribe": operation("communications.topics.subscriptions.delete", [field("path", "teamId", "context", "team", true), field("path", "channel", "argument", "topic", true), field("body", "agent", "argument", "agent", true)]),
18
31
  "capabilities list": operation("capabilities.list", [field("query", "status", "option"), field("query", "family", "option"), field("query", "namespace", "option"), field("query", "limit", "option", "limit", false, "integer"), field("query", "cursor", "option")]),
19
32
  "capabilities show": operation("capabilities.show", [field("path", "capabilityId", "argument", "capability", true), field("query", "version", "option")]),
33
+ "providers offers show": operation("providers.offers.show", [field("path", "teamId", "context", "team", true), field("path", "providerId", "argument", "connection", true)]),
20
34
  "teams list": operation("teams.list", page()),
21
35
  "teams current": local("local.teams.current"),
22
36
  "teams use": local("local.teams.use"),
@@ -137,14 +151,14 @@ const operationBindings = {
137
151
  "seeds apply": operation("seeds.apply", [field("path", "name", "context", "seed", true), field("body", "file", "argument", "file", true)]),
138
152
  "seeds show": operation("seeds.show", [field("path", "name", "argument", "seed", true)]),
139
153
  "seeds verify": operation("seeds.verify", [field("path", "name", "argument", "seed", true)]),
140
- "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"), field("body", "decisionIds", "option", "decision", false, "csv"), ...WORKDAY_SELECTION_INPUTS]),
154
+ "workdays plan": operation("workdays.plan", [field("path", "teamId", "context", "team", true), ...workdayIntentInputs]),
141
155
  ...WORKDAY_PROFILE_COMMAND_BINDINGS,
142
156
  "workdays start": operation("workdays.start", [field("path", "teamId", "context", "team", true), field("body", "preflightId", "option", "preflight", true), field("body", "preflightDigest", "option", "digest", true)]),
143
157
  "workdays list": operation("workdays.list", [field("path", "teamId", "context", "team", true), ...page()]),
144
158
  "workdays show": operation("workdays.show", [field("path", "teamId", "context", "team", true), field("path", "runId", "argument", "workday", true)]),
145
159
  "workdays stop": operation("workdays.stop", [field("path", "teamId", "context", "team", true), field("path", "runId", "argument", "workday", true), field("body", "reason", "option", "reason")]),
146
160
  "workdays schedules list": operation("workdays.schedules.list", [field("path", "teamId", "context", "team", true)]),
147
- "workdays schedules start": operation("workdays.schedules.create", [field("path", "teamId", "context", "team", true), field("body", "profile", "option"), field("body", "projects", "option", "projects", false, "csv"), field("body", "duration", "option", "duration", false, "integer")]),
161
+ "workdays schedules start": operation("workdays.schedules.create", [field("path", "teamId", "context", "team", true), ...workdayIntentInputs.map((binding) => ({ ...binding, field: `intent.${binding.field}` })), field("body", "cadenceSeconds", "option", "cadenceSeconds", false, "integer")]),
148
162
  "assignments list": operation("assignments.list", [field("path", "teamId", "context", "team", true), ...page()]),
149
163
  "assignments show": operation("assignments.show", [field("path", "teamId", "context", "team", true), field("path", "assignmentId", "argument", "assignment", true)]),
150
164
  "assignments explain": operation("assignments.explain", [field("path", "teamId", "context", "team", true), field("path", "assignmentId", "argument", "assignment", true)]),
@@ -207,7 +221,7 @@ const commandTree = {
207
221
  executable: "trsd",
208
222
  commands: [
209
223
  { nodeType: "leaf", segment: "inbox", description: "Open the active team governance inbox.", kind: "read", options: [{ name: "--project", description: "Initial project filter.", type: "string" }, { name: "--type", description: "Initial proposal, question, or all filter.", type: "string" }, { name: "--all", description: "Include completed and decided items.", type: "boolean" }], resultSchemaId: "treeseed.inbox-session/v1", execution: local("local.inbox") },
210
- { nodeType: "leaf", segment: "send", description: "Send a message or open the interactive team topic browser.", kind: "mutation", arguments: [{ name: "channel", description: "Optional team discussion topic to preselect.", required: false }, { name: "message", description: "Markdown message containing agent addresses.", required: false }], options: [planOption, { name: "--team", description: "One-command team override.", type: "string" }, { name: "--to", description: "Deprecated validation-only address list.", type: "string[]" }, { name: "--timeout", description: "Optional maximum seconds to listen for the complete response chain.", type: "number" }, { name: "--no-wait", description: "Return immediately after durable admission.", type: "boolean" }, { name: "--wait", description: "Deprecated wait duration in seconds.", type: "number" }, { name: "--json-stream", description: "Emit ordered communication events as NDJSON.", type: "boolean" }, { name: "--diagnostics", description: "Diagnostic detail: metadata or full.", type: "string" }], authorization: { capability: "agents.execute", confirmation: "never" }, resultSchemaId: "treeseed.communication-send-receipt/v4", execution: unavailable() },
224
+ { nodeType: "leaf", segment: "send", description: "Send a message or open the interactive team topic browser.", kind: "mutation", arguments: [{ name: "channel", description: "Optional team discussion topic to preselect.", required: false }, { name: "message", description: "Markdown message containing agent addresses.", required: false }], options: [planOption, { name: "--team", description: "One-command team override.", type: "string" }, { name: "--proposal", description: "Open project proposal to bind as exact discussion context.", type: "string" }, { name: "--workday", description: "Attach addressed communication to this active workday and its allocation.", type: "string" }, { name: "--to", description: "Deprecated validation-only address list.", type: "string[]" }, { name: "--timeout", description: "Optional maximum seconds to listen for the complete response chain.", type: "number" }, { name: "--no-wait", description: "Return immediately after durable admission.", type: "boolean" }, { name: "--wait", description: "Deprecated wait duration in seconds.", type: "number" }, { name: "--json-stream", description: "Emit ordered communication events as NDJSON.", type: "boolean" }, { name: "--diagnostics", description: "Diagnostic detail: metadata or full.", type: "string" }], authorization: { capability: "agents.execute", confirmation: "never" }, resultSchemaId: "treeseed.communication-send-receipt/v4", execution: unavailable() },
211
225
  branch("topics", [
212
226
  { nodeType: "leaf", segment: "list", description: "List discussion topics and active listeners.", kind: "read", options: [{ name: "--status", description: "Topic status.", type: "string" }, { name: "--limit", description: "Maximum topics.", type: "number" }, { name: "--cursor", description: "Pagination cursor.", type: "string" }], resultSchemaId: "treeseed.communication-topic-page/v1", execution: unavailable() },
213
227
  { nodeType: "leaf", segment: "show", description: "Show a discussion topic and its listeners.", kind: "read", arguments: [{ name: "topic", description: "Discussion topic.", required: true }], resultSchemaId: "treeseed.communication-topic/v1", execution: unavailable() },
@@ -337,14 +351,14 @@ const commandTree = {
337
351
  leaf("audit")
338
352
  ]),
339
353
  branch("workdays", [
340
- branch("profiles", [leaf("list"), leaf("show", "read", "profile"), leaf("reconcile", "mutation", "project", "authority"), leaf("validate", "read", "file")]),
354
+ branch("profiles", [leaf("list"), leaf("show", "read", "profile"), leaf("update", "mutation", "profile", "authority")]),
341
355
  { ...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 },
342
356
  leaf("start", "mutation", void 0, "authority"),
343
357
  leaf("list"),
344
358
  leaf("show", "read", "workday"),
345
359
  leaf("watch", "read", "workday"),
346
360
  leaf("stop", "mutation", "workday", "authority"),
347
- branch("schedules", [leaf("list"), leaf("show", "read", "schedule"), leaf("plan"), leaf("start", "mutation", void 0, "authority"), leaf("pause", "mutation", "schedule", "authority"), leaf("resume", "mutation", "schedule", "authority"), leaf("retire", "mutation", "schedule", "destructive")])
361
+ branch("schedules", [leaf("list"), leaf("show", "read", "schedule"), leaf("plan"), addOptions(leaf("start", "mutation", void 0, "authority"), [...WORKDAY_PLAN_OPTIONS.filter((option) => option.name !== "--plan"), { name: "--cadence-seconds", description: "Seconds between recurring workday starts.", type: "number" }]), leaf("pause", "mutation", "schedule", "authority"), leaf("resume", "mutation", "schedule", "authority"), leaf("retire", "mutation", "schedule", "destructive")])
348
362
  ]),
349
363
  branch("assignments", [leaf("list"), leaf("show", "read", "assignment"), leaf("explain", "read", "assignment"), leaf("watch", "read", "assignment"), leaf("retry", "mutation", "assignment", "authority"), leaf("cancel", "mutation", "assignment", "destructive"), leaf("artifacts", "read", "assignment")]),
350
364
  branch("execution", [
@@ -6,6 +6,8 @@ export declare function communicationOperations(): {
6
6
  message: string;
7
7
  timeoutSeconds?: number | undefined;
8
8
  recipients?: string[] | undefined;
9
+ proposalId?: string | undefined;
10
+ parentWorkdayId?: string | undefined;
9
11
  }, {
10
12
  status: "failed" | "running" | "partial" | "complete" | "queued";
11
13
  schemaVersion: "treeseed.communication-send-receipt/v4";
@@ -3,16 +3,16 @@ const WORKDAY_PROFILE_COMMAND_BINDINGS = {
3
3
  "workdays profiles list": { kind: "operation", operationId: "workdays.profiles.list", input: [
4
4
  team,
5
5
  { target: "query", field: "limit", source: "option", name: "limit", transform: "integer" },
6
- { target: "query", field: "cursor", source: "option", name: "cursor", transform: "identity" },
7
- { target: "query", field: "status", source: "option", name: "status", transform: "identity" }
6
+ { target: "query", field: "cursor", source: "option", name: "cursor", transform: "identity" }
8
7
  ] },
9
8
  "workdays profiles show": { kind: "operation", operationId: "workdays.profiles.show", input: [
10
9
  team,
11
10
  { target: "path", field: "profileId", source: "argument", name: "profile", required: true, transform: "identity" }
12
11
  ] },
13
- "workdays profiles reconcile": { kind: "operation", operationId: "workdays.profiles.reconcile", input: [
12
+ "workdays profiles update": { kind: "operation", operationId: "workdays.profiles.update", input: [
14
13
  team,
15
- { target: "path", field: "projectId", source: "argument", name: "project", required: true, transform: "identity" }
14
+ { target: "path", field: "profileId", source: "argument", name: "profile", required: true, transform: "identity" },
15
+ { target: "body", field: "file", source: "option", name: "input", required: true, transform: "identity" }
16
16
  ] }
17
17
  };
18
18
  export {
@@ -9,8 +9,33 @@ export declare const WORKDAY_PROFILE_OPERATIONS: {
9
9
  }, {
10
10
  [x: string]: any;
11
11
  }, undefined, Record<string, unknown>>;
12
- profilesReconcile: import("../../control-plane-operation.js").ControlPlaneOperationBinding<{
13
- projectId: string;
12
+ profilesUpdate: import("../../control-plane-operation.js").ControlPlaneOperationBinding<{
14
13
  teamId: string;
15
- }, {}, {}, Record<string, unknown>>;
14
+ profileId: "default";
15
+ }, {}, {
16
+ policy: {
17
+ durationSeconds: number;
18
+ maximumConcurrency: number;
19
+ communicationConcurrency: number;
20
+ planningPercent?: number | undefined;
21
+ allocationWeight?: number | undefined;
22
+ planningTurnMaximumSeconds?: number | undefined;
23
+ projectPercentages?: Record<string, number> | undefined;
24
+ agentClassPercentages?: Record<string, Record<string, number>> | undefined;
25
+ };
26
+ }, {
27
+ id: "default";
28
+ teamId: string;
29
+ revision: number;
30
+ policy: {
31
+ durationSeconds: number;
32
+ maximumConcurrency: number;
33
+ communicationConcurrency: number;
34
+ planningPercent?: number | undefined;
35
+ allocationWeight?: number | undefined;
36
+ planningTurnMaximumSeconds?: number | undefined;
37
+ projectPercentages?: Record<string, number> | undefined;
38
+ agentClassPercentages?: Record<string, Record<string, number>> | undefined;
39
+ };
40
+ }>;
16
41
  };
@@ -1,11 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { defineOperation } from "../../operation-builder.js";
3
+ import { workdayPolicySchema, workdayProfileSchema } from "../../../agent-capacity/contracts/capacity/workdays/workday-allocation.js";
3
4
  const team = z.object({ teamId: z.string().min(1) }).strict();
4
5
  const empty = z.object({}).strict();
5
6
  const output = z.record(z.unknown());
6
7
  const read = (operationId, path, parameters, query, pagination) => defineOperation({
7
8
  operationId,
8
- description: "Read accepted repository workday profile generations.",
9
+ description: "Read the team-owned canonical workday allocation policy.",
9
10
  rest: { method: "GET", path },
10
11
  parameters: `treeseed.${operationId}.parameters/v1`,
11
12
  capability: "workdays.read",
@@ -23,15 +24,16 @@ const WORKDAY_PROFILE_OPERATIONS = {
23
24
  "workdays.profiles.list",
24
25
  "/v1/teams/{teamId}/workday-profiles",
25
26
  team,
26
- z.object({ limit: z.coerce.number().int().min(1).max(100).optional(), cursor: z.string().optional(), status: z.enum(["active", "archived", "superseded"]).optional() }).strict(),
27
+ z.object({ limit: z.coerce.number().int().min(1).max(100).optional(), cursor: z.string().optional() }).strict(),
27
28
  "cursor"
28
29
  ),
29
30
  profilesShow: read("workdays.profiles.show", "/v1/teams/{teamId}/workday-profiles/{profileId}", team.extend({ profileId: z.string().min(1) }), empty, "none"),
30
- profilesReconcile: defineOperation({
31
- operationId: "workdays.profiles.reconcile",
32
- description: "Reconcile a bound repository profile after exact successful source verification.",
33
- rest: { method: "POST", path: "/v1/teams/{teamId}/projects/{projectId}/workday-profiles/reconcile" },
34
- parameters: "treeseed.workdays.profiles.reconcile.parameters/v1",
31
+ profilesUpdate: defineOperation({
32
+ operationId: "workdays.profiles.update",
33
+ description: "Replace the team default policy without changing existing workday snapshots.",
34
+ rest: { method: "PUT", path: "/v1/teams/{teamId}/workday-profiles/{profileId}" },
35
+ parameters: "treeseed.workdays.profiles.update.parameters/v1",
36
+ concurrencyRequired: true,
35
37
  capability: "workdays.execute",
36
38
  authentication: "oauth",
37
39
  oauthScopes: ["treeseed:execution"],
@@ -41,7 +43,7 @@ const WORKDAY_PROFILE_OPERATIONS = {
41
43
  surfaces: ["rest", "cli"],
42
44
  cacheScope: "none",
43
45
  pagination: "none"
44
- }, { path: team.extend({ projectId: z.string().min(1) }), query: empty, body: empty, output })
46
+ }, { path: team.extend({ profileId: z.literal("default") }), query: empty, body: z.object({ policy: workdayPolicySchema }).strict(), output: workdayProfileSchema })
45
47
  };
46
48
  export {
47
49
  WORKDAY_PROFILE_OPERATIONS
@@ -1,10 +1,23 @@
1
1
  const WORKDAY_SELECTION_INPUTS = [
2
+ { target: "body", field: "allocation.planningPercent", source: "option", name: "planningPercent", transform: "number" },
3
+ { target: "body", field: "allocation.allocationWeight", source: "option", name: "allocationWeight", transform: "number" },
4
+ { target: "body", field: "allocation.planningTurnMaximumSeconds", source: "option", name: "planningTurnMaximumSeconds", transform: "integer" },
5
+ { target: "body", field: "allocation.projectPercentages", source: "option", name: "projectPercentages", transform: "json" },
6
+ { target: "body", field: "allocation.agentClassPercentages", source: "option", name: "agentClassPercentages", transform: "json" },
2
7
  { target: "body", field: "agentSelection.agentSlugs", source: "option", name: "agent", transform: "csv" },
3
8
  { target: "body", field: "agentSelection.activityTypes", source: "option", name: "activity", transform: "csv" },
4
9
  { target: "body", field: "agentSelection.classSlugs", source: "option", name: "class", transform: "csv" }
5
10
  ];
6
11
  const WORKDAY_PLAN_OPTIONS = [
12
+ { name: "--planning-percent", description: "Planning share of workday time and capacity (default 20%).", type: "number" },
13
+ { name: "--allocation-weight", description: "Relative share among eligible concurrent workdays (default 1).", type: "number" },
14
+ { name: "--planning-turn-maximum-seconds", description: "Maximum active seconds per planning turn (default 180).", type: "number" },
15
+ { name: "--project-percentages", description: "JSON project allocation targets; normalized among selected projects.", type: "string" },
16
+ { name: "--agent-class-percentages", description: "JSON class allocation targets keyed by project.", type: "string" },
7
17
  { name: "--plan", description: "Return the request without creating a preflight.", type: "boolean" },
18
+ { name: "--planning-only", description: "Run cooperative planning profiles without admitting accepted acting work.", type: "boolean" },
19
+ { name: "--execution-mode", description: "Select simulation or production custody; both consume real capacity.", type: "string" },
20
+ { name: "--proposal", description: "Governed proposal id for cooperative planning; repeat or comma-separate.", type: "string[]" },
8
21
  { name: "--decision", description: "Accepted decision id; repeat or comma-separate. The API derives and verifies acting authority.", type: "string[]" },
9
22
  { name: "--agent", description: "Planning agent slug; repeat or comma-separate. Intersects with class/activity selectors.", type: "string[]" },
10
23
  { name: "--activity", description: "Planning activity: planning, estimating, reviewing, reporting, or chat; repeat or comma-separate.", type: "string[]" },
@@ -29,7 +29,7 @@ export interface CommandInputBinding {
29
29
  name: string;
30
30
  target: CommandInputTarget;
31
31
  required?: boolean;
32
- transform?: 'identity' | 'integer' | 'csv';
32
+ transform?: 'identity' | 'number' | 'integer' | 'csv' | 'json';
33
33
  }
34
34
  export type CommandExecutionBinding = {
35
35
  kind: 'operation';
@@ -12,15 +12,21 @@ export declare const communicationRecipientSchema: z.ZodObject<{
12
12
  export declare const communicationSendRequestSchema: z.ZodObject<{
13
13
  message: z.ZodString;
14
14
  recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
+ proposalId: z.ZodOptional<z.ZodString>;
16
+ parentWorkdayId: z.ZodOptional<z.ZodString>;
15
17
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
16
18
  }, "strict", z.ZodTypeAny, {
17
19
  message: string;
18
20
  timeoutSeconds?: number | undefined;
19
21
  recipients?: string[] | undefined;
22
+ proposalId?: string | undefined;
23
+ parentWorkdayId?: string | undefined;
20
24
  }, {
21
25
  message: string;
22
26
  timeoutSeconds?: number | undefined;
23
27
  recipients?: string[] | undefined;
28
+ proposalId?: string | undefined;
29
+ parentWorkdayId?: string | undefined;
24
30
  }>;
25
31
  export declare const communicationTopicEventTypeSchema: z.ZodEnum<["message.posted", "mention.acknowledged", "response_lease.accepted", "agent.progress", "agent.response", "agent.abstained", "agent.failed"]>;
26
32
  export declare const communicationTopicEventSchema: z.ZodObject<{
@@ -6,6 +6,8 @@ const communicationRecipientSchema = z.object({
6
6
  const communicationSendRequestSchema = z.object({
7
7
  message: z.string().trim().min(1).max(1e5),
8
8
  recipients: z.array(z.string().trim().min(1)).max(100).optional(),
9
+ proposalId: z.string().trim().min(1).max(200).optional(),
10
+ parentWorkdayId: z.string().trim().min(1).max(200).optional(),
9
11
  timeoutSeconds: z.number().int().min(1).max(3600).optional()
10
12
  }).strict();
11
13
  const communicationTopicEventTypeSchema = z.enum([
@@ -1632,6 +1632,8 @@ export declare const CONTROL_PLANE_OPERATIONS: {
1632
1632
  message: string;
1633
1633
  timeoutSeconds?: number | undefined;
1634
1634
  recipients?: string[] | undefined;
1635
+ proposalId?: string | undefined;
1636
+ parentWorkdayId?: string | undefined;
1635
1637
  }, {
1636
1638
  status: "failed" | "running" | "partial" | "complete" | "queued";
1637
1639
  schemaVersion: "treeseed.communication-send-receipt/v4";
@@ -2083,10 +2085,35 @@ export declare const CONTROL_PLANE_OPERATIONS: {
2083
2085
  }, {
2084
2086
  [x: string]: any;
2085
2087
  }, undefined, Record<string, unknown>>;
2086
- readonly profilesReconcile: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2087
- projectId: string;
2088
+ readonly profilesUpdate: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2088
2089
  teamId: string;
2089
- }, {}, {}, Record<string, unknown>>;
2090
+ profileId: "default";
2091
+ }, {}, {
2092
+ policy: {
2093
+ durationSeconds: number;
2094
+ maximumConcurrency: number;
2095
+ communicationConcurrency: number;
2096
+ planningPercent?: number | undefined;
2097
+ allocationWeight?: number | undefined;
2098
+ planningTurnMaximumSeconds?: number | undefined;
2099
+ projectPercentages?: Record<string, number> | undefined;
2100
+ agentClassPercentages?: Record<string, Record<string, number>> | undefined;
2101
+ };
2102
+ }, {
2103
+ id: "default";
2104
+ teamId: string;
2105
+ revision: number;
2106
+ policy: {
2107
+ durationSeconds: number;
2108
+ maximumConcurrency: number;
2109
+ communicationConcurrency: number;
2110
+ planningPercent?: number | undefined;
2111
+ allocationWeight?: number | undefined;
2112
+ planningTurnMaximumSeconds?: number | undefined;
2113
+ projectPercentages?: Record<string, number> | undefined;
2114
+ agentClassPercentages?: Record<string, Record<string, number>> | undefined;
2115
+ };
2116
+ }>;
2090
2117
  };
2091
2118
  readonly assignments: {
2092
2119
  readonly list: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
@@ -2548,6 +2575,10 @@ export declare const CONTROL_PLANE_OPERATIONS: {
2548
2575
  teamId: string;
2549
2576
  providerId: string;
2550
2577
  }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
2578
+ readonly offers: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2579
+ teamId: string;
2580
+ providerId: string;
2581
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
2551
2582
  readonly connect: import("./control-plane-operation.js").ControlPlaneOperationBinding<{
2552
2583
  teamId: string;
2553
2584
  }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
@@ -435,6 +435,7 @@ const CONTROL_PLANE_OPERATIONS = {
435
435
  show: resource("providers.show", "GET", "/v1/teams/{teamId}/capacity-providers/{providerId}", { teamId: z.string().min(1), providerId: z.string().min(1) }, { capability: "providers.read", surfaces: ["rest", "cli", "mcp_resource"] }),
436
436
  status: resource("providers.status", "GET", "/v1/teams/{teamId}/capacity-providers/{providerId}/status", { teamId: z.string().min(1), providerId: z.string().min(1) }, { capability: "providers.read", surfaces: ["rest", "cli", "mcp_tool"] }),
437
437
  diagnose: resource("providers.diagnose", "GET", "/v1/teams/{teamId}/capacity-providers/{providerId}/diagnosis", { teamId: z.string().min(1), providerId: z.string().min(1) }, { capability: "providers.read", surfaces: ["rest", "cli", "mcp_tool"] }),
438
+ offers: resource("providers.offers.show", "GET", "/v1/teams/{teamId}/capacity-providers/{providerId}/offers", { teamId: z.string().min(1), providerId: z.string().min(1) }, { capability: "providers.read", surfaces: ["rest", "cli", "mcp_resource"] }),
438
439
  connect: resource("providers.connect", "POST", "/v1/teams/{teamId}/capacity-provider-connections", { teamId: z.string().min(1) }, { capability: "providers.write", scopes: ["treeseed:admin"], surfaces: ["rest", "cli"], risk: "credential", redactedPaths: ["body.enrollmentToken"] }),
439
440
  registrationCode: PROVIDER_ENVIRONMENT_OPERATIONS.registrationCode,
440
441
  disconnect: resource("providers.disconnect", "POST", "/v1/teams/{teamId}/capacity-provider-connections/{connectionId}/disconnect", { teamId: z.string().min(1), connectionId: z.string().min(1) }, { capability: "providers.write", scopes: ["treeseed:admin"], surfaces: ["rest", "cli"], risk: "destructive" }),
@@ -1,6 +1,5 @@
1
1
  export * from './command-tree.js';
2
2
  export * from './canonical-command-tree.js';
3
- export * from './workday-profile.js';
4
3
  export * from './workday-lifecycle.js';
5
4
  export * from './control-plane-operation.js';
6
5
  export * from './control-plane-operations.js';
@@ -1,6 +1,5 @@
1
1
  export * from "./command-tree.js";
2
2
  export * from "./canonical-command-tree.js";
3
- export * from "./workday-profile.js";
4
3
  export * from "./workday-lifecycle.js";
5
4
  export * from "./control-plane-operation.js";
6
5
  export * from "./control-plane-operations.js";