qlogicagent 2.24.1 → 2.24.2
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/README.md +52 -324
- package/dist/agent.js +38 -43
- package/dist/cli.js +7 -7
- package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
- package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
- package/dist/index.js +265 -1018
- package/dist/orchestration.js +10 -10
- package/dist/types/agent/runtime-vars.d.ts +1 -16
- package/dist/types/agent/tool-loop/compression-pipeline.d.ts +0 -2
- package/dist/types/agent/tool-loop.d.ts +0 -6
- package/dist/types/agent/types.d.ts +3 -22
- package/dist/types/cli/acp-commands.d.ts +4 -5
- package/dist/types/cli/acp-message-router.d.ts +1 -2
- package/dist/types/cli/acp-session-handlers.d.ts +6 -12
- package/dist/types/cli/acp-session-host.d.ts +5 -48
- package/dist/types/cli/adapter-launch-config.d.ts +14 -0
- package/dist/types/cli/agent-runtime-bootstrap.d.ts +2 -23
- package/dist/types/cli/agent-runtime-session-state.d.ts +1 -6
- package/dist/types/cli/base-tool-bootstrap.d.ts +0 -2
- package/dist/types/cli/cli-acp-request-handler.d.ts +3 -5
- package/dist/types/cli/core-tool-coordinator.d.ts +0 -4
- package/dist/types/cli/core-tools/agent-tool-service.d.ts +0 -3
- package/dist/types/cli/core-tools/fork-system-prompt.d.ts +1 -5
- package/dist/types/cli/handlers/files-handler.d.ts +0 -6
- package/dist/types/cli/handlers/turn-handler.d.ts +7 -83
- package/dist/types/cli/main.d.ts +2 -4
- package/dist/types/cli/permission-approval-bridge.d.ts +2 -6
- package/dist/types/cli/permission-bootstrap.d.ts +2 -12
- package/dist/types/cli/plugin-bootstrap.d.ts +2 -4
- package/dist/types/cli/runtime-hook-bootstrap.d.ts +0 -21
- package/dist/types/cli/session-context.d.ts +4 -14
- package/dist/types/cli/session-coordinator.d.ts +1 -9
- package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +2 -9
- package/dist/types/cli/stdio-acp-request-host.d.ts +3 -15
- package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +3 -23
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -8
- package/dist/types/cli/stdio-runtime-services.d.ts +2 -13
- package/dist/types/cli/stdio-server.d.ts +6 -128
- package/dist/types/cli/tool-bootstrap.d.ts +4 -8
- package/dist/types/cli/tool-catalog.d.ts +2 -2
- package/dist/types/cli/tool-invoker-factory.d.ts +0 -2
- package/dist/types/cli/tool-registry-adapter.d.ts +3 -7
- package/dist/types/cli/tool-result-processor.d.ts +0 -1
- package/dist/types/cli/turn-core.d.ts +6 -10
- package/dist/types/cli/turn-event-forwarder.d.ts +6 -3
- package/dist/types/cli/turn-lifecycle.d.ts +0 -3
- package/dist/types/cli/turn-project-router.d.ts +0 -7
- package/dist/types/contracts/hooks.d.ts +1 -20
- package/dist/types/contracts/tool-execution-evidence.d.ts +20 -1
- package/dist/types/contracts/turn-event.d.ts +2 -2
- package/dist/types/orchestration/index.d.ts +1 -1
- package/dist/types/protocol/notifications.d.ts +2 -9
- package/dist/types/protocol/wire/acp-protocol.d.ts +12 -186
- package/dist/types/protocol/wire/capability-transport.d.ts +0 -2
- package/dist/types/protocol/wire/index.d.ts +2 -10
- package/dist/types/protocol/wire/notification-payloads.d.ts +4 -989
- package/dist/types/protocol/wire/thread-protocol.d.ts +24 -3
- package/dist/types/runtime/config/tunable-defaults.d.ts +3 -75
- package/dist/types/runtime/execution/forked-agent.d.ts +2 -5
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +0 -2
- package/dist/types/runtime/execution/tool-result-storage.d.ts +13 -4
- package/dist/types/runtime/infra/agent-paths.d.ts +4 -54
- package/dist/types/runtime/infra/agent-project-projection.d.ts +20 -0
- package/dist/types/runtime/infra/background-tasks.d.ts +3 -3
- package/dist/types/runtime/infra/default-path-service.d.ts +0 -7
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +1 -1
- package/dist/types/runtime/infra/model-registry.d.ts +6 -9
- package/dist/types/runtime/infra/project-store.d.ts +3 -3
- package/dist/types/runtime/infra/subagent-turn-snapshot.d.ts +54 -7
- package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
- package/dist/types/runtime/ports/agent-runtime-ports.d.ts +1 -3
- package/dist/types/runtime/ports/index.d.ts +0 -4
- package/dist/types/runtime/ports/path-service.d.ts +1 -9
- package/dist/types/runtime/ports/tool-contracts.d.ts +0 -1
- package/dist/types/runtime/session/agent-session-projection.d.ts +37 -0
- package/dist/types/runtime/tasks/task-types.d.ts +2 -25
- package/dist/types/skills/mcp/mcp-manager.d.ts +2 -2
- package/dist/types/skills/plugins/plugin-loader.d.ts +1 -1
- package/dist/types/skills/skill-system/skill-category.d.ts +4 -2
- package/dist/types/skills/tools.d.ts +1 -18
- package/dist/types/test-support/project-store-fixture.d.ts +4 -4
- package/dist/types/transport/acp-event-emitter.d.ts +1 -20
- package/dist/types/transport/acp-server.d.ts +8 -88
- package/package.json +4 -96
- package/dist/agent-contract.js +0 -1
- package/dist/host-contract.js +0 -1
- package/dist/host-session-collection-contract.js +0 -1
- package/dist/memory-category-contract.js +0 -1
- package/dist/permissions.js +0 -1
- package/dist/plugin-marketplace-compute.js +0 -1
- package/dist/project-memory-host.js +0 -38
- package/dist/protocol.js +0 -1
- package/dist/skill-category-contract.js +0 -1
- package/dist/tunables.js +0 -1
- package/dist/types/agent/memory-recall-context.d.ts +0 -22
- package/dist/types/agent/memory-recall-injection.d.ts +0 -32
- package/dist/types/cli/acp-extended-handlers.d.ts +0 -110
- package/dist/types/cli/acp-extended-host-adapter.d.ts +0 -20
- package/dist/types/cli/community-resource-installer.d.ts +0 -39
- package/dist/types/cli/community-skill-installer.d.ts +0 -18
- package/dist/types/cli/community-workflow-installer.d.ts +0 -29
- package/dist/types/cli/default-project-bootstrap.d.ts +0 -12
- package/dist/types/cli/dream-host-adapter.d.ts +0 -24
- package/dist/types/cli/gateway-rpc-connection.d.ts +0 -50
- package/dist/types/cli/handlers/community-handler.d.ts +0 -14
- package/dist/types/cli/handlers/config-handler.d.ts +0 -19
- package/dist/types/cli/handlers/control-handler.d.ts +0 -29
- package/dist/types/cli/handlers/dream-handler.d.ts +0 -41
- package/dist/types/cli/handlers/goal-handler.d.ts +0 -66
- package/dist/types/cli/handlers/memory-handler.d.ts +0 -23
- package/dist/types/cli/handlers/product-handler.d.ts +0 -35
- package/dist/types/cli/handlers/session-handler.d.ts +0 -29
- package/dist/types/cli/handlers/skill-curator-handler.d.ts +0 -8
- package/dist/types/cli/handlers/solo-handler.d.ts +0 -25
- package/dist/types/cli/handlers/turn-baseline-handler.d.ts +0 -8
- package/dist/types/cli/handlers/workflow-compute-handler.d.ts +0 -8
- package/dist/types/cli/handlers/working-materials-handler.d.ts +0 -9
- package/dist/types/cli/idle-dream-coordinator.d.ts +0 -57
- package/dist/types/cli/memory-background-coordinator.d.ts +0 -26
- package/dist/types/cli/memory-candidate-service.d.ts +0 -75
- package/dist/types/cli/memory-coordinator.d.ts +0 -40
- package/dist/types/cli/multi-agent-handler-host.d.ts +0 -16
- package/dist/types/cli/multi-agent-state-coordinator.d.ts +0 -8
- package/dist/types/cli/orchestration-memory-context.d.ts +0 -23
- package/dist/types/cli/product-acp-params.d.ts +0 -30
- package/dist/types/cli/product-coordinator.d.ts +0 -21
- package/dist/types/cli/project-memory-store-factory.d.ts +0 -12
- package/dist/types/cli/project-template-seeder.d.ts +0 -5
- package/dist/types/cli/rpc-registry.d.ts +0 -56
- package/dist/types/cli/session-history-coordinator.d.ts +0 -8
- package/dist/types/cli/session-query-service.d.ts +0 -27
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +0 -56
- package/dist/types/cli/stdio-session-runtime-coordinator.d.ts +0 -17
- package/dist/types/cli/task-distillation-coordinator.d.ts +0 -146
- package/dist/types/cli/turn-ask-user-setup.d.ts +0 -24
- package/dist/types/cli/turn-suggestion-generator.d.ts +0 -15
- package/dist/types/contracts/memory-recall-packet.d.ts +0 -31
- package/dist/types/contracts/memory-response-contract.d.ts +0 -2
- package/dist/types/host-contract/fts-segment.d.ts +0 -20
- package/dist/types/host-contract/index.d.ts +0 -1819
- package/dist/types/host-contract/memory-category.d.ts +0 -8
- package/dist/types/host-contract/skill-category.d.ts +0 -5
- package/dist/types/host-session-collection-contract.d.ts +0 -65
- package/dist/types/orchestration/agent-instance.d.ts +0 -215
- package/dist/types/orchestration/agent-roster.d.ts +0 -32
- package/dist/types/orchestration/dag-scheduler.d.ts +0 -219
- package/dist/types/orchestration/delegate-approval-policy.d.ts +0 -8
- package/dist/types/orchestration/delegate-bridge.d.ts +0 -8
- package/dist/types/orchestration/goal-acceptance.d.ts +0 -17
- package/dist/types/orchestration/goal-context-envelope.d.ts +0 -7
- package/dist/types/orchestration/goal-loop-coordinator.d.ts +0 -151
- package/dist/types/orchestration/goal-mode-adapters.d.ts +0 -152
- package/dist/types/orchestration/goal-run-persistence.d.ts +0 -21
- package/dist/types/orchestration/goal-run-types.d.ts +0 -225
- package/dist/types/orchestration/planner-memory-brief.d.ts +0 -39
- package/dist/types/orchestration/product-budget.d.ts +0 -94
- package/dist/types/orchestration/product-checkpoint.d.ts +0 -50
- package/dist/types/orchestration/product-dag-mutation-applier.d.ts +0 -10
- package/dist/types/orchestration/product-persistence.d.ts +0 -90
- package/dist/types/orchestration/product-planner.d.ts +0 -332
- package/dist/types/orchestration/product-run-coordinator.d.ts +0 -49
- package/dist/types/orchestration/product-worktree.d.ts +0 -19
- package/dist/types/orchestration/run-state-host-authority.d.ts +0 -7
- package/dist/types/orchestration/solo-evaluator.d.ts +0 -179
- package/dist/types/orchestration/solo-persistence.d.ts +0 -47
- package/dist/types/orchestration/solo-spec-builder.d.ts +0 -58
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +0 -23
- package/dist/types/orchestration/testing/host-agent-provider-directory-fixture.d.ts +0 -7
- package/dist/types/orchestration/testing/run-state-client-double.d.ts +0 -13
- package/dist/types/orchestration/workflow/budget-permission-gate.d.ts +0 -94
- package/dist/types/orchestration/workflow/builtin-capabilities.d.ts +0 -3
- package/dist/types/orchestration/workflow/builtin-executors.d.ts +0 -18
- package/dist/types/orchestration/workflow/capability-catalog.d.ts +0 -72
- package/dist/types/orchestration/workflow/cron-schedule.d.ts +0 -36
- package/dist/types/orchestration/workflow/data-item.d.ts +0 -39
- package/dist/types/orchestration/workflow/expression.d.ts +0 -60
- package/dist/types/orchestration/workflow/host-executors.d.ts +0 -15
- package/dist/types/orchestration/workflow/n8n-expression.d.ts +0 -48
- package/dist/types/orchestration/workflow/n8n-import.d.ts +0 -64
- package/dist/types/orchestration/workflow/n8n-template-compat.d.ts +0 -5
- package/dist/types/orchestration/workflow/node-registry.d.ts +0 -32
- package/dist/types/orchestration/workflow/node-schema.d.ts +0 -249
- package/dist/types/orchestration/workflow/params-schema.d.ts +0 -69
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +0 -63
- package/dist/types/orchestration/workflow/run-checkpoint-store.d.ts +0 -53
- package/dist/types/orchestration/workflow/run-history-store.d.ts +0 -103
- package/dist/types/orchestration/workflow/semantic-acceptance.d.ts +0 -65
- package/dist/types/orchestration/workflow/trigger-validation.d.ts +0 -22
- package/dist/types/orchestration/workflow/workflow-audit-store.d.ts +0 -31
- package/dist/types/orchestration/workflow/workflow-authoring.d.ts +0 -74
- package/dist/types/orchestration/workflow/workflow-bundle.d.ts +0 -51
- package/dist/types/orchestration/workflow/workflow-controller.d.ts +0 -237
- package/dist/types/orchestration/workflow/workflow-edit-context.d.ts +0 -46
- package/dist/types/orchestration/workflow/workflow-error.d.ts +0 -28
- package/dist/types/orchestration/workflow/workflow-intent-contract.d.ts +0 -56
- package/dist/types/orchestration/workflow/workflow-patch.d.ts +0 -122
- package/dist/types/orchestration/workflow/workflow-render.d.ts +0 -40
- package/dist/types/orchestration/workflow/workflow-runtime.d.ts +0 -184
- package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +0 -122
- package/dist/types/orchestration/workflow/workflow-store.d.ts +0 -85
- package/dist/types/orchestration/workflow/workflow-template-setup.d.ts +0 -65
- package/dist/types/orchestration/workflow/workflow-trigger.d.ts +0 -43
- package/dist/types/orchestration/workflow-chat-builder.d.ts +0 -152
- package/dist/types/orchestration/worktree-task-prompt.d.ts +0 -1
- package/dist/types/permissions.d.ts +0 -4
- package/dist/types/project-memory-host.d.ts +0 -4
- package/dist/types/protocol/agent-contract.d.ts +0 -93
- package/dist/types/protocol/methods.d.ts +0 -645
- package/dist/types/protocol/wire/acp-agent-management.d.ts +0 -533
- package/dist/types/protocol/wire/agent-events.d.ts +0 -1
- package/dist/types/protocol/wire/agent-methods.d.ts +0 -500
- package/dist/types/protocol/wire/agent-rpc.d.ts +0 -100
- package/dist/types/protocol/wire/gateway-contract.d.ts +0 -61
- package/dist/types/protocol/wire/gateway-rpc.d.ts +0 -1177
- package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +0 -31
- package/dist/types/protocol/wire/turn.d.ts +0 -208
- package/dist/types/runtime/community/autonomy-budget.d.ts +0 -26
- package/dist/types/runtime/community/community-consent-client.d.ts +0 -55
- package/dist/types/runtime/community/package-materialize.d.ts +0 -19
- package/dist/types/runtime/community/ranged-download.d.ts +0 -21
- package/dist/types/runtime/community/registry-signature.d.ts +0 -48
- package/dist/types/runtime/execution/dream-agent.d.ts +0 -273
- package/dist/types/runtime/execution/dream-category-context.d.ts +0 -47
- package/dist/types/runtime/execution/memory-decay.d.ts +0 -73
- package/dist/types/runtime/execution/turn-progress-notifier.d.ts +0 -16
- package/dist/types/runtime/hooks/memory-hooks.d.ts +0 -111
- package/dist/types/runtime/infra/acp-host-handler.d.ts +0 -31
- package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +0 -209
- package/dist/types/runtime/infra/acp-usage-tracker.d.ts +0 -46
- package/dist/types/runtime/infra/cloud-auth-host-authority.d.ts +0 -4
- package/dist/types/runtime/infra/feedback-distillation-worker.d.ts +0 -20
- package/dist/types/runtime/infra/feedback-distillation.d.ts +0 -32
- package/dist/types/runtime/infra/feedback-event-store.d.ts +0 -179
- package/dist/types/runtime/infra/feedback-host-authority.d.ts +0 -4
- package/dist/types/runtime/infra/feedback-outbox.d.ts +0 -26
- package/dist/types/runtime/infra/feedback-redaction.d.ts +0 -71
- package/dist/types/runtime/infra/feedback-upload-client.d.ts +0 -39
- package/dist/types/runtime/infra/feedback-upload-worker.d.ts +0 -11
- package/dist/types/runtime/infra/host-agent-provider-directory.d.ts +0 -17
- package/dist/types/runtime/infra/project-authority-facade.d.ts +0 -11
- package/dist/types/runtime/infra/project-data-paths.d.ts +0 -24
- package/dist/types/runtime/infra/project-host-authority.d.ts +0 -11
- package/dist/types/runtime/infra/project-instructions-store.d.ts +0 -30
- package/dist/types/runtime/infra/turn-baseline-store.d.ts +0 -102
- package/dist/types/runtime/infra/turn-telemetry-store.d.ts +0 -100
- package/dist/types/runtime/infra/working-materials-store.d.ts +0 -29
- package/dist/types/runtime/memory/find-relevant-memories.d.ts +0 -26
- package/dist/types/runtime/memory/implicit-extraction.d.ts +0 -69
- package/dist/types/runtime/memory/memory-recall-attribution.d.ts +0 -24
- package/dist/types/runtime/ports/memory-provider.d.ts +0 -219
- package/dist/types/runtime/ports/memory-recall-source.d.ts +0 -14
- package/dist/types/runtime/ports/memory-writer.d.ts +0 -70
- package/dist/types/runtime/ports/project-memory-store.d.ts +0 -49
- package/dist/types/runtime/prompt/host-skill-directory.d.ts +0 -16
- package/dist/types/runtime/session/group-session-split.d.ts +0 -38
- package/dist/types/runtime/session/inbound-upload-persistence.d.ts +0 -47
- package/dist/types/runtime/session/session-catalog.d.ts +0 -12
- package/dist/types/runtime/session/session-deletion-guard.d.ts +0 -4
- package/dist/types/runtime/session/session-locator.d.ts +0 -26
- package/dist/types/runtime/session/session-metadata-store.d.ts +0 -8
- package/dist/types/runtime/session/session-paths.d.ts +0 -8
- package/dist/types/runtime/session/session-permission-store.d.ts +0 -6
- package/dist/types/runtime/session/session-persistence.d.ts +0 -37
- package/dist/types/runtime/session/session-recovery.d.ts +0 -62
- package/dist/types/runtime/session/session-resource-key.d.ts +0 -28
- package/dist/types/runtime/session/session-resume.d.ts +0 -9
- package/dist/types/runtime/session/session-schema.d.ts +0 -10
- package/dist/types/runtime/session/session-summary.d.ts +0 -7
- package/dist/types/runtime/session/session-title.d.ts +0 -9
- package/dist/types/runtime/session/session-transcript-store.d.ts +0 -30
- package/dist/types/runtime/session/session-types.d.ts +0 -113
- package/dist/types/runtime/session/session-write-queue.d.ts +0 -3
- package/dist/types/skills/memory/host-memory-provider.d.ts +0 -235
- package/dist/types/skills/memory/memdir.d.ts +0 -111
- package/dist/types/skills/memory/memory-content-safety.d.ts +0 -1
- package/dist/types/skills/memory/memory-vector-utils.d.ts +0 -2
- package/dist/types/skills/memory/task-distillation.d.ts +0 -183
- package/dist/types/skills/plugins/plugin-marketplace.d.ts +0 -43
- package/dist/types/skills/skill-system/skill-bundles.d.ts +0 -8
- package/dist/types/skills/skill-system/skill-lifecycle.d.ts +0 -89
- package/dist/types/test-support/run-state-authority-setup.d.ts +0 -1
- package/dist/types/transport/delegate-client.d.ts +0 -82
- package/dist/types/transport/host-capability-client.d.ts +0 -21
- package/dist/types/transport/host-cloud-auth-client.d.ts +0 -10
- package/dist/types/transport/host-community-client.d.ts +0 -7
- package/dist/types/transport/host-feedback-client.d.ts +0 -25
- package/dist/types/transport/host-profile-client.d.ts +0 -19
- package/dist/types/transport/host-project-client.d.ts +0 -16
- package/dist/types/transport/host-request-client.d.ts +0 -42
- package/dist/types/transport/host-run-state-client.d.ts +0 -23
- package/dist/types/transport/host-session-client.d.ts +0 -30
- package/dist/types/tunables.d.ts +0 -2
- package/dist/types/workflow-host.d.ts +0 -38
- package/dist/workflow-host.js +0 -11
- /package/dist/types/{host-contract → protocol/wire}/acp-content.d.ts +0 -0
- /package/dist/types/{host-contract → runtime/infra}/project-id.d.ts +0 -0
- /package/dist/types/{host-contract → runtime/infra}/provider-profile.d.ts +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Host-owned taxonomy shared by every long-term-memory producer and consumer. */
|
|
2
|
-
export declare const LONG_TERM_MEMORY_CATEGORIES: readonly ["fact", "preference", "insight", "lesson", "decision", "plan", "event", "pattern", "context", "procedure", "general"];
|
|
3
|
-
export type LongTermMemoryCategory = (typeof LONG_TERM_MEMORY_CATEGORIES)[number];
|
|
4
|
-
/** Logical relation between an atomic claim slot and its structured value. */
|
|
5
|
-
export declare const MEMORY_CLAIM_RELATIONS: readonly ["equals", "includes", "excludes"];
|
|
6
|
-
export type MemoryClaimRelation = (typeof MEMORY_CLAIM_RELATIONS)[number];
|
|
7
|
-
export declare function normalizeLongTermMemoryCategory(value: unknown, fallback?: LongTermMemoryCategory): LongTermMemoryCategory;
|
|
8
|
-
export declare function normalizeMemoryClaimRelation(value: unknown, fallback?: MemoryClaimRelation): MemoryClaimRelation;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** Host-owned taxonomy shared by skill promotion, persistence, and UI. */
|
|
2
|
-
export declare const HUB_SKILL_CATEGORIES: readonly ["efficiency", "dev", "cloud", "data", "industrial", "marketing", "ecommerce", "procurement", "hr", "accounting", "finance", "legal", "lifestyle"];
|
|
3
|
-
export type HubSkillCategory = (typeof HUB_SKILL_CATEGORIES)[number];
|
|
4
|
-
export declare const HUB_SKILL_CATEGORY_LABELS: Readonly<Record<HubSkillCategory, string>>;
|
|
5
|
-
export declare function isHubSkillCategory(value: unknown): value is HubSkillCategory;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser-safe Host session collection protocol.
|
|
3
|
-
*
|
|
4
|
-
* This is the common protocol layer shared by Gateway and renderer clients. It intentionally has
|
|
5
|
-
* no Node/runtime imports; Host services and native Providers remain behind the Gateway facade.
|
|
6
|
-
*/
|
|
7
|
-
import type { AgentId, CanonicalSessionId, NativeSessionRef, ProjectId } from "./host-contract/index.js";
|
|
8
|
-
export type HostSessionTitleSource = "prompt" | "generated" | "user" | "native" | "repaired";
|
|
9
|
-
export type HostSessionLifecycle = "active" | "archived" | "source-missing" | "resume-unavailable";
|
|
10
|
-
export type HostSessionCommand = "host.setPinned" | "host.rename" | "host.setArchived" | "host.deleteRecord";
|
|
11
|
-
export type HostSessionCollectionScope = {
|
|
12
|
-
kind: "project";
|
|
13
|
-
projectId: ProjectId;
|
|
14
|
-
} | {
|
|
15
|
-
kind: "workspace-tree";
|
|
16
|
-
};
|
|
17
|
-
export interface HostSessionSummary {
|
|
18
|
-
resourceId: string;
|
|
19
|
-
canonicalSessionId?: CanonicalSessionId;
|
|
20
|
-
source: "host" | "native-unadopted";
|
|
21
|
-
projectId: ProjectId;
|
|
22
|
-
agentId: AgentId;
|
|
23
|
-
title?: string;
|
|
24
|
-
titleSource?: HostSessionTitleSource;
|
|
25
|
-
lastActiveAt: string;
|
|
26
|
-
pinnedAt?: string;
|
|
27
|
-
lifecycle: HostSessionLifecycle;
|
|
28
|
-
/** Host-authorized mutation surface. Renderer commands are a projection of this list. */
|
|
29
|
-
availableCommands: HostSessionCommand[];
|
|
30
|
-
nativeRef?: NativeSessionRef;
|
|
31
|
-
}
|
|
32
|
-
export interface HostSessionProviderDiagnostic {
|
|
33
|
-
agentId: AgentId;
|
|
34
|
-
projectId: ProjectId;
|
|
35
|
-
code: string;
|
|
36
|
-
message: string;
|
|
37
|
-
lastGoodRevision?: number;
|
|
38
|
-
}
|
|
39
|
-
export interface HostSessionCollectionSnapshot {
|
|
40
|
-
revision: number;
|
|
41
|
-
scopeGeneration: number;
|
|
42
|
-
items: HostSessionSummary[];
|
|
43
|
-
diagnostics: HostSessionProviderDiagnostic[];
|
|
44
|
-
}
|
|
45
|
-
export interface HostSessionCollectionDelta {
|
|
46
|
-
revision: number;
|
|
47
|
-
scopeGeneration: number;
|
|
48
|
-
addedOrUpdated?: HostSessionSummary[];
|
|
49
|
-
removed?: string[];
|
|
50
|
-
diagnostics?: HostSessionProviderDiagnostic[];
|
|
51
|
-
}
|
|
52
|
-
/** Provider-owned transcript wire shape. The renderer consumes this exact shape through Host RPC. */
|
|
53
|
-
export interface NativeTranscriptMessage {
|
|
54
|
-
id?: string;
|
|
55
|
-
role: "user" | "assistant" | "tool";
|
|
56
|
-
content: unknown;
|
|
57
|
-
createdAt?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface NativeTranscript {
|
|
60
|
-
messages: NativeTranscriptMessage[];
|
|
61
|
-
diagnostics?: unknown[];
|
|
62
|
-
}
|
|
63
|
-
export declare function isNativeTranscript(value: unknown): value is NativeTranscript;
|
|
64
|
-
export declare function isHostSessionCollectionSnapshot(value: unknown): value is HostSessionCollectionSnapshot;
|
|
65
|
-
export declare function isHostSessionCollectionDelta(value: unknown): value is HostSessionCollectionDelta;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Instance — Product Mode orchestrator.
|
|
3
|
-
*
|
|
4
|
-
* Manages the lifecycle of a Product: creating instances (agents),
|
|
5
|
-
* scheduling tasks via DAG, enforcing budget, checkpointing state.
|
|
6
|
-
*
|
|
7
|
-
* Flow:
|
|
8
|
-
* 1. product.create → validate DAG, create instances, start scheduling
|
|
9
|
-
* 2. DAG readyTasks → spawn agent → sendTask → on complete → markCompleted → checkpoint
|
|
10
|
-
* 3. product.pause → pause all, checkpoint
|
|
11
|
-
* 4. product.resume → load state, resume scheduling
|
|
12
|
-
* 5. product.checkpoint → manual checkpoint
|
|
13
|
-
*/
|
|
14
|
-
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
15
|
-
import type { ProductPhase, ProductCreateParams, ProductStatus } from "../protocol/wire/acp-agent-management.js";
|
|
16
|
-
import { type PlannerMemoryContext } from "./planner-memory-brief.js";
|
|
17
|
-
import type { DagMutation } from "./product-planner.js";
|
|
18
|
-
import type { ProductLeaderCoordinator } from "./product-run-coordinator.js";
|
|
19
|
-
import { type HostRunStateAuthority } from "./run-state-host-authority.js";
|
|
20
|
-
import type { DelegateBridge } from "./delegate-bridge.js";
|
|
21
|
-
export type { ProductLeaderCoordinator } from "./product-run-coordinator.js";
|
|
22
|
-
export interface ProductFailureAssigneeSelection {
|
|
23
|
-
productId: string;
|
|
24
|
-
taskId: string;
|
|
25
|
-
taskPrompt: string;
|
|
26
|
-
error: string;
|
|
27
|
-
current: {
|
|
28
|
-
name: string;
|
|
29
|
-
agentId: string;
|
|
30
|
-
};
|
|
31
|
-
candidates: Array<{
|
|
32
|
-
name: string;
|
|
33
|
-
agentId: string;
|
|
34
|
-
}>;
|
|
35
|
-
}
|
|
36
|
-
export type ProductFailureAssigneeSelector = (input: ProductFailureAssigneeSelection) => Promise<string | undefined>;
|
|
37
|
-
export interface ProductCallbacks {
|
|
38
|
-
log?: {
|
|
39
|
-
info(msg: string): void;
|
|
40
|
-
warn(msg: string): void;
|
|
41
|
-
};
|
|
42
|
-
onTaskStarted?: (productId: string, taskId: string, assignee: string, attempt: number) => void;
|
|
43
|
-
onTaskCompleted?: (productId: string, taskId: string, result: string, meta: {
|
|
44
|
-
attempt: number;
|
|
45
|
-
inputTokens: number;
|
|
46
|
-
outputTokens: number;
|
|
47
|
-
changedFiles: string[];
|
|
48
|
-
acceptanceUnverified?: boolean;
|
|
49
|
-
}) => void;
|
|
50
|
-
onTaskFailed?: (productId: string, taskId: string, error: string, meta: {
|
|
51
|
-
attempt: number;
|
|
52
|
-
terminalState: "failed" | "cancelled";
|
|
53
|
-
}) => void;
|
|
54
|
-
/** Explicit receipt for the one automatic abnormal-worker handoff. */
|
|
55
|
-
onTaskHandoff?: (productId: string, taskId: string, from: string, to: string, reason: string, attempt: number) => void;
|
|
56
|
-
onCheckpointed?: (productId: string, timestamp: string) => void;
|
|
57
|
-
onBudgetWarning?: (productId: string, usedTokens: number, maxTotalTokens: number, percentage: number) => void;
|
|
58
|
-
/** Budget hard limit hit → the run auto-paused. The 100% counterpart of onBudgetWarning (80%): the
|
|
59
|
-
* warning notified the user while the actual auto-pause was log-only — the strongest budget
|
|
60
|
-
* intervention must be at least as loud as its warning. `reason` says WHICH limit tripped. */
|
|
61
|
-
onBudgetExceeded?: (productId: string, usedTokens: number, maxTotalTokens: number | undefined, reason: string) => void;
|
|
62
|
-
onCompleted?: (productId: string, summary: string, phase: Extract<ProductPhase, "completed" | "failed">, projectId: string) => void | Promise<void>;
|
|
63
|
-
/** Host RunState writes are lifecycle barriers; failures stop the run and surface explicitly. */
|
|
64
|
-
onPersistenceError?: (productId: string, error: string, projectId: string) => void;
|
|
65
|
-
/** DAG topology resolved and sent to client for visualization. */
|
|
66
|
-
onDagTopology?: (productId: string, nodes: {
|
|
67
|
-
id: string;
|
|
68
|
-
label: string;
|
|
69
|
-
deps: string[];
|
|
70
|
-
}[], edges: {
|
|
71
|
-
from: string;
|
|
72
|
-
to: string;
|
|
73
|
-
}[]) => void;
|
|
74
|
-
/** Real-time budget consumption update. */
|
|
75
|
-
onBudgetUpdate?: (productId: string, inputTokens: number, outputTokens: number, elapsed: number, maxTotalTokens?: number) => void;
|
|
76
|
-
/** Streaming text output from a running task. */
|
|
77
|
-
onTaskOutputDelta?: (productId: string, taskId: string, text: string) => void;
|
|
78
|
-
/** Per-task tool activity heartbeat emitted from the supervised delegate event sink. */
|
|
79
|
-
onTaskActivity?: (productId: string, taskId: string, toolName: string) => void;
|
|
80
|
-
/** Team roster resolved at run start — fired once (engine-driven) for both initial start and resume,
|
|
81
|
-
* so the run view's 团队成员 panel populates live instead of only on a history reopen. */
|
|
82
|
-
onMembers?: (productId: string, members: {
|
|
83
|
-
agentId: string;
|
|
84
|
-
role: string;
|
|
85
|
-
name: string;
|
|
86
|
-
}[], projectId: string) => void;
|
|
87
|
-
/** Required Gateway delegate access; orchestration fails loud when the Host rail is unavailable. */
|
|
88
|
-
getDelegateBridge?: () => DelegateBridge | undefined;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Prepend completed upstream task outputs to a downstream task prompt so the
|
|
92
|
-
* worker agent can see what its predecessors produced (research→writing, etc.).
|
|
93
|
-
* If there are no upstream outputs the original prompt is returned unchanged.
|
|
94
|
-
*
|
|
95
|
-
* NOTE: Only used for the agent-facing sends (spawn/sendTask/recovery).
|
|
96
|
-
* The original prompt is kept separate for evidence heuristics
|
|
97
|
-
* (requiresExplicitCompletionEvidence, assertProductTaskCompletionEvidence,
|
|
98
|
-
* assertProductTaskMaterializedEvidence) which inspect the task instruction
|
|
99
|
-
* for specific markers and keywords — the context prefix must not pollute them.
|
|
100
|
-
*/
|
|
101
|
-
export declare function buildTaskContextPrompt(upstream: {
|
|
102
|
-
taskId: string;
|
|
103
|
-
output: string;
|
|
104
|
-
}[], prompt: string): string;
|
|
105
|
-
export declare class ProductOrchestrator {
|
|
106
|
-
private providerDirectory;
|
|
107
|
-
private callbacks;
|
|
108
|
-
private leaderCoordinator?;
|
|
109
|
-
private sessions;
|
|
110
|
-
constructor(providerDirectory: HostAgentProviderDirectory, callbacks?: ProductCallbacks, leaderCoordinator?: ProductLeaderCoordinator | undefined);
|
|
111
|
-
setLeaderCoordinator(leaderCoordinator: ProductLeaderCoordinator): void;
|
|
112
|
-
/** (a) Owner global cheat-sheet source for member dispatches (cli-injected;
|
|
113
|
-
* orchestration never imports skills directly). */
|
|
114
|
-
private memoryContext?;
|
|
115
|
-
setMemoryContext(memoryContext: PlannerMemoryContext): void;
|
|
116
|
-
/**
|
|
117
|
-
* Create a new Product Mode session.
|
|
118
|
-
*/
|
|
119
|
-
create(params: ProductCreateParams, options?: {
|
|
120
|
-
authority?: HostRunStateAuthority;
|
|
121
|
-
failureAssigneeSelector?: ProductFailureAssigneeSelector;
|
|
122
|
-
}): Promise<string>;
|
|
123
|
-
/** Resume a product from persisted state. */
|
|
124
|
-
resume(productId: string, opts?: {
|
|
125
|
-
additionalBudget?: {
|
|
126
|
-
maxTotalTokens?: number;
|
|
127
|
-
maxDuration?: number;
|
|
128
|
-
};
|
|
129
|
-
authority?: HostRunStateAuthority;
|
|
130
|
-
projectId?: string;
|
|
131
|
-
cwd?: string;
|
|
132
|
-
failureAssigneeSelector?: ProductFailureAssigneeSelector;
|
|
133
|
-
}): Promise<void>;
|
|
134
|
-
/**
|
|
135
|
-
* Pause a running product — the SINGLE pause path (I9).
|
|
136
|
-
*
|
|
137
|
-
* `drainTimeoutMs` selects the behavior along ONE mechanism, not separate code paths:
|
|
138
|
-
* - `0` (default): instant pause — no drain wait, the loop below force-kills any running
|
|
139
|
-
* instances immediately. This is Product's historical hard-kill UX, expressed as a parameter.
|
|
140
|
-
* - `> 0`: graceful drain — stop dispatching NEW tasks, then wait up to `drainTimeoutMs` for
|
|
141
|
-
* in-flight tasks to settle (inFlightTasks → 0). After a clean drain there is nothing left
|
|
142
|
-
* running so the loop kills nothing; on timeout the SAME loop force-kills the stragglers.
|
|
143
|
-
*
|
|
144
|
-
* `session.phase` flips to "paused" only AFTER draining, so a run mid-drain is observably still
|
|
145
|
-
* active (not yet paused).
|
|
146
|
-
*/
|
|
147
|
-
pause(productId: string, options?: {
|
|
148
|
-
drainTimeoutMs?: number;
|
|
149
|
-
}): Promise<void>;
|
|
150
|
-
/** Poll `session.inFlightTasks` until it settles to 0 or the deadline elapses. The sole drain
|
|
151
|
-
* primitive for {@link pause} — there is no other place that waits for tasks to settle. */
|
|
152
|
-
private waitForInFlightSettle;
|
|
153
|
-
/** Manual checkpoint. */
|
|
154
|
-
checkpoint(productId: string): Promise<void>;
|
|
155
|
-
applyDagMutations(productId: string, mutations: readonly DagMutation[]): Promise<import("./product-dag-mutation-applier.js").ProductDagMutationApplyResult>;
|
|
156
|
-
/** Delete a product session, including a persisted execution run after process restart. */
|
|
157
|
-
delete(productId: string, options?: {
|
|
158
|
-
authority?: HostRunStateAuthority;
|
|
159
|
-
projectId?: string;
|
|
160
|
-
cwd?: string;
|
|
161
|
-
}): Promise<void>;
|
|
162
|
-
/** Roll back a Product to a Host checkpoint and resume it through the same execution path. */
|
|
163
|
-
rollback(productId: string, checkpoint?: string): Promise<void>;
|
|
164
|
-
private stopSessionForTeardown;
|
|
165
|
-
/**
|
|
166
|
-
* Replay from an arbitrary completed/failed task (CrewAI Crew.replay(taskId) parity).
|
|
167
|
-
*
|
|
168
|
-
* Resets the task + all its transitive descendants to pending (clearing their outputs) while
|
|
169
|
-
* leaving ancestors completed — so the re-run automatically reuses upstream outputs via the
|
|
170
|
-
* existing task-context injection (getUpstreamOutputs at dispatch). Unlike rollback (which
|
|
171
|
-
* restores a whole-product checkpoint) or retryNode (which only accepts FAILED nodes), replay
|
|
172
|
-
* targets a successful-but-wrong task and re-runs forward from it in place.
|
|
173
|
-
*/
|
|
174
|
-
replayTask(productId: string, taskId: string): Promise<void>;
|
|
175
|
-
getStatus(productId: string): ProductStatus | null;
|
|
176
|
-
getProjectId(productId: string): string | undefined;
|
|
177
|
-
/** Live DAG progress snapshot for a product (for the planner's execution-phase leader). */
|
|
178
|
-
getProgressSnapshot(productId: string): {
|
|
179
|
-
total: number;
|
|
180
|
-
completed: number;
|
|
181
|
-
running: number;
|
|
182
|
-
failed: number;
|
|
183
|
-
} | null;
|
|
184
|
-
private scheduleNext;
|
|
185
|
-
private pauseForBudget;
|
|
186
|
-
private publishBudgetWarning;
|
|
187
|
-
private isInstanceBusy;
|
|
188
|
-
private dispatchTask;
|
|
189
|
-
private publishUnassignedTaskFailure;
|
|
190
|
-
private runTask;
|
|
191
|
-
private consultLeaderAfterFailure;
|
|
192
|
-
private tryAutomaticAgentHandoff;
|
|
193
|
-
private applyDagMutationsToSession;
|
|
194
|
-
private finishProduct;
|
|
195
|
-
/**
|
|
196
|
-
* Durable persistence failed → the run is over. Declaring that is not enough: the in-flight work has
|
|
197
|
-
* to actually stop.
|
|
198
|
-
*
|
|
199
|
-
* This used to only set phase and stop the checkpoint timer, so with 3 parallel tasks the run went
|
|
200
|
-
* "failed" for the client while the other 2 kept executing for up to their full timeout — still
|
|
201
|
-
* writing worktrees and still issuing EXPLICIT checkpoints (`stop()` only cancels the periodic
|
|
202
|
-
* timer, it does not block direct writes). The persisted state then drifted into phase=failed with
|
|
203
|
-
* tasks=completed, `finishProduct` never ran, and the session stayed in the map forever.
|
|
204
|
-
*
|
|
205
|
-
* `session.cancelled` is the existing single flag that closes all of that: it makes in-flight tasks
|
|
206
|
-
* treat their outcome as non-failure, aborts the retry loops, and short-circuits the post-task
|
|
207
|
-
* checkpoint + scheduleNext. Kept synchronous (14 call sites, several inside sync paths) — the
|
|
208
|
-
* per-task `finally` already tears down each task worktree, so no async cleanup is needed here.
|
|
209
|
-
*/
|
|
210
|
-
private failRunStatePersistence;
|
|
211
|
-
private publishNotification;
|
|
212
|
-
private emitDagTopology;
|
|
213
|
-
private cleanupInstanceWorktree;
|
|
214
|
-
private buildPersistedState;
|
|
215
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { HostAgentProviderListResult } from "../host-contract/index.js";
|
|
2
|
-
import type { AgentRosterEntry } from "../protocol/wire/acp-agent-management.js";
|
|
3
|
-
interface AgentRosterOptions {
|
|
4
|
-
injectLeader?: boolean;
|
|
5
|
-
leaderAgentId: string;
|
|
6
|
-
}
|
|
7
|
-
/** Build the team roster the leader sees during planning: every ready agent with a coarse
|
|
8
|
-
* strengths hint + its backing model. Leader-only soft hints — NOT a capability contract.
|
|
9
|
-
*
|
|
10
|
-
* `allowedAgents` is PRESENCE-based (an explicit `[]` is meaningful, NOT the same as omitted):
|
|
11
|
-
* - `undefined` / omitted → ALL ready agents. The allow-set is `null` and the catalog filter applies
|
|
12
|
-
* no constraint.
|
|
13
|
-
* - `[]` (explicit empty array) → ONLY the selected session leader: the allow-set is empty, so the
|
|
14
|
-
* catalog filter drops every non-leader entry. This is the user deliberately deselecting workers.
|
|
15
|
-
* - `[ids]` → those ready ids PLUS the selected leader. A picked-but-unready id is dropped.
|
|
16
|
-
*
|
|
17
|
-
* The caller supplies the authoritative leader id from the session binding. There is no implicit
|
|
18
|
-
* leader: Product callers pass their Product leader; Goal callers pass the session owner. */
|
|
19
|
-
export declare function buildAgentRoster(snapshot: Readonly<HostAgentProviderListResult>, allowedAgents: string[] | undefined, options: AgentRosterOptions): AgentRosterEntry[];
|
|
20
|
-
/**
|
|
21
|
-
* User-PICKED worker ids that did NOT make it into the roster (unready: not installed / not logged in
|
|
22
|
-
* / not in the catalog). Excludes the leader (always force-included). Empty when nothing was dropped
|
|
23
|
-
* or when the pool was omitted. Callers surface this so a picked worker doesn't vanish silently and
|
|
24
|
-
* collapse the team to just its leader (honesty over silence).
|
|
25
|
-
*/
|
|
26
|
-
export declare function computeUnavailablePicks(allowedAgents: string[] | undefined, rosterIds: readonly string[], leaderAgentId: string): string[];
|
|
27
|
-
/** buildAgentRoster + the diagnostics of which picked workers were dropped as unavailable. */
|
|
28
|
-
export declare function buildAgentRosterWithDiagnostics(snapshot: Readonly<HostAgentProviderListResult>, allowedAgents: string[] | undefined, options: AgentRosterOptions): {
|
|
29
|
-
roster: AgentRosterEntry[];
|
|
30
|
-
unavailablePicks: string[];
|
|
31
|
-
};
|
|
32
|
-
export {};
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DAG Scheduler v2 — unified scheduling for Product + Automation modes.
|
|
3
|
-
*
|
|
4
|
-
* Single-track model: one algorithm, no compat shims, no legacy paths.
|
|
5
|
-
* Product mode = flat DAG (kind:"agent", no conditions, no loops) — strict subset.
|
|
6
|
-
*
|
|
7
|
-
* Spec: docs/dag-scheduler-v2-spec.md
|
|
8
|
-
*/
|
|
9
|
-
import type { ProductTaskStatus } from "../protocol/wire/acp-agent-management.js";
|
|
10
|
-
/**
|
|
11
|
-
* Loop safety hard ceiling (plan D15): a loop controller's `maxIterations` is required and may
|
|
12
|
-
* never exceed this. Unattended/triggered runs must not be able to declare an effectively
|
|
13
|
-
* unbounded loop, so a value above the cap is rejected fail-loud at construction — not clamped.
|
|
14
|
-
*/
|
|
15
|
-
export declare const LOOP_MAX_ITERATIONS_HARD_CAP = 1000;
|
|
16
|
-
/** Unified node status; "skipped" is a terminal success (intentionally not run). */
|
|
17
|
-
export type NodeStatus = ProductTaskStatus;
|
|
18
|
-
/**
|
|
19
|
-
* Fully-materialized runtime node (constructed from NodeDef, never partial).
|
|
20
|
-
* Internal to the scheduler — do not mutate directly outside DagScheduler.
|
|
21
|
-
*/
|
|
22
|
-
export interface Node {
|
|
23
|
-
id: string;
|
|
24
|
-
kind: string;
|
|
25
|
-
params: Record<string, unknown>;
|
|
26
|
-
status: NodeStatus;
|
|
27
|
-
outPorts: string[];
|
|
28
|
-
joinPolicy: "all" | "any";
|
|
29
|
-
firedPorts?: string[];
|
|
30
|
-
output?: unknown;
|
|
31
|
-
error?: string;
|
|
32
|
-
startedAt?: number;
|
|
33
|
-
completedAt?: number;
|
|
34
|
-
inputTokens?: number;
|
|
35
|
-
outputTokens?: number;
|
|
36
|
-
changedFiles?: string[];
|
|
37
|
-
acceptanceUnverified?: boolean;
|
|
38
|
-
runIndex: number;
|
|
39
|
-
maxIterations?: number;
|
|
40
|
-
iteration?: number;
|
|
41
|
-
}
|
|
42
|
-
/** Declarative input for the constructor. Edges derived from dependsOn. */
|
|
43
|
-
export interface NodeDef {
|
|
44
|
-
id: string;
|
|
45
|
-
kind?: string;
|
|
46
|
-
params?: Record<string, unknown>;
|
|
47
|
-
dependsOn?: string[];
|
|
48
|
-
outPorts?: string[];
|
|
49
|
-
joinPolicy?: "all" | "any";
|
|
50
|
-
maxIterations?: number;
|
|
51
|
-
}
|
|
52
|
-
export interface Edge {
|
|
53
|
-
from: string;
|
|
54
|
-
to: string;
|
|
55
|
-
fromPort?: string;
|
|
56
|
-
loopBack?: boolean;
|
|
57
|
-
}
|
|
58
|
-
export declare class DagScheduler {
|
|
59
|
-
private nodes;
|
|
60
|
-
private edges;
|
|
61
|
-
constructor(defs: NodeDef[]);
|
|
62
|
-
getNode(id: string): Node | undefined;
|
|
63
|
-
getAllNodes(): Node[];
|
|
64
|
-
/**
|
|
65
|
-
* Ready = pending + all forward incoming edges satisfied (or no incoming edges).
|
|
66
|
-
* Spec §3.1.
|
|
67
|
-
*/
|
|
68
|
-
getReadyNodes(): Node[];
|
|
69
|
-
isFinished(): boolean;
|
|
70
|
-
/** All nodes completed or skipped (skipped = intentionally not run, counts as success). */
|
|
71
|
-
isAllCompleted(): boolean;
|
|
72
|
-
getBlockedNodes(): Node[];
|
|
73
|
-
getProgress(): {
|
|
74
|
-
total: number;
|
|
75
|
-
completed: number;
|
|
76
|
-
running: number;
|
|
77
|
-
failed: number;
|
|
78
|
-
pending: number;
|
|
79
|
-
paused: number;
|
|
80
|
-
skipped: number;
|
|
81
|
-
};
|
|
82
|
-
markRunning(id: string): void;
|
|
83
|
-
/**
|
|
84
|
-
* Mark completed. firedPorts omitted → all outPorts fire (agent/tool nodes).
|
|
85
|
-
* Triggers skip propagation (§3.2).
|
|
86
|
-
*/
|
|
87
|
-
markCompleted(id: string, out: {
|
|
88
|
-
output?: unknown;
|
|
89
|
-
firedPorts?: string[];
|
|
90
|
-
inputTokens?: number;
|
|
91
|
-
outputTokens?: number;
|
|
92
|
-
changedFiles?: string[];
|
|
93
|
-
acceptanceUnverified?: boolean;
|
|
94
|
-
}): void;
|
|
95
|
-
/**
|
|
96
|
-
* Mark failed. Terminal states are immutable: a node that already completed, was skipped, or
|
|
97
|
-
* already failed is left untouched.
|
|
98
|
-
*
|
|
99
|
-
* Without this guard markFailed was the one lifecycle transition with no precondition (markRunning /
|
|
100
|
-
* markCompleted / markSkipped all have one), so teardown and replay — which both call it on whatever
|
|
101
|
-
* task an instance last held — could rewrite a real success as a failure, erase its output, and then
|
|
102
|
-
* propagateSkips() would block the downstream that success had unlocked. Keeping the FIRST error also
|
|
103
|
-
* stops a late generic rejection ("gateway torn down") from burying the actual diagnosis.
|
|
104
|
-
*/
|
|
105
|
-
markFailed(id: string, error: string): void;
|
|
106
|
-
markPaused(id: string): void;
|
|
107
|
-
resumePaused(id: string): void;
|
|
108
|
-
markSkipped(id: string): void;
|
|
109
|
-
pauseAll(): void;
|
|
110
|
-
resumeAll(): void;
|
|
111
|
-
/**
|
|
112
|
-
* Loop controller decision (§3.3).
|
|
113
|
-
* If again && iterations remain → reset loop body, fire "loop" port.
|
|
114
|
-
* Otherwise → fire "done" port (exit).
|
|
115
|
-
*/
|
|
116
|
-
decideLoop(loopId: string, again: boolean): void;
|
|
117
|
-
addNode(def: NodeDef): void;
|
|
118
|
-
/** Add multiple nodes atomically. All-or-nothing. */
|
|
119
|
-
addNodes(defs: NodeDef[]): void;
|
|
120
|
-
/**
|
|
121
|
-
* Remove a pending node. Cannot remove running or completed nodes.
|
|
122
|
-
* Removes all edges incident to this node.
|
|
123
|
-
*/
|
|
124
|
-
removeNode(id: string): void;
|
|
125
|
-
/** Add one dependency edge atomically. Only work that has not started may gain prerequisites. */
|
|
126
|
-
addDependency(from: string, to: string): void;
|
|
127
|
-
/** Remove one dependency edge. Completed/running work remains immutable. */
|
|
128
|
-
removeDependency(from: string, to: string): void;
|
|
129
|
-
/**
|
|
130
|
-
* Reset a failed node to pending. Optionally patches params (e.g. revised prompt).
|
|
131
|
-
*/
|
|
132
|
-
retryNode(id: string, paramsPatch?: Record<string, unknown>): void;
|
|
133
|
-
/**
|
|
134
|
-
* Reset a completed/failed node AND all its transitive descendants back to pending for replay
|
|
135
|
-
* (CrewAI Crew.replay(task_id) parity), clearing their outputs. Ancestors are left untouched so
|
|
136
|
-
* their completed outputs continue feeding downstream task-context (getUpstreamOutputs) — replay
|
|
137
|
-
* re-runs the subtree while reusing upstream results. Pure state mutation: no scheduling.
|
|
138
|
-
*
|
|
139
|
-
* Returns the ids that were reset (the node + every descendant).
|
|
140
|
-
*/
|
|
141
|
-
resetForReplay(id: string): string[];
|
|
142
|
-
/** Merge patch into node.params. Node must be pending. */
|
|
143
|
-
/**
|
|
144
|
-
* Merge patch into node.params. Allowed while the node is pending OR failed.
|
|
145
|
-
*
|
|
146
|
-
* "failed" is included because that is exactly when the leader refines a task: the node is not
|
|
147
|
-
* executing, and retryNode resets it to pending anyway, so the patch lands on the DAG that gets
|
|
148
|
-
* checkpointed. Holding such patches outside the node instead (a per-call scratch map) meant a
|
|
149
|
-
* refinement made in one consultation was gone by the next, and the retry re-ran the failing text.
|
|
150
|
-
*/
|
|
151
|
-
updateNodeParams(id: string, patch: Record<string, unknown>): void;
|
|
152
|
-
/** Add an explicit edge. Validates no cycle. Validates ports exist on source. */
|
|
153
|
-
addEdge(edge: Edge): void;
|
|
154
|
-
removeEdge(from: string, to: string, fromPort?: string): void;
|
|
155
|
-
serialize(): SerializedNode[];
|
|
156
|
-
/**
|
|
157
|
-
* Restore status from persisted snapshot.
|
|
158
|
-
* Running nodes become pending (need re-execution after crash).
|
|
159
|
-
* Missing fields use defaults.
|
|
160
|
-
*/
|
|
161
|
-
restore(data: SerializedNode[]): void;
|
|
162
|
-
/**
|
|
163
|
-
* Returns the completed output of each direct dependency of this node.
|
|
164
|
-
* Used by Product orchestration to inject upstream task results into downstream prompts
|
|
165
|
-
* (CrewAI Task.context parity).
|
|
166
|
-
*/
|
|
167
|
-
getUpstreamOutputs(id: string): {
|
|
168
|
-
taskId: string;
|
|
169
|
-
output: string;
|
|
170
|
-
}[];
|
|
171
|
-
/** §3.1 edge predicate: source completed AND this port fired. */
|
|
172
|
-
private edgeSatisfied;
|
|
173
|
-
/** An edge is "dead" if the source is skipped, OR source completed but did NOT fire this port. */
|
|
174
|
-
private edgeDead;
|
|
175
|
-
private incomingForwardEdges;
|
|
176
|
-
private isBlockedByFailed;
|
|
177
|
-
/** A pending node is "skippable" if all its forward edges are dead. */
|
|
178
|
-
private isSkippable;
|
|
179
|
-
/**
|
|
180
|
-
* §3.2 Skip propagation.
|
|
181
|
-
* After markCompleted/markFailed/markSkipped, repeatedly mark pending nodes
|
|
182
|
-
* whose incoming edges are all dead as skipped.
|
|
183
|
-
* Product mode (no conditional edges) → no-op.
|
|
184
|
-
*/
|
|
185
|
-
private propagateSkips;
|
|
186
|
-
/**
|
|
187
|
-
* §3.3 Reset all loop-body nodes back to pending for next iteration.
|
|
188
|
-
*/
|
|
189
|
-
private resetLoopScope;
|
|
190
|
-
/**
|
|
191
|
-
* Compute the loop body: nodes reachable from the loop controller's "loop" outPort
|
|
192
|
-
* via non-loopBack forward edges, up to (but not including) the loop controller itself.
|
|
193
|
-
* The controller's "done" port leads OUT of the loop and is not part of the body.
|
|
194
|
-
*/
|
|
195
|
-
private loopBodyNodes;
|
|
196
|
-
private validateDag;
|
|
197
|
-
private requireNode;
|
|
198
|
-
}
|
|
199
|
-
export interface SerializedNode {
|
|
200
|
-
id: string;
|
|
201
|
-
kind: string;
|
|
202
|
-
params: Record<string, unknown>;
|
|
203
|
-
dependsOn: string[];
|
|
204
|
-
outPorts: string[];
|
|
205
|
-
joinPolicy: "all" | "any";
|
|
206
|
-
status: NodeStatus;
|
|
207
|
-
firedPorts?: string[];
|
|
208
|
-
output?: unknown;
|
|
209
|
-
error?: string;
|
|
210
|
-
startedAt?: number;
|
|
211
|
-
completedAt?: number;
|
|
212
|
-
inputTokens?: number;
|
|
213
|
-
outputTokens?: number;
|
|
214
|
-
changedFiles?: string[];
|
|
215
|
-
acceptanceUnverified?: boolean;
|
|
216
|
-
runIndex: number;
|
|
217
|
-
maxIterations?: number;
|
|
218
|
-
iteration?: number;
|
|
219
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unattended orchestration runs are explicitly launched by the user and already inherit the
|
|
3
|
-
* Host-projected permission scope. Approve only the current operation; never widen the persisted
|
|
4
|
-
* permission policy. If the provider cannot offer a one-shot approval, fail closed.
|
|
5
|
-
*/
|
|
6
|
-
export declare function selectUnattendedApprovalOptionId(options: Array<Record<string, unknown>>): string;
|
|
7
|
-
/** Planning-only delegates must never execute tools; answer explicitly so the provider cannot hang. */
|
|
8
|
-
export declare function selectPlanningRejectionOptionId(options: Array<Record<string, unknown>>): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DelegateRequestParams, SupervisorEventSink, TurnResult } from "../host-contract/index.js";
|
|
2
|
-
/** Authority-neutral transport used by the six orchestration stations to call Gateway-owned workers. */
|
|
3
|
-
export interface DelegateBridge {
|
|
4
|
-
isSupported(): boolean;
|
|
5
|
-
send(params: DelegateRequestParams, sink: SupervisorEventSink): Promise<TurnResult>;
|
|
6
|
-
cancel(delegationId: string): void;
|
|
7
|
-
respond(delegationId: string, approvalId: string, optionId: string): void;
|
|
8
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AcceptanceChecklist, AcceptanceCriterion, AcceptanceEvidence, AcceptanceStatus } from "./goal-run-types.js";
|
|
2
|
-
/** Return a NEW checklist with one criterion's status flipped. Never mutates the input.
|
|
3
|
-
* Monotonicity contract: a criterion that already `passed` may only revert to `failed` via a
|
|
4
|
-
* deterministic verify REGRESSION (allowRegression=true). Any other downgrade of a passed criterion
|
|
5
|
-
* (an LLM judge's prose verdict, a re-pending) is IGNORED — `passed` is terminal except when its own
|
|
6
|
-
* `verify` command starts failing. This is what makes "no regression goes unnoticed" hold without
|
|
7
|
-
* letting assessment flap: real regressions are caught (verify), spurious ones are rejected. */
|
|
8
|
-
export declare function flipCriterionStatus(checklist: AcceptanceChecklist, criterionId: string, status: AcceptanceStatus, evidence?: AcceptanceEvidence[], reason?: string, allowRegression?: boolean): AcceptanceChecklist;
|
|
9
|
-
/** Done iff every criterion is passed or superseded (none pending/failed). */
|
|
10
|
-
export declare function isChecklistDone(checklist: AcceptanceChecklist): boolean;
|
|
11
|
-
/** True iff every not-yet-passed/superseded criterion is covered by an unreachable entry. */
|
|
12
|
-
export declare function unreachableCoversRemaining(checklist: AcceptanceChecklist, unreachable: {
|
|
13
|
-
criterionId: string;
|
|
14
|
-
reason: string;
|
|
15
|
-
}[]): boolean;
|
|
16
|
-
/** Derive a new immutable checklist version on goal-edit. Dropped criteria -> superseded. */
|
|
17
|
-
export declare function newChecklistVersion(prev: AcceptanceChecklist, nextCriteria: Pick<AcceptanceCriterion, "id" | "criterion" | "verify" | "evidenceSource">[]): AcceptanceChecklist;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ContextEnvelope } from "../protocol/wire/chat-types.js";
|
|
2
|
-
import type { PersistedGoalRunState, PhaseSpec } from "./goal-run-types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Project the Host-owned Goal checkpoint into bounded Agent-local compaction facts.
|
|
5
|
-
* The envelope is regenerated for every leader/worker turn; it never becomes a second Goal owner.
|
|
6
|
-
*/
|
|
7
|
-
export declare function buildGoalContextEnvelope(state: PersistedGoalRunState, operation: string, spec?: PhaseSpec): ContextEnvelope;
|