@treeseed/sdk 0.12.41 → 0.12.43
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/agent-capacity.d.ts +184 -0
- package/dist/agent-capacity.js +225 -3
- package/dist/guarantees/index.d.ts +2 -0
- package/dist/guarantees/index.js +14 -1
- package/dist/hosting/graph.js +1 -1
- package/dist/local-dev/managed-dev.js +45 -4
- package/dist/operations/repository-operations.js +18 -7
- package/dist/operations/services/deployment-readiness.js +10 -2
- package/dist/operations/services/railway-deploy.js +1 -1
- package/dist/operations/services/template-registry.js +1 -2
- package/dist/platform/desired-state.js +1 -1
- package/dist/reconcile/builtin-adapters.js +10 -2
- package/dist/treeseed/template-catalog/catalog.fixture.json +0 -184
- package/dist/types/agents.d.ts +101 -3
- package/dist/types/agents.js +21 -7
- package/dist/workflow/operations.d.ts +38 -0
- package/dist/workflow/operations.js +98 -8
- package/drizzle/market/0015_agent_decision_assignment_graphs.sql +60 -0
- package/package.json +1 -1
|
@@ -127,7 +127,11 @@ function collectTreeseedDeploymentReadiness(options) {
|
|
|
127
127
|
checks.push(check("hosting:api:projectGroup", api.projectGroupId, "treeseed-control-plane", "API project group targets the Treeseed control plane.", "Bind services.api to the treeseed-control-plane project group.", "projectGroupId"));
|
|
128
128
|
checks.push(check("hosting:api:rootDir", api.config?.rootDir, expectedApiUnitRoot, "API effective rootDir points at the API package.", "Set services.api.rootDir and services.api.railway.rootDir relative to the owning API manifest.", "rootDir"));
|
|
129
129
|
if (environment === "local") {
|
|
130
|
-
|
|
130
|
+
if (api.config?.dockerfilePath) {
|
|
131
|
+
checks.push(check("hosting:api:dockerfilePath", api.config.dockerfilePath, "/Dockerfile.api", "API local deploy uses the same Dockerfile build contract as staging.", "Set services.api.railway.dockerfilePath to /Dockerfile.api.", "dockerfilePath"));
|
|
132
|
+
} else {
|
|
133
|
+
checks.push(check("hosting:api:buildCommand", api.config?.buildCommand, "npm run build", "API build command is package-local.", 'Set services.api.railway.buildCommand to "npm run build".', "buildCommand"));
|
|
134
|
+
}
|
|
131
135
|
checks.push(check("hosting:api:startCommand", api.config?.startCommand, "npm run start:api", "API start command is package-local.", 'Set services.api.railway.startCommand to "npm run start:api".', "startCommand"));
|
|
132
136
|
} else if (environment === "staging") {
|
|
133
137
|
checks.push(check("hosting:api:sourceMode", api.config?.sourceMode, "git", "API staging deploy uses Railway Git source builds.", "Set services.api.railway.sourceMode to git.", "sourceMode"));
|
|
@@ -154,7 +158,11 @@ function collectTreeseedDeploymentReadiness(options) {
|
|
|
154
158
|
checks.push(check("hosting:operationsRunner:projectGroup", runner.projectGroupId, "treeseed-control-plane", "Runner project group targets the Treeseed control plane.", "Bind services.operationsRunner to the treeseed-control-plane project group.", "projectGroupId"));
|
|
155
159
|
checks.push(check("hosting:operationsRunner:rootDir", runner.config?.rootDir, expectedRunnerUnitRoot, "Runner effective rootDir points at the API package.", "Set services.operationsRunner.rootDir and services.operationsRunner.railway.rootDir relative to the owning API manifest.", "rootDir"));
|
|
156
160
|
if (environment === "local") {
|
|
157
|
-
|
|
161
|
+
if (runner.config?.dockerfilePath) {
|
|
162
|
+
checks.push(check("hosting:operationsRunner:dockerfilePath", runner.config.dockerfilePath, "/Dockerfile.operations-runner", "Runner local deploy uses the same Dockerfile build contract as staging.", "Set services.operationsRunner.railway.dockerfilePath to /Dockerfile.operations-runner.", "dockerfilePath"));
|
|
163
|
+
} else {
|
|
164
|
+
checks.push(check("hosting:operationsRunner:buildCommand", runner.config?.buildCommand, "npm run build", "Runner build command is package-local.", 'Set services.operationsRunner.railway.buildCommand to "npm run build".', "buildCommand"));
|
|
165
|
+
}
|
|
158
166
|
checks.push(check("hosting:operationsRunner:startCommand", runner.config?.startCommand, "npm run start:runner", "Runner start command is package-local.", 'Set services.operationsRunner.railway.startCommand to "npm run start:runner".', "startCommand"));
|
|
159
167
|
} else if (environment === "staging") {
|
|
160
168
|
checks.push(check("hosting:operationsRunner:sourceMode", runner.config?.sourceMode, "git", "Runner staging deploy uses Railway Git source builds.", "Set services.operationsRunner.railway.sourceMode to git.", "sourceMode"));
|
|
@@ -713,7 +713,7 @@ function configuredRailwayServicesForConfig(tenantRoot, scope, deployConfig, app
|
|
|
713
713
|
rootDir: serviceRoot,
|
|
714
714
|
publicBaseUrl,
|
|
715
715
|
railwayEnvironment,
|
|
716
|
-
buildCommand: resolvedImageRef ? null : service.railway?.buildCommand ?? null,
|
|
716
|
+
buildCommand: resolvedImageRef || sourcePolicy.sourceMode === "git" && service.railway?.dockerfilePath ? null : service.railway?.buildCommand ?? null,
|
|
717
717
|
startCommand: isCapacityProviderService ? null : resolvedImageRef ? null : service.railway?.startCommand ?? null,
|
|
718
718
|
imageRef: resolvedImageRef,
|
|
719
719
|
sourceMode: sourcePolicy.sourceMode,
|
|
@@ -70,8 +70,7 @@ function listTemplateArtifactIds() {
|
|
|
70
70
|
}
|
|
71
71
|
const LOCAL_STARTER_ID_TO_DIRECTORY = {
|
|
72
72
|
"research": "research",
|
|
73
|
-
"engineering": "engineering"
|
|
74
|
-
"information-hub": "information-hub"
|
|
73
|
+
"engineering": "engineering"
|
|
75
74
|
};
|
|
76
75
|
function localStartersRoot() {
|
|
77
76
|
return resolve(cliPackageRoot, "..", "..", "starters");
|
|
@@ -636,7 +636,7 @@ function localDevelopmentResources(tenantRoot, environment, localContent) {
|
|
|
636
636
|
},
|
|
637
637
|
volumes: [{ name: "treeseed-local-treedx-data", mountPath: "/data", sharedLocalOnly: true }],
|
|
638
638
|
healthChecks: [
|
|
639
|
-
{ id: "treedx-api", kind: "http", url: "http://127.0.0.1:4000/api/v1/health" }
|
|
639
|
+
{ id: "treedx-api", kind: "http", url: "http://127.0.0.1:4000/api/v1/health", attempts: 240, intervalMs: 2e3 }
|
|
640
640
|
]
|
|
641
641
|
},
|
|
642
642
|
source: { type: "package-adapter", id: "treedx" }
|
|
@@ -782,6 +782,9 @@ function buildLocalDockerComposeAdapter() {
|
|
|
782
782
|
},
|
|
783
783
|
diff(input) {
|
|
784
784
|
if (!input.observed.exists) return { action: "blocked", reasons: input.observed.warnings, before: input.observed.live, after: input.unit.spec };
|
|
785
|
+
if (input.unit.spec.forceRecreate === true) {
|
|
786
|
+
return { action: "update", reasons: ["compose force recreate requested"], before: input.observed.live, after: input.unit.spec };
|
|
787
|
+
}
|
|
785
788
|
return input.observed.status === "ready" ? noopDiff() : { action: "create", reasons: ["compose services are not running"], before: input.observed.live, after: input.unit.spec };
|
|
786
789
|
},
|
|
787
790
|
apply(input) {
|
|
@@ -799,7 +802,7 @@ function buildLocalDockerComposeAdapter() {
|
|
|
799
802
|
env,
|
|
800
803
|
profiles: localComposeProfiles(input),
|
|
801
804
|
buildPolicy: localComposeBuildPolicy(input),
|
|
802
|
-
action: "up"
|
|
805
|
+
action: input.unit.spec.forceRecreate === true ? "restart" : "up"
|
|
803
806
|
});
|
|
804
807
|
if (!result.ok) {
|
|
805
808
|
throw new Error(result.stderr.trim() || result.stdout.trim() || "docker compose up failed");
|
|
@@ -811,7 +814,9 @@ function buildLocalDockerComposeAdapter() {
|
|
|
811
814
|
const checks = [];
|
|
812
815
|
for (const healthCheck of healthChecks) {
|
|
813
816
|
if (healthCheck.kind === "http" && typeof healthCheck.url === "string") {
|
|
814
|
-
const
|
|
817
|
+
const attempts = typeof healthCheck.attempts === "number" && Number.isFinite(healthCheck.attempts) ? Math.max(1, Math.floor(healthCheck.attempts)) : void 0;
|
|
818
|
+
const intervalMs = typeof healthCheck.intervalMs === "number" && Number.isFinite(healthCheck.intervalMs) ? Math.max(100, Math.floor(healthCheck.intervalMs)) : void 0;
|
|
819
|
+
const health = await checkHttpHealthWithRetry(healthCheck.url, attempts, intervalMs);
|
|
815
820
|
checks.push(verificationCheck(String(healthCheck.id ?? healthCheck.url), `HTTP health ${healthCheck.url}`, "api", {
|
|
816
821
|
exists: health.ok,
|
|
817
822
|
configured: true,
|
|
@@ -1235,6 +1240,9 @@ function buildLocalProcessAdapter() {
|
|
|
1235
1240
|
};
|
|
1236
1241
|
},
|
|
1237
1242
|
diff(input) {
|
|
1243
|
+
if (input.unit.spec.action === "restart") {
|
|
1244
|
+
return { action: "update", reasons: ["local process restart requested"], before: input.observed.live, after: input.unit.spec };
|
|
1245
|
+
}
|
|
1238
1246
|
return input.observed.status === "ready" ? noopDiff() : { action: "create", reasons: ["local process is not reported ready"], before: input.observed.live, after: input.unit.spec };
|
|
1239
1247
|
},
|
|
1240
1248
|
async apply(input) {
|
|
@@ -368,190 +368,6 @@
|
|
|
368
368
|
"relatedKnowledge": [],
|
|
369
369
|
"relatedObjectives": []
|
|
370
370
|
},
|
|
371
|
-
{
|
|
372
|
-
"id": "information-hub",
|
|
373
|
-
"displayName": "TreeSeed Information Hub",
|
|
374
|
-
"description": "First-party TreeSeed starter for recurring information retrieval, distillation, and downstream distribution.",
|
|
375
|
-
"summary": "An information distribution starter for retrieving updates over time, distilling derived knowledge, and packaging it for downstream projects.",
|
|
376
|
-
"status": "live",
|
|
377
|
-
"featured": true,
|
|
378
|
-
"category": "starter",
|
|
379
|
-
"audience": [
|
|
380
|
-
"curators",
|
|
381
|
-
"maintainers"
|
|
382
|
-
],
|
|
383
|
-
"tags": [
|
|
384
|
-
"starter",
|
|
385
|
-
"information-hub",
|
|
386
|
-
"distribution",
|
|
387
|
-
"knowledge-packs",
|
|
388
|
-
"agents"
|
|
389
|
-
],
|
|
390
|
-
"publisher": {
|
|
391
|
-
"id": "treeseed",
|
|
392
|
-
"name": "TreeSeed",
|
|
393
|
-
"url": "https://treeseed.dev"
|
|
394
|
-
},
|
|
395
|
-
"publisherVerified": true,
|
|
396
|
-
"templateVersion": "1.0.0",
|
|
397
|
-
"templateApiVersion": 1,
|
|
398
|
-
"minCliVersion": "0.1.1",
|
|
399
|
-
"minCoreVersion": "0.1.2",
|
|
400
|
-
"fulfillment": {
|
|
401
|
-
"mode": "git",
|
|
402
|
-
"source": {
|
|
403
|
-
"kind": "git",
|
|
404
|
-
"repoUrl": "https://github.com/treeseed-templates/information-hub.git",
|
|
405
|
-
"directory": ".",
|
|
406
|
-
"ref": "staging",
|
|
407
|
-
"integrity": "pending-external-repo"
|
|
408
|
-
},
|
|
409
|
-
"hooksPolicy": "builtin_only",
|
|
410
|
-
"supportsReconcile": true
|
|
411
|
-
},
|
|
412
|
-
"offer": {
|
|
413
|
-
"priceModel": "free",
|
|
414
|
-
"license": "AGPL-3.0-only",
|
|
415
|
-
"support": "community"
|
|
416
|
-
},
|
|
417
|
-
"launchRequirements": {
|
|
418
|
-
"version": 1,
|
|
419
|
-
"hosts": [
|
|
420
|
-
{
|
|
421
|
-
"kind": "host",
|
|
422
|
-
"key": "sourceRepository",
|
|
423
|
-
"type": "repository",
|
|
424
|
-
"required": true,
|
|
425
|
-
"compatibleProviders": [
|
|
426
|
-
"github"
|
|
427
|
-
],
|
|
428
|
-
"displayName": "Source repository",
|
|
429
|
-
"purpose": "Create and push the generated information hub project repository.",
|
|
430
|
-
"defaultSelection": "team-default",
|
|
431
|
-
"configWrites": [
|
|
432
|
-
{
|
|
433
|
-
"target": "treeseed.site.yaml",
|
|
434
|
-
"path": "hosting.hostBindings.sourceRepository.provider",
|
|
435
|
-
"valueFrom": "selectedHost.provider"
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
"target": "treeseed.site.yaml",
|
|
439
|
-
"path": "hosting.hostBindings.sourceRepository.owner",
|
|
440
|
-
"valueFrom": "selectedHost.github.owner"
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
"target": "treeseed.site.yaml",
|
|
444
|
-
"path": "hosting.hostBindings.sourceRepository.repository",
|
|
445
|
-
"valueFrom": "derived.repositoryName"
|
|
446
|
-
}
|
|
447
|
-
],
|
|
448
|
-
"environmentWrites": [
|
|
449
|
-
{
|
|
450
|
-
"env": "GITHUB_TOKEN",
|
|
451
|
-
"valueFrom": "selectedHost.token",
|
|
452
|
-
"targets": [
|
|
453
|
-
"github-secret"
|
|
454
|
-
],
|
|
455
|
-
"scopes": [
|
|
456
|
-
"staging",
|
|
457
|
-
"prod"
|
|
458
|
-
],
|
|
459
|
-
"sensitivity": "secret"
|
|
460
|
-
}
|
|
461
|
-
]
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
"kind": "host",
|
|
465
|
-
"key": "publicWeb",
|
|
466
|
-
"type": "web",
|
|
467
|
-
"required": true,
|
|
468
|
-
"compatibleProviders": [
|
|
469
|
-
"cloudflare"
|
|
470
|
-
],
|
|
471
|
-
"displayName": "Public web host",
|
|
472
|
-
"purpose": "Deploy the information hub site, previews, content storage, and web runtime resources.",
|
|
473
|
-
"defaultSelection": "managed",
|
|
474
|
-
"configWrites": [
|
|
475
|
-
{
|
|
476
|
-
"target": "treeseed.site.yaml",
|
|
477
|
-
"path": "hosting.hostBindings.publicWeb.provider",
|
|
478
|
-
"valueFrom": "selectedHost.provider"
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
"target": "treeseed.site.yaml",
|
|
482
|
-
"path": "surfaces.web.provider",
|
|
483
|
-
"valueFrom": "selectedHost.provider"
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
"target": "treeseed.site.yaml",
|
|
487
|
-
"path": "surfaces.web.environments.prod.domain",
|
|
488
|
-
"valueFrom": "launchInput.domains.productionDomain",
|
|
489
|
-
"writeWhen": "host-selected"
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
"target": "treeseed.site.yaml",
|
|
493
|
-
"path": "surfaces.web.environments.staging.domain",
|
|
494
|
-
"valueFrom": "launchInput.domains.stagingDomain",
|
|
495
|
-
"writeWhen": "host-selected"
|
|
496
|
-
}
|
|
497
|
-
],
|
|
498
|
-
"environmentWrites": [
|
|
499
|
-
{
|
|
500
|
-
"env": "TREESEED_PUBLIC_WEB_PROVIDER",
|
|
501
|
-
"valueFrom": "selectedHost.provider",
|
|
502
|
-
"targets": [
|
|
503
|
-
"github-variable",
|
|
504
|
-
"cloudflare-var"
|
|
505
|
-
],
|
|
506
|
-
"scopes": [
|
|
507
|
-
"staging",
|
|
508
|
-
"prod"
|
|
509
|
-
],
|
|
510
|
-
"sensitivity": "plain"
|
|
511
|
-
}
|
|
512
|
-
]
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
"kind": "host",
|
|
516
|
-
"key": "transactionalEmail",
|
|
517
|
-
"type": "email",
|
|
518
|
-
"required": false,
|
|
519
|
-
"compatibleProviders": [
|
|
520
|
-
"smtp"
|
|
521
|
-
],
|
|
522
|
-
"displayName": "Transactional email",
|
|
523
|
-
"purpose": "Send form, account, and information hub project notification email.",
|
|
524
|
-
"defaultSelection": "managed",
|
|
525
|
-
"configWrites": [
|
|
526
|
-
{
|
|
527
|
-
"target": "treeseed.site.yaml",
|
|
528
|
-
"path": "hosting.hostBindings.transactionalEmail.provider",
|
|
529
|
-
"valueFrom": "selectedHost.provider",
|
|
530
|
-
"writeWhen": "host-selected"
|
|
531
|
-
}
|
|
532
|
-
],
|
|
533
|
-
"environmentWrites": [
|
|
534
|
-
{
|
|
535
|
-
"env": "SMTP_HOST",
|
|
536
|
-
"valueFrom": "selectedHost.smtpHost",
|
|
537
|
-
"targets": [
|
|
538
|
-
"github-secret",
|
|
539
|
-
"railway-secret"
|
|
540
|
-
],
|
|
541
|
-
"scopes": [
|
|
542
|
-
"staging",
|
|
543
|
-
"prod"
|
|
544
|
-
],
|
|
545
|
-
"sensitivity": "secret"
|
|
546
|
-
}
|
|
547
|
-
]
|
|
548
|
-
}
|
|
549
|
-
]
|
|
550
|
-
},
|
|
551
|
-
"relatedBooks": [],
|
|
552
|
-
"relatedKnowledge": [],
|
|
553
|
-
"relatedObjectives": []
|
|
554
|
-
},
|
|
555
371
|
{
|
|
556
372
|
"id": "market-control-plane",
|
|
557
373
|
"displayName": "TreeSeed Market Control Plane",
|
package/dist/types/agents.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ export declare const AGENT_TRIGGER_KINDS: readonly ["schedule", "message", "foll
|
|
|
2
2
|
export declare const AGENT_PERMISSION_OPERATIONS: readonly ["get", "read", "search", "follow", "pick", "create", "update"];
|
|
3
3
|
export declare const AGENT_MESSAGE_STATUSES: readonly ["pending", "claimed", "completed", "failed", "dead_letter"];
|
|
4
4
|
export declare const AGENT_RUN_STATUSES: readonly ["running", "completed", "failed", "waiting"];
|
|
5
|
-
export declare const AGENT_HANDLER_KINDS: readonly ["
|
|
5
|
+
export declare const AGENT_HANDLER_KINDS: readonly ["writer", "actor", "estimate", "releaser", "reporter"];
|
|
6
|
+
export declare const AGENT_ACTIVITY_TYPES: readonly ["planning", "estimating", "acting", "reviewing", "reporting"];
|
|
7
|
+
export declare const ENGINEERING_HANDLER_KINDS: readonly ["writer", "actor", "estimate", "releaser", "reporter"];
|
|
6
8
|
export declare const AGENT_CLI_ALLOW_TOOLS: readonly ["shell(git)", "shell(npm)", "web"];
|
|
7
9
|
export declare const EXECUTION_RESOURCE_NEED_KINDS: readonly ["repository", "treedx_workspace", "workflow", "secret", "external_issue", "external_job"];
|
|
8
10
|
export declare const EXECUTION_PROVIDER_KINDS: readonly ["ai_model", "human_issue_queue", "deterministic_workflow", "local_process"];
|
|
@@ -14,6 +16,8 @@ export type AgentPermissionOperation = (typeof AGENT_PERMISSION_OPERATIONS)[numb
|
|
|
14
16
|
export type AgentMessageStatus = (typeof AGENT_MESSAGE_STATUSES)[number];
|
|
15
17
|
export type AgentRunStatus = (typeof AGENT_RUN_STATUSES)[number];
|
|
16
18
|
export type AgentHandlerKind = string;
|
|
19
|
+
export type AgentActivityType = (typeof AGENT_ACTIVITY_TYPES)[number];
|
|
20
|
+
export type EngineeringHandlerKind = (typeof ENGINEERING_HANDLER_KINDS)[number];
|
|
17
21
|
export type AgentCliAllowTool = (typeof AGENT_CLI_ALLOW_TOOLS)[number];
|
|
18
22
|
export type ExecutionResourceNeedKind = (typeof EXECUTION_RESOURCE_NEED_KINDS)[number] | string;
|
|
19
23
|
export type ExecutionProviderKind = (typeof EXECUTION_PROVIDER_KINDS)[number] | string;
|
|
@@ -69,6 +73,7 @@ export interface AgentOutputContract {
|
|
|
69
73
|
}
|
|
70
74
|
export interface AgentToolPolicy {
|
|
71
75
|
allowed: string[];
|
|
76
|
+
denied?: string[];
|
|
72
77
|
}
|
|
73
78
|
export interface AgentContentScope {
|
|
74
79
|
models: string[];
|
|
@@ -84,6 +89,94 @@ export interface AgentContentAccessPolicy {
|
|
|
84
89
|
allowed: boolean;
|
|
85
90
|
};
|
|
86
91
|
}
|
|
92
|
+
export type AgentBranchPolicy = {
|
|
93
|
+
kind: 'read-only';
|
|
94
|
+
base: 'main' | 'staging';
|
|
95
|
+
} | {
|
|
96
|
+
kind: 'main-planning-content';
|
|
97
|
+
base: 'main';
|
|
98
|
+
} | {
|
|
99
|
+
kind: 'staging-content';
|
|
100
|
+
base: 'staging';
|
|
101
|
+
} | {
|
|
102
|
+
kind: 'assignment-feature';
|
|
103
|
+
base: 'staging';
|
|
104
|
+
target: 'staging';
|
|
105
|
+
prefix?: string;
|
|
106
|
+
branchNameTemplate?: string;
|
|
107
|
+
worktree?: 'new' | 'reuse';
|
|
108
|
+
updateBaseBeforeRun?: boolean;
|
|
109
|
+
mergeTargetBeforeSave?: boolean;
|
|
110
|
+
} | {
|
|
111
|
+
kind: 'staging-release';
|
|
112
|
+
base: 'staging';
|
|
113
|
+
target: 'main';
|
|
114
|
+
};
|
|
115
|
+
export type AgentQuestionAnswerPolicy = {
|
|
116
|
+
kind: 'team-human';
|
|
117
|
+
teamId?: string;
|
|
118
|
+
requiredRoles?: string[];
|
|
119
|
+
} | {
|
|
120
|
+
kind: 'human-or-agent';
|
|
121
|
+
teamId?: string;
|
|
122
|
+
allowedRoles?: string[];
|
|
123
|
+
allowedAgentClasses?: string[];
|
|
124
|
+
} | {
|
|
125
|
+
kind: 'specific-human';
|
|
126
|
+
teamMemberId: string;
|
|
127
|
+
} | {
|
|
128
|
+
kind: 'specific-agent';
|
|
129
|
+
projectId: string;
|
|
130
|
+
agentSlug: string;
|
|
131
|
+
};
|
|
132
|
+
export interface AgentQuestionPolicy {
|
|
133
|
+
defaultAnswerPolicy?: AgentQuestionAnswerPolicy;
|
|
134
|
+
blockExecutionWhenCreated?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export interface AgentActivityPromptConfig {
|
|
137
|
+
system: string;
|
|
138
|
+
task?: string;
|
|
139
|
+
templates?: Record<string, string>;
|
|
140
|
+
}
|
|
141
|
+
export interface AgentActivityExecutionConfig {
|
|
142
|
+
providerPreference?: string[];
|
|
143
|
+
maxRuntimeSeconds?: number;
|
|
144
|
+
maxRetries?: number;
|
|
145
|
+
verificationRequired?: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface AgentActivityProfile {
|
|
148
|
+
enabled: boolean;
|
|
149
|
+
handler: EngineeringHandlerKind;
|
|
150
|
+
prompt: AgentActivityPromptConfig;
|
|
151
|
+
branchPolicy: AgentBranchPolicy;
|
|
152
|
+
contentAccess?: AgentContentAccessPolicy;
|
|
153
|
+
tools: AgentToolPolicy;
|
|
154
|
+
outputs: AgentOutputContract;
|
|
155
|
+
questionPolicy?: AgentQuestionPolicy;
|
|
156
|
+
execution?: AgentActivityExecutionConfig;
|
|
157
|
+
}
|
|
158
|
+
export interface AgentCapability {
|
|
159
|
+
id: string;
|
|
160
|
+
description?: string;
|
|
161
|
+
produces?: string[];
|
|
162
|
+
requires?: string[];
|
|
163
|
+
reviews?: string[];
|
|
164
|
+
metadata?: Record<string, unknown>;
|
|
165
|
+
}
|
|
166
|
+
export interface AgentDefinitionIdentity {
|
|
167
|
+
purpose: string;
|
|
168
|
+
responsibilities: string[];
|
|
169
|
+
durableInstructions: string;
|
|
170
|
+
}
|
|
171
|
+
export interface AgentDefinition {
|
|
172
|
+
slug: string;
|
|
173
|
+
title: string;
|
|
174
|
+
agentClass: string;
|
|
175
|
+
template?: string;
|
|
176
|
+
identity: AgentDefinitionIdentity;
|
|
177
|
+
capabilities: AgentCapability[];
|
|
178
|
+
activityProfiles: Partial<Record<AgentActivityType, AgentActivityProfile>>;
|
|
179
|
+
}
|
|
87
180
|
export interface AgentExecutionConfig {
|
|
88
181
|
provider?: string;
|
|
89
182
|
model?: string;
|
|
@@ -176,7 +269,7 @@ export interface AgentWorkPackageConstraints {
|
|
|
176
269
|
maxAttempts?: number | null;
|
|
177
270
|
metadata?: Record<string, unknown>;
|
|
178
271
|
}
|
|
179
|
-
export type AgentHandlerAlgorithmKind =
|
|
272
|
+
export type AgentHandlerAlgorithmKind = EngineeringHandlerKind;
|
|
180
273
|
export type AgentWorkPackageKind = AgentHandlerAlgorithmKind | string;
|
|
181
274
|
export interface AgentInputSelector {
|
|
182
275
|
source: string;
|
|
@@ -332,9 +425,14 @@ export interface AgentCliOptions {
|
|
|
332
425
|
export interface AgentRuntimeSpec {
|
|
333
426
|
slug: string;
|
|
334
427
|
handler: AgentHandlerKind;
|
|
428
|
+
activityType?: AgentActivityType;
|
|
429
|
+
activityProfiles?: Partial<Record<AgentActivityType, AgentActivityProfile>>;
|
|
430
|
+
branchPolicy?: AgentBranchPolicy;
|
|
431
|
+
questionPolicy?: AgentQuestionPolicy;
|
|
432
|
+
identity?: AgentDefinitionIdentity;
|
|
335
433
|
projectAgentClassId?: string;
|
|
336
434
|
projectAgentClassSlug?: string;
|
|
337
|
-
|
|
435
|
+
activityConfig?: AgentHandlerConfig;
|
|
338
436
|
enabled: boolean;
|
|
339
437
|
systemPrompt: string;
|
|
340
438
|
persona: string;
|
package/dist/types/agents.js
CHANGED
|
@@ -17,13 +17,25 @@ const AGENT_MESSAGE_STATUSES = [
|
|
|
17
17
|
];
|
|
18
18
|
const AGENT_RUN_STATUSES = ["running", "completed", "failed", "waiting"];
|
|
19
19
|
const AGENT_HANDLER_KINDS = [
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
"writer",
|
|
21
|
+
"actor",
|
|
22
|
+
"estimate",
|
|
23
|
+
"releaser",
|
|
24
|
+
"reporter"
|
|
25
|
+
];
|
|
26
|
+
const AGENT_ACTIVITY_TYPES = [
|
|
27
|
+
"planning",
|
|
28
|
+
"estimating",
|
|
29
|
+
"acting",
|
|
30
|
+
"reviewing",
|
|
31
|
+
"reporting"
|
|
32
|
+
];
|
|
33
|
+
const ENGINEERING_HANDLER_KINDS = [
|
|
34
|
+
"writer",
|
|
35
|
+
"actor",
|
|
36
|
+
"estimate",
|
|
37
|
+
"releaser",
|
|
38
|
+
"reporter"
|
|
27
39
|
];
|
|
28
40
|
const AGENT_CLI_ALLOW_TOOLS = [
|
|
29
41
|
"shell(git)",
|
|
@@ -67,12 +79,14 @@ const EXECUTION_PROVIDER_QUOTA_VISIBILITIES = [
|
|
|
67
79
|
"exact"
|
|
68
80
|
];
|
|
69
81
|
export {
|
|
82
|
+
AGENT_ACTIVITY_TYPES,
|
|
70
83
|
AGENT_CLI_ALLOW_TOOLS,
|
|
71
84
|
AGENT_HANDLER_KINDS,
|
|
72
85
|
AGENT_MESSAGE_STATUSES,
|
|
73
86
|
AGENT_PERMISSION_OPERATIONS,
|
|
74
87
|
AGENT_RUN_STATUSES,
|
|
75
88
|
AGENT_TRIGGER_KINDS,
|
|
89
|
+
ENGINEERING_HANDLER_KINDS,
|
|
76
90
|
EXECUTION_PROVIDER_KINDS,
|
|
77
91
|
EXECUTION_PROVIDER_PRESSURE_STATES,
|
|
78
92
|
EXECUTION_PROVIDER_QUOTA_VISIBILITIES,
|
|
@@ -8,6 +8,7 @@ import { resolveTreeseedWorkflowState, type TreeseedWorkflowStatusOptions } from
|
|
|
8
8
|
import { type TreeseedReconcileResult } from '../reconcile/index.js';
|
|
9
9
|
import { type TreeseedWorkflowRunCommand, type TreeseedWorkflowRunJournal } from './runs.js';
|
|
10
10
|
import { type TreeseedWorkflowMode } from './session.js';
|
|
11
|
+
import { type TreeseedManagedRepository } from '../operations/services/managed-repositories.js';
|
|
11
12
|
import type { TreeseedCloseInput, TreeseedCiInput, TreeseedConfigInput, TreeseedDestroyInput, TreeseedExportInput, TreeseedReleaseCandidateInput, TreeseedReleaseInput, TreeseedRecoverInput, TreeseedResumeInput, TreeseedSaveInput, TreeseedStageInput, TreeseedSwitchInput, TreeseedTaskBranchMetadata, TreeseedUpdateInput, TreeseedWorkflowContext, TreeseedWorkflowCiMode, TreeseedWorkflowDevInput, TreeseedWorkflowExecutionMode, TreeseedWorkflowOperationId, TreeseedWorkflowResult, TreeseedWorkflowWorktreeMode, TreeseedReleaseCandidateMode, TreeseedProofInput } from '../workflow.js';
|
|
12
13
|
type WorkflowWrite = NonNullable<TreeseedWorkflowContext['write']>;
|
|
13
14
|
type WorkflowStatePayload = ReturnType<typeof resolveTreeseedWorkflowState>;
|
|
@@ -845,6 +846,7 @@ type StageRepoPlan = {
|
|
|
845
846
|
name: string;
|
|
846
847
|
path: string;
|
|
847
848
|
kind: 'root' | 'managed';
|
|
849
|
+
repoKind?: TreeseedManagedRepository['kind'];
|
|
848
850
|
sourceBranch: string;
|
|
849
851
|
targetBranch: typeof STAGING_BRANCH;
|
|
850
852
|
remoteSourceExists: boolean;
|
|
@@ -957,6 +959,12 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
957
959
|
sceneArtifacts: "full" | "screenshots";
|
|
958
960
|
releaseImageRefs: Record<string, string>;
|
|
959
961
|
localCleanup: import("../workflow-support.js").TreeseedLocalCleanupReport | null;
|
|
962
|
+
releaseHelperRepos: {
|
|
963
|
+
name: string;
|
|
964
|
+
kind: import("../operations/services/managed-repositories.js").TreeseedManagedRepositoryKind;
|
|
965
|
+
path: string;
|
|
966
|
+
remote: string | null;
|
|
967
|
+
}[];
|
|
960
968
|
autoResumeCandidate: {
|
|
961
969
|
runId: string;
|
|
962
970
|
branch: string | null;
|
|
@@ -1045,6 +1053,30 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1045
1053
|
workspaceUnlink: import("../operations/services/workspace-dependency-mode.js").WorkspaceDependencyModeReport;
|
|
1046
1054
|
};
|
|
1047
1055
|
packageReleases: Record<string, unknown>[];
|
|
1056
|
+
managedHelperReleases: {
|
|
1057
|
+
status: string;
|
|
1058
|
+
repos: {
|
|
1059
|
+
name: string;
|
|
1060
|
+
kind: import("../operations/services/managed-repositories.js").TreeseedManagedRepositoryKind;
|
|
1061
|
+
path: string;
|
|
1062
|
+
stagingHead: string;
|
|
1063
|
+
promotion: {
|
|
1064
|
+
targetBranch: string;
|
|
1065
|
+
expectedBefore: string | null;
|
|
1066
|
+
commitSha: string;
|
|
1067
|
+
pushed: boolean;
|
|
1068
|
+
verified: boolean;
|
|
1069
|
+
};
|
|
1070
|
+
backMerge: {
|
|
1071
|
+
status: string;
|
|
1072
|
+
merged: boolean;
|
|
1073
|
+
repoName: string;
|
|
1074
|
+
sourceBranch: string;
|
|
1075
|
+
targetBranch: string;
|
|
1076
|
+
commitSha: string;
|
|
1077
|
+
};
|
|
1078
|
+
}[];
|
|
1079
|
+
};
|
|
1048
1080
|
rootRelease: {
|
|
1049
1081
|
name: string;
|
|
1050
1082
|
version: string;
|
|
@@ -1248,6 +1280,12 @@ export declare function workflowRelease(helpers: WorkflowOperationHelpers, input
|
|
|
1248
1280
|
sceneArtifacts: "full" | "screenshots";
|
|
1249
1281
|
releaseImageRefs: Record<string, string>;
|
|
1250
1282
|
localCleanup: import("../workflow-support.js").TreeseedLocalCleanupReport | null;
|
|
1283
|
+
releaseHelperRepos: {
|
|
1284
|
+
name: string;
|
|
1285
|
+
kind: import("../operations/services/managed-repositories.js").TreeseedManagedRepositoryKind;
|
|
1286
|
+
path: string;
|
|
1287
|
+
remote: string | null;
|
|
1288
|
+
}[];
|
|
1251
1289
|
freshArchivedRuns: never[];
|
|
1252
1290
|
autoResumeCandidate: {
|
|
1253
1291
|
runId: string;
|