qlogicagent 2.18.12 → 2.19.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 +382 -382
- package/dist/agent-contract.js +1 -0
- package/dist/cli.js +1 -1
- package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
- package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
- package/dist/host-contract.js +1 -1
- package/dist/host-session-collection-contract.js +1 -0
- package/dist/index.js +478 -505
- package/dist/pet-host.js +8 -8
- package/dist/project-memory-host.js +23 -23
- package/dist/protocol.js +1 -1
- package/dist/skills/builtin/desktop-screenshot/SKILL.md +62 -62
- package/dist/skills/builtin/office-doc-reading/SKILL.md +19 -19
- package/dist/types/cli/acp-commands.d.ts +1 -1
- package/dist/types/cli/acp-extended-handlers.d.ts +8 -8
- package/dist/types/cli/acp-extended-host-adapter.d.ts +0 -11
- package/dist/types/cli/acp-session-host.d.ts +2 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +0 -9
- package/dist/types/cli/default-project-bootstrap.d.ts +2 -32
- package/dist/types/cli/handlers/session-handler.d.ts +0 -43
- package/dist/types/cli/handlers/solo-handler.d.ts +3 -14
- package/dist/types/cli/multi-agent-handler-host.d.ts +3 -16
- package/dist/types/cli/product-coordinator.d.ts +3 -14
- package/dist/types/cli/rpc-registry.d.ts +0 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +4 -1
- package/dist/types/cli/stdio-server.d.ts +1 -2
- package/dist/types/host-contract/index.d.ts +112 -19
- package/dist/types/host-session-collection-contract.d.ts +61 -0
- package/dist/types/orchestration/agent-instance.d.ts +11 -14
- package/dist/types/orchestration/agent-roster.d.ts +8 -4
- package/dist/types/orchestration/delegate-bridge.d.ts +8 -0
- package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -3
- package/dist/types/orchestration/product-persistence.d.ts +0 -4
- package/dist/types/orchestration/product-planner.d.ts +4 -6
- package/dist/types/orchestration/solo-evaluator.d.ts +2 -5
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +2 -1
- package/dist/types/orchestration/testing/host-agent-provider-directory-fixture.d.ts +7 -0
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
- package/dist/types/protocol/agent-contract.d.ts +50 -0
- package/dist/types/protocol/methods.d.ts +20 -38
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-agent-management.d.ts +2 -190
- package/dist/types/protocol/wire/acp-protocol.d.ts +3 -4
- package/dist/types/protocol/wire/agent-events.d.ts +1 -32
- package/dist/types/protocol/wire/agent-methods.d.ts +1 -243
- package/dist/types/protocol/wire/gateway-rpc.d.ts +343 -15
- package/dist/types/protocol/wire/index.d.ts +3 -3
- package/dist/types/protocol/wire/notification-payloads.d.ts +103 -126
- package/dist/types/runtime/infra/host-agent-provider-directory.d.ts +17 -0
- package/dist/types/runtime/infra/project-authority-facade.d.ts +1 -1
- package/dist/types/runtime/infra/project-data-paths.d.ts +2 -1
- package/dist/types/runtime/infra/project-host-authority.d.ts +3 -2
- package/dist/types/runtime/infra/project-store.d.ts +4 -39
- package/dist/types/runtime/session/session-catalog.d.ts +0 -12
- package/dist/types/runtime/session/session-persistence.d.ts +1 -1
- package/dist/types/runtime/session/session-resource-key.d.ts +1 -1
- package/dist/types/runtime/session/session-types.d.ts +0 -23
- package/dist/types/transport/acp-server.d.ts +2 -10
- package/dist/vendor/hatch-pet/LICENSE.txt +201 -201
- package/dist/vendor/hatch-pet/NOTICE.md +25 -25
- package/dist/vendor/hatch-pet/references/animation-rows.md +29 -29
- package/dist/vendor/hatch-pet/references/codex-pet-contract.md +35 -35
- package/dist/vendor/hatch-pet/references/qa-rubric.md +66 -66
- package/dist/vendor/hatch-pet/scripts/compose_atlas.py +169 -169
- package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +150 -150
- package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +408 -408
- package/dist/vendor/hatch-pet/scripts/inspect_frames.py +256 -256
- package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +96 -96
- package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +834 -834
- package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +78 -78
- package/dist/vendor/hatch-pet/scripts/validate_atlas.py +157 -157
- package/dist/workflow-host.js +10 -10
- package/package.json +16 -1
- package/dist/types/cli/agent-config-coordinator.d.ts +0 -27
- package/dist/types/cli/agent-config-runtime.d.ts +0 -11
- package/dist/types/cli/agent-status-notifier.d.ts +0 -11
- package/dist/types/cli/handlers/agents-handler.d.ts +0 -121
- package/dist/types/cli/handlers/project-handler.d.ts +0 -36
- package/dist/types/cli/project-command-service.d.ts +0 -28
- package/dist/types/orchestration/delegation-coordinator.d.ts +0 -100
- package/dist/types/runtime/infra/acp-detector.d.ts +0 -271
- package/dist/types/runtime/infra/agent-config-store.d.ts +0 -30
- package/dist/types/runtime/infra/agent-install-runner.d.ts +0 -80
- package/dist/types/runtime/infra/external-agent-approvals.d.ts +0 -59
- package/dist/types/runtime/infra/migrate-device-scope.d.ts +0 -49
- package/dist/types/runtime/infra/project-data-gc.d.ts +0 -15
- package/dist/types/runtime/session/native/claude-session-source.d.ts +0 -23
- package/dist/types/runtime/session/native/codex-index.d.ts +0 -21
- package/dist/types/runtime/session/native/codex-session-source.d.ts +0 -31
- package/dist/types/runtime/session/native/cwd-normalize.d.ts +0 -53
- package/dist/types/runtime/session/native/ephemeral-rollout-sweep.d.ts +0 -13
- package/dist/types/runtime/session/native/native-cwd-agents.d.ts +0 -17
- package/dist/types/runtime/session/native/native-session-source.d.ts +0 -89
- package/dist/types/runtime/session/native/native-title.d.ts +0 -1
- package/dist/types/runtime/session/native/register-builtin-sources.d.ts +0 -1
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* 3. Add event name string in agent-events.ts (if WS-relayed)
|
|
12
12
|
*/
|
|
13
13
|
import type { ToolRiskLevel } from "./web-capability.js";
|
|
14
|
+
import type { DelegationError } from "./gateway-rpc.js";
|
|
14
15
|
/** Identifies which agent produced this notification (main or teammate). */
|
|
15
16
|
export interface AgentSource {
|
|
16
17
|
id: string;
|
|
@@ -547,125 +548,6 @@ export interface TurnUsageUpdateNotification {
|
|
|
547
548
|
model?: string;
|
|
548
549
|
sessionCostUSD?: number;
|
|
549
550
|
}
|
|
550
|
-
/** Agent status change notification. */
|
|
551
|
-
export interface AgentsStatusNotification {
|
|
552
|
-
agentId: string;
|
|
553
|
-
status: "available" | "spawning" | "running" | "hang" | "failed" | "unavailable";
|
|
554
|
-
health?: {
|
|
555
|
-
missedBeats: number;
|
|
556
|
-
lastActiveAt: string;
|
|
557
|
-
};
|
|
558
|
-
usage?: {
|
|
559
|
-
inputTokens: number;
|
|
560
|
-
outputTokens: number;
|
|
561
|
-
totalTokens: number;
|
|
562
|
-
};
|
|
563
|
-
error?: {
|
|
564
|
-
phase: string;
|
|
565
|
-
message: string;
|
|
566
|
-
retriesLeft: number;
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
/** Agent error notification. */
|
|
570
|
-
export interface AgentsErrorNotification {
|
|
571
|
-
agentId: string;
|
|
572
|
-
phase: "detect" | "spawn" | "handshake" | "runtime" | "shutdown" | "heartbeat";
|
|
573
|
-
error: string;
|
|
574
|
-
retriesLeft: number;
|
|
575
|
-
}
|
|
576
|
-
/** One-click install progress (state transitions + streamed log lines + final result). */
|
|
577
|
-
export interface AgentInstallProgressNotification {
|
|
578
|
-
agentId: string;
|
|
579
|
-
event: {
|
|
580
|
-
type: "state";
|
|
581
|
-
state: "installing" | "verifying" | "installed" | "failed";
|
|
582
|
-
} | {
|
|
583
|
-
type: "log";
|
|
584
|
-
stream: "stdout" | "stderr";
|
|
585
|
-
chunk: string;
|
|
586
|
-
} | {
|
|
587
|
-
type: "done";
|
|
588
|
-
ok: boolean;
|
|
589
|
-
error?: string;
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* Live streaming chunk from an EXTERNAL agent's prompt turn (agents.prompt). Echoes the gateway's
|
|
594
|
-
* turn identity (sessionId/turnId/requestId passed in agents.prompt params) so the gateway can
|
|
595
|
-
* re-emit it on the same turn.delta path the main agent uses — no separate frontend handling.
|
|
596
|
-
*/
|
|
597
|
-
export interface AgentsPromptDeltaNotification {
|
|
598
|
-
agentId: string;
|
|
599
|
-
sessionId?: string;
|
|
600
|
-
turnId?: string;
|
|
601
|
-
requestId?: string;
|
|
602
|
-
text: string;
|
|
603
|
-
/** When true this chunk is the agent's reasoning/thinking (→ turn.reasoning_delta), not reply text. */
|
|
604
|
-
reasoning?: boolean;
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Live tool-call lifecycle from an EXTERNAL agent's prompt turn — same echo-the-turn-identity
|
|
608
|
-
* mechanism as AgentsPromptDeltaNotification, so the gateway re-emits it on the main
|
|
609
|
-
* turn.tool_call / turn.tool_result path and the UI shows external tools running, no extra handling.
|
|
610
|
-
*/
|
|
611
|
-
export interface AgentsPromptToolNotification {
|
|
612
|
-
agentId: string;
|
|
613
|
-
sessionId?: string;
|
|
614
|
-
turnId?: string;
|
|
615
|
-
requestId?: string;
|
|
616
|
-
event: {
|
|
617
|
-
kind: "call";
|
|
618
|
-
callId: string;
|
|
619
|
-
name: string;
|
|
620
|
-
arguments?: string;
|
|
621
|
-
inputSummary?: string;
|
|
622
|
-
} | {
|
|
623
|
-
kind: "result";
|
|
624
|
-
callId: string;
|
|
625
|
-
name: string;
|
|
626
|
-
ok: boolean;
|
|
627
|
-
outputPreview?: string;
|
|
628
|
-
error?: string;
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
/**
|
|
632
|
-
* Plan/task update from an EXTERNAL agent's prompt turn (ACP plan steps). The gateway maps the
|
|
633
|
-
* steps onto the main turn.task_updated path so the UI shows the agent's plan as a task list.
|
|
634
|
-
*/
|
|
635
|
-
export interface AgentsPromptPlanNotification {
|
|
636
|
-
agentId: string;
|
|
637
|
-
sessionId?: string;
|
|
638
|
-
turnId?: string;
|
|
639
|
-
requestId?: string;
|
|
640
|
-
steps: Array<{
|
|
641
|
-
content?: string;
|
|
642
|
-
title?: string;
|
|
643
|
-
status?: string;
|
|
644
|
-
priority?: string;
|
|
645
|
-
}>;
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* Interactive permission request from an EXTERNAL agent's prompt turn. Echoes the gateway's turn
|
|
649
|
-
* identity so the gateway re-emits it on the main turn.approval_request path → the UI shows an
|
|
650
|
-
* approval card; the user's decision returns via the agents.approvalResponse RPC.
|
|
651
|
-
*/
|
|
652
|
-
export interface AgentsPromptApprovalNotification {
|
|
653
|
-
agentId: string;
|
|
654
|
-
sessionId?: string;
|
|
655
|
-
turnId?: string;
|
|
656
|
-
requestId?: string;
|
|
657
|
-
approvalId: string;
|
|
658
|
-
callId?: string;
|
|
659
|
-
toolName: string;
|
|
660
|
-
arguments?: string;
|
|
661
|
-
message?: string;
|
|
662
|
-
category?: string;
|
|
663
|
-
options?: Array<{
|
|
664
|
-
optionId: string;
|
|
665
|
-
name?: string;
|
|
666
|
-
kind?: string;
|
|
667
|
-
}>;
|
|
668
|
-
}
|
|
669
551
|
/** Solo agent progress. */
|
|
670
552
|
export interface SoloProgressNotification {
|
|
671
553
|
soloId: string;
|
|
@@ -700,12 +582,15 @@ export interface ProductTaskStartedNotification {
|
|
|
700
582
|
productId: string;
|
|
701
583
|
taskId: string;
|
|
702
584
|
assignee: string;
|
|
585
|
+
/** Monotonic attempt number under the stable taskId. */
|
|
586
|
+
attempt: number;
|
|
703
587
|
}
|
|
704
588
|
/** Product task completed. */
|
|
705
589
|
export interface ProductTaskCompletedNotification {
|
|
706
590
|
productId: string;
|
|
707
591
|
taskId: string;
|
|
708
592
|
result: string;
|
|
593
|
+
attempt: number;
|
|
709
594
|
/** Per-task token usage harvested from the agent's usage tracker. */
|
|
710
595
|
inputTokens?: number;
|
|
711
596
|
outputTokens?: number;
|
|
@@ -717,6 +602,8 @@ export interface ProductTaskFailedNotification {
|
|
|
717
602
|
productId: string;
|
|
718
603
|
taskId: string;
|
|
719
604
|
error: string;
|
|
605
|
+
attempt: number;
|
|
606
|
+
terminalState: "failed" | "cancelled";
|
|
720
607
|
}
|
|
721
608
|
/** Product checkpoint saved. */
|
|
722
609
|
export interface ProductCheckpointedNotification {
|
|
@@ -812,6 +699,23 @@ export interface ProductPlanningDeltaNotification {
|
|
|
812
699
|
productId: string;
|
|
813
700
|
text: string;
|
|
814
701
|
}
|
|
702
|
+
export interface ProductLeaderMessageNotification {
|
|
703
|
+
productId: string;
|
|
704
|
+
message: string;
|
|
705
|
+
}
|
|
706
|
+
export interface ProductPlanningAskNotification {
|
|
707
|
+
productId: string;
|
|
708
|
+
askId: string;
|
|
709
|
+
questions: Array<{
|
|
710
|
+
question: string;
|
|
711
|
+
header: string;
|
|
712
|
+
options?: Array<{
|
|
713
|
+
label: string;
|
|
714
|
+
description?: string;
|
|
715
|
+
}>;
|
|
716
|
+
multiSelect?: boolean;
|
|
717
|
+
}>;
|
|
718
|
+
}
|
|
815
719
|
/** Plan interrupted. */
|
|
816
720
|
export interface PlanInterruptedNotification {
|
|
817
721
|
planId: string;
|
|
@@ -837,6 +741,29 @@ export interface ProjectSwitchedNotification {
|
|
|
837
741
|
export interface ProjectDeletedNotification {
|
|
838
742
|
id: string;
|
|
839
743
|
}
|
|
744
|
+
export interface ProjectDetachedNotification {
|
|
745
|
+
project: {
|
|
746
|
+
id: string;
|
|
747
|
+
name: string;
|
|
748
|
+
workspaceDir: string;
|
|
749
|
+
type: string;
|
|
750
|
+
status: "detached";
|
|
751
|
+
};
|
|
752
|
+
switchedTo?: {
|
|
753
|
+
id: string;
|
|
754
|
+
name: string;
|
|
755
|
+
workspaceDir: string;
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
export interface ProjectAttachedNotification {
|
|
759
|
+
project: {
|
|
760
|
+
id: string;
|
|
761
|
+
name: string;
|
|
762
|
+
workspaceDir: string;
|
|
763
|
+
type: string;
|
|
764
|
+
status: "active";
|
|
765
|
+
};
|
|
766
|
+
}
|
|
840
767
|
/** A project was renamed. */
|
|
841
768
|
export interface ProjectRenamedNotification {
|
|
842
769
|
id: string;
|
|
@@ -1023,6 +950,55 @@ export interface GoalAcceptanceUpdatedNotification {
|
|
|
1023
950
|
criterionId: string;
|
|
1024
951
|
status: string;
|
|
1025
952
|
}
|
|
953
|
+
export interface GoalRoundMessageNotification {
|
|
954
|
+
goalRunId: string;
|
|
955
|
+
message: {
|
|
956
|
+
messageId: string;
|
|
957
|
+
platform: string;
|
|
958
|
+
userId?: string;
|
|
959
|
+
type: string;
|
|
960
|
+
content: string;
|
|
961
|
+
timestamp: string;
|
|
962
|
+
source: string;
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
export interface MentionDelegateStartedNotification {
|
|
966
|
+
parentSessionId: string;
|
|
967
|
+
parentMessageId: string;
|
|
968
|
+
bindingId: string;
|
|
969
|
+
executionSessionId: string;
|
|
970
|
+
delegationId: string;
|
|
971
|
+
sequence: number;
|
|
972
|
+
providerId: string;
|
|
973
|
+
revision: number;
|
|
974
|
+
brief?: string;
|
|
975
|
+
}
|
|
976
|
+
export interface MentionDelegateActivityNotification {
|
|
977
|
+
parentSessionId: string;
|
|
978
|
+
parentMessageId: string;
|
|
979
|
+
bindingId: string;
|
|
980
|
+
executionSessionId: string;
|
|
981
|
+
delegationId: string;
|
|
982
|
+
sequence: number;
|
|
983
|
+
providerId: string;
|
|
984
|
+
revision: number;
|
|
985
|
+
toolName?: string;
|
|
986
|
+
delta?: string;
|
|
987
|
+
}
|
|
988
|
+
export interface MentionDelegateSettledNotification {
|
|
989
|
+
parentSessionId: string;
|
|
990
|
+
parentMessageId: string;
|
|
991
|
+
bindingId: string;
|
|
992
|
+
executionSessionId: string;
|
|
993
|
+
delegationId: string;
|
|
994
|
+
sequence: number;
|
|
995
|
+
providerId: string;
|
|
996
|
+
revision: number;
|
|
997
|
+
status: "completed" | "failed" | "cancelled";
|
|
998
|
+
changedFiles?: string[];
|
|
999
|
+
finalText?: string;
|
|
1000
|
+
error?: DelegationError;
|
|
1001
|
+
}
|
|
1026
1002
|
export interface NotificationMethodMap {
|
|
1027
1003
|
"turn.start": TurnStartNotification;
|
|
1028
1004
|
"turn.delta": TurnDeltaNotification;
|
|
@@ -1075,13 +1051,6 @@ export interface NotificationMethodMap {
|
|
|
1075
1051
|
"team.member.notification": TeamMemberNotification;
|
|
1076
1052
|
"turn.usage_update": TurnUsageUpdateNotification;
|
|
1077
1053
|
"pong": PongNotification;
|
|
1078
|
-
"agents.status": AgentsStatusNotification;
|
|
1079
|
-
"agents.error": AgentsErrorNotification;
|
|
1080
|
-
"agent.install.progress": AgentInstallProgressNotification;
|
|
1081
|
-
"agents.prompt.delta": AgentsPromptDeltaNotification;
|
|
1082
|
-
"agents.prompt.tool": AgentsPromptToolNotification;
|
|
1083
|
-
"agents.prompt.approval": AgentsPromptApprovalNotification;
|
|
1084
|
-
"agents.prompt.plan": AgentsPromptPlanNotification;
|
|
1085
1054
|
"solo.progress": SoloProgressNotification;
|
|
1086
1055
|
"solo.evaluation": SoloEvaluationNotification;
|
|
1087
1056
|
"solo.agentDelta": SoloAgentDeltaNotification;
|
|
@@ -1100,14 +1069,22 @@ export interface NotificationMethodMap {
|
|
|
1100
1069
|
"product.planReady": ProductPlanReadyNotification;
|
|
1101
1070
|
"product.planFailed": ProductPlanFailedNotification;
|
|
1102
1071
|
"product.planningDelta": ProductPlanningDeltaNotification;
|
|
1072
|
+
"product.leaderMessage": ProductLeaderMessageNotification;
|
|
1073
|
+
"product.planningAsk": ProductPlanningAskNotification;
|
|
1103
1074
|
"plan.interrupted": PlanInterruptedNotification;
|
|
1104
1075
|
"goal.run_state_changed": GoalRunStateChangedNotification;
|
|
1105
1076
|
"goal.phase_boundary": GoalPhaseBoundaryNotification;
|
|
1106
1077
|
"goal.goal_edited": GoalGoalEditedNotification;
|
|
1107
1078
|
"goal.message_queued": GoalMessageQueuedNotification;
|
|
1108
1079
|
"goal.acceptance_updated": GoalAcceptanceUpdatedNotification;
|
|
1080
|
+
"goal.round_message": GoalRoundMessageNotification;
|
|
1081
|
+
"mention.delegate_started": MentionDelegateStartedNotification;
|
|
1082
|
+
"mention.delegate_activity": MentionDelegateActivityNotification;
|
|
1083
|
+
"mention.delegate_settled": MentionDelegateSettledNotification;
|
|
1109
1084
|
"project.created": ProjectCreatedNotification;
|
|
1110
1085
|
"project.switched": ProjectSwitchedNotification;
|
|
1086
|
+
"project.detached": ProjectDetachedNotification;
|
|
1087
|
+
"project.attached": ProjectAttachedNotification;
|
|
1111
1088
|
"project.deleted": ProjectDeletedNotification;
|
|
1112
1089
|
"project.renamed": ProjectRenamedNotification;
|
|
1113
1090
|
"project.archived": ProjectArchivedNotification;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type HostAgentProviderDiagnostic, type HostAgentProviderGetResult, type HostAgentProviderListResult, type HostProviderRequestParams } from "../../host-contract/index.js";
|
|
2
|
+
export type HostProviderDirectoryErrorCode = "HOST_PROVIDER_DIRECTORY_UNAVAILABLE" | "HOST_PROVIDER_DIRECTORY_INVALID_RESPONSE";
|
|
3
|
+
export declare class HostProviderDirectoryError extends Error {
|
|
4
|
+
readonly code: HostProviderDirectoryErrorCode;
|
|
5
|
+
constructor(code: HostProviderDirectoryErrorCode, message: string, options?: ErrorOptions);
|
|
6
|
+
}
|
|
7
|
+
export interface HostProviderDirectoryRequester {
|
|
8
|
+
request(params: HostProviderRequestParams): Promise<unknown>;
|
|
9
|
+
}
|
|
10
|
+
export declare class HostAgentProviderDirectory {
|
|
11
|
+
private readonly requester;
|
|
12
|
+
constructor(requester: HostProviderDirectoryRequester);
|
|
13
|
+
list(): Promise<Readonly<HostAgentProviderListResult>>;
|
|
14
|
+
get(providerId: string): Promise<Readonly<HostAgentProviderGetResult>>;
|
|
15
|
+
diagnose(providerId: string): Promise<Readonly<HostAgentProviderDiagnostic>>;
|
|
16
|
+
private read;
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Project mutations are requests to the Gateway-owned X7 authority. */
|
|
2
2
|
import type { ProjectInfo, ProjectType } from "../../protocol/methods.js";
|
|
3
3
|
export declare function createProjectAuthoritative(params: {
|
|
4
4
|
name: string;
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
*
|
|
11
11
|
* projectId is the PATH-DERIVED key (deriveProjectId(workspaceDir), see agent-paths) — the
|
|
12
12
|
* mainstream model (VS Code / cc-haha): same folder → same id, deterministic, recomputable, no
|
|
13
|
-
* central-registry dependency for the storage key.
|
|
13
|
+
* central-registry dependency for the storage key. Only the Gateway archive-only internal-data
|
|
14
|
+
* transaction may remove projectData/<id>; qlogicagent has no lifecycle deletion authority.
|
|
14
15
|
*/
|
|
15
16
|
export { getProjectDataDirById, getProjectDataRoot } from "./agent-paths.js";
|
|
16
17
|
/** `~/.qlogicagent/projectData/<projectId>/` for a projectId or workspaceDir. */
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import type { HostProjectInfo, HostProjectSnapshotResult } from "../../host-contract/index.js";
|
|
3
3
|
import type { HostProjectClient } from "../../transport/host-project-client.js";
|
|
4
4
|
export declare function configureHostProjectAuthority(resolver: () => HostProjectClient | undefined): void;
|
|
5
|
-
export declare function hasHostProjectAuthority(): boolean;
|
|
6
5
|
export declare function hydrateHostProjectSnapshot(): Promise<void>;
|
|
7
|
-
export declare function readHostProjectSnapshot(): HostProjectSnapshotResult
|
|
6
|
+
export declare function readHostProjectSnapshot(): HostProjectSnapshotResult;
|
|
7
|
+
/** Test-only snapshot injection; production must hydrate through HostProjectClient. */
|
|
8
|
+
export declare function setHostProjectSnapshotForTests(next: HostProjectSnapshotResult): void;
|
|
8
9
|
export declare function createHostProject(params: Parameters<HostProjectClient["create"]>[0]): Promise<HostProjectInfo>;
|
|
9
10
|
export declare function switchHostProject(projectIdOrQuery: string): Promise<HostProjectInfo>;
|
|
10
11
|
export declare function updateHostProject(projectId: string, patch: Parameters<HostProjectClient["update"]>[1]): Promise<HostProjectInfo>;
|
|
@@ -1,48 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Read-only ExtHost-style Project projection.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Direction A: Agent is the source of truth for project state.
|
|
8
|
-
*/
|
|
9
|
-
import type { ProjectInfo, ProjectType } from "../../protocol/methods.js";
|
|
10
|
-
/**
|
|
11
|
-
* Rebuild projects.json from the per-project `project.json` back-refs (the durable truth). Self-heals
|
|
12
|
-
* a lost/corrupted index: any projectData/<id> with a back-ref not present in projects.json is
|
|
13
|
-
* re-added. Called at startup before the default-project bootstrap.
|
|
4
|
+
* Gateway owns the durable registry and every lifecycle mutation. qlogicagent
|
|
5
|
+
* may only read the snapshot hydrated through x/host.request.
|
|
14
6
|
*/
|
|
15
|
-
|
|
16
|
-
export declare function createProject(params: {
|
|
17
|
-
name: string;
|
|
18
|
-
workspaceDir: string;
|
|
19
|
-
type?: ProjectType;
|
|
20
|
-
groupId?: string;
|
|
21
|
-
skipAutoSwitch?: boolean;
|
|
22
|
-
}): ProjectInfo;
|
|
7
|
+
import type { ProjectInfo } from "../../protocol/methods.js";
|
|
23
8
|
export declare function listProjects(): ProjectInfo[];
|
|
24
9
|
export declare function getActiveProject(): ProjectInfo | null;
|
|
25
10
|
export declare function getDefaultProject(): ProjectInfo | null;
|
|
26
11
|
export declare function getProjectById(projectId: string): ProjectInfo | null;
|
|
27
|
-
export declare function updateProject(projectId: string, patch: Partial<Pick<ProjectInfo, "planStatus" | "planAgents" | "planWinnerId" | "leaderSessionId" | "primaryWorkflowId">>): boolean;
|
|
28
|
-
export declare function switchProject(projectId: string): ProjectInfo | null;
|
|
29
|
-
export declare function deleteProject(projectId: string): {
|
|
30
|
-
deleted: boolean;
|
|
31
|
-
switchedTo?: ProjectInfo;
|
|
32
|
-
};
|
|
33
|
-
export declare function getOrCreateDefaultProject(defaultWorkspaceDir: string): ProjectInfo;
|
|
34
|
-
export declare function renameProject(projectId: string, newName: string): ProjectInfo | null;
|
|
35
|
-
export declare function updateProjectWorkspaceDir(projectId: string, newDir: string): boolean;
|
|
36
|
-
export declare function archiveProject(projectId: string): {
|
|
37
|
-
archived: boolean;
|
|
38
|
-
switchedTo?: ProjectInfo;
|
|
39
|
-
};
|
|
40
|
-
export declare function unarchiveProject(projectId: string): ProjectInfo | null;
|
|
41
12
|
export declare function findByGroupId(groupId: string): ProjectInfo | null;
|
|
42
|
-
/**
|
|
43
|
-
* Find the active project whose workspaceDir resolves to `dir` (case-insensitive, path-resolved).
|
|
44
|
-
* Used to gate adoption of externally-supplied working directories (ACP session cwd, turn
|
|
45
|
-
* config.workdir): the active tool workdir must always be a registered project's workspaceDir, so
|
|
46
|
-
* a cwd that maps to no project is ignored rather than silently leaking files outside any project.
|
|
47
|
-
*/
|
|
48
13
|
export declare function findByWorkspaceDir(dir: string): ProjectInfo | null;
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import type { SessionListEntry } from "./session-types.js";
|
|
2
2
|
export declare function listSessions(limit: number | undefined, projectRoot: string): Promise<SessionListEntry[]>;
|
|
3
3
|
export declare function deleteSession(sessionId: string, projectRoot: string): Promise<void>;
|
|
4
|
-
/**
|
|
5
|
-
* Authoritative "already ours" id set for the lazy-migration discovery scan: every session id and
|
|
6
|
-
* bound native id recorded for `agentId` in this project — including ARCHIVED records, which the
|
|
7
|
-
* list pipeline filters out of its window.
|
|
8
|
-
*
|
|
9
|
-
* listSessions' windowed result must NOT be used for discovery dedup: it truncates (limit) and
|
|
10
|
-
* post-filters (archived), so an adopted session pushed out of the window would be "re-discovered"
|
|
11
|
-
* as a second entry — and a resume on that duplicate would fork a second canonical record for the
|
|
12
|
-
* same native conversation. This enumerates metadata.json only (no transcript counting), and
|
|
13
|
-
* callers only pay for it when the scan actually yielded candidates.
|
|
14
|
-
*/
|
|
15
|
-
export declare function collectAdoptedNativeIds(agentId: string, projectRoot: string): Promise<Set<string>>;
|
|
16
4
|
/**
|
|
17
5
|
* ⚠️ Destructive cascade with NO user-visible confirmation: every pruned session goes through
|
|
18
6
|
* deleteSession, which permanently removes its transcript + metadata + checkpoints + uploads.
|
|
@@ -29,6 +29,6 @@ export declare function loadSessionForResume(sessionId: string, projectRoot: str
|
|
|
29
29
|
export declare function saveSessionState(sessionId: string, usageSnapshot: SessionUsageSnapshot, metadata: SessionStateSaveMetadata, projectRoot: string): Promise<void>;
|
|
30
30
|
export declare function updateSessionMetadata(sessionId: string, patch: SessionMetadataPatch, projectRoot: string): Promise<import("./session-types.js").SessionMetadata | null>;
|
|
31
31
|
export { getSessionMetadata, readSessionMetadata };
|
|
32
|
-
export {
|
|
32
|
+
export { deleteSession, listSessions, pruneOldSessions } from "./session-catalog.js";
|
|
33
33
|
export { generateSessionTitle, maybeGenerateTaskSummary, shouldGenerateTaskSummary, } from "./session-summary.js";
|
|
34
34
|
export { SESSION_SCHEMA_VERSION, type MessageDisplayMetadata, type PersistedChatMessage, type PersistedSession, type SessionListEntry, type SessionMetadata, type TaskSummaryDeps, } from "./session-types.js";
|
|
@@ -9,7 +9,7 @@ export interface SessionResource {
|
|
|
9
9
|
agentId: string;
|
|
10
10
|
/** Owning project id (path-derived / opaque; not minted here). */
|
|
11
11
|
projectId: string;
|
|
12
|
-
/** Our-minted session id, stable from creation
|
|
12
|
+
/** Our-minted session id, stable from creation; native identity is held by Gateway Host state. */
|
|
13
13
|
canonicalSessionId: string;
|
|
14
14
|
}
|
|
15
15
|
/** Serialize the canonical session resource to its single opaque key string. */
|
|
@@ -18,25 +18,6 @@ export interface InflightTurnMarker {
|
|
|
18
18
|
/** 该轮是否已执行过有副作用的工具(写文件/发消息/外部 API)。安全档不据此自动续,仅用于 UI"可能重复"提示 + 为智能档铺路。 */
|
|
19
19
|
hadSideEffectTool?: boolean;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Native (codex/claude) session binding — present only on native sessions, written once the
|
|
23
|
-
* external agent reports its own session id (Y). Our `sessionId` stays the canonical identity;
|
|
24
|
-
* `nativeSessionId` is an ATTRIBUTE used ONLY when talking to the external CLI (ACP session/load),
|
|
25
|
-
* never as a map/pool/list key. `nativeRef` independently locates the external transcript file so
|
|
26
|
-
* content loads (and the binding is recoverable) without relying on `sessionId === nativeSessionId`.
|
|
27
|
-
*/
|
|
28
|
-
export interface NativeBinding {
|
|
29
|
-
/** External agent's own session id (Y) — used only for ACP session/load resume. */
|
|
30
|
-
nativeSessionId: string;
|
|
31
|
-
/** Locator for the external transcript file (loadTranscript + binding-loss fallback). */
|
|
32
|
-
nativeRef: {
|
|
33
|
-
agentId: string;
|
|
34
|
-
kind: "codex" | "claude";
|
|
35
|
-
file: string;
|
|
36
|
-
};
|
|
37
|
-
/** ISO time the binding was established (first turn the external agent reported Y). */
|
|
38
|
-
boundAt: string;
|
|
39
|
-
}
|
|
40
21
|
export interface SessionMetadata {
|
|
41
22
|
schemaVersion?: number;
|
|
42
23
|
sessionId: string;
|
|
@@ -71,8 +52,6 @@ export interface SessionMetadata {
|
|
|
71
52
|
interruptedTurnCount?: number;
|
|
72
53
|
/** 达熔断阈值放弃恢复的时间戳(UI 显示"多次中断已停止自动恢复")。 */
|
|
73
54
|
recoveryAbandonedAt?: string;
|
|
74
|
-
/** native(codex/claude)会话绑定:外部 Y + nativeRef;own 会话恒 undefined。见 {@link NativeBinding}。 */
|
|
75
|
-
nativeBinding?: NativeBinding;
|
|
76
55
|
}
|
|
77
56
|
export interface PersistedSession {
|
|
78
57
|
metadata: SessionMetadata;
|
|
@@ -123,8 +102,6 @@ export interface SessionListEntry {
|
|
|
123
102
|
groupKey?: string;
|
|
124
103
|
previousSessionId?: string;
|
|
125
104
|
carryoverSummary?: string | null;
|
|
126
|
-
/** N4: native (codex/claude) binding, surfaced so session.list can shape source:"native" + nativeRef. */
|
|
127
|
-
nativeBinding?: NativeBinding;
|
|
128
105
|
}
|
|
129
106
|
export interface TaskSummaryDeps {
|
|
130
107
|
transport: import("../ports/index.js").LLMTransport;
|
|
@@ -74,7 +74,6 @@ export interface AcpRequestHandler {
|
|
|
74
74
|
ok: boolean;
|
|
75
75
|
summary?: string;
|
|
76
76
|
}>;
|
|
77
|
-
handleAcpAgentsList(): Promise<unknown>;
|
|
78
77
|
handleAcpSoloStart(params: Record<string, unknown>): Promise<unknown>;
|
|
79
78
|
handleAcpSoloStatus(params: Record<string, unknown>): Promise<unknown>;
|
|
80
79
|
handleAcpSoloSelect(params: Record<string, unknown>): Promise<unknown>;
|
|
@@ -106,9 +105,6 @@ export interface AcpRequestHandler {
|
|
|
106
105
|
handleAcpGoalMessage(params: Record<string, unknown>): Promise<unknown>;
|
|
107
106
|
handleAcpGoalSubscribe(params: Record<string, unknown>): Promise<unknown>;
|
|
108
107
|
handleAcpGoalEvents(params: Record<string, unknown>): Promise<unknown>;
|
|
109
|
-
handleAcpMentionDelegate(params: Record<string, unknown>): Promise<unknown>;
|
|
110
|
-
handleAcpMentionCancel(params: Record<string, unknown>): Promise<unknown>;
|
|
111
|
-
handleAcpMentionList(params: Record<string, unknown>): Promise<unknown>;
|
|
112
108
|
}
|
|
113
109
|
export interface AcpServerConfig {
|
|
114
110
|
verbose?: boolean;
|
|
@@ -148,7 +144,7 @@ export declare class AcpServer {
|
|
|
148
144
|
/**
|
|
149
145
|
* S3a 跨进程 delegate 客户端(泛化本类的 outbound-request 底座;设计 §5.1)。与审批 outboundRequestMap
|
|
150
146
|
* 并存:x/delegate 用 `del-*` rpc id,审批用 `perm-*`,handleResponse 先问 delegate 再落审批,互不干扰。
|
|
151
|
-
*
|
|
147
|
+
* All orchestration stations call this client through the authority-neutral DelegateBridge.
|
|
152
148
|
*/
|
|
153
149
|
private readonly delegateClient;
|
|
154
150
|
/** Coordinator-owned client reference; AcpServer only offers its response-claim seam. */
|
|
@@ -187,11 +183,7 @@ export declare class AcpServer {
|
|
|
187
183
|
supportsHostRequestService(service: HostRequestService): boolean;
|
|
188
184
|
/** Capability snapshot consumed by the coordinator-owned HostRequestClient. */
|
|
189
185
|
get hostRequestCapability(): unknown;
|
|
190
|
-
/**
|
|
191
|
-
* S3a 跨进程 delegate 客户端(leader 侧接缝)。S3c 接线:DelegationCoordinator.delegate() 改为
|
|
192
|
-
* 铸 delegationId → `server.delegate.delegate({delegationId,to,input,session,opts}, sink)` 上行 x/delegate、
|
|
193
|
-
* 消费 x/delegate.update 下行喂规划环/RunStateStore(delegation-coordinator.ts:87 复用点)。本 S3a 只交付+测,不切。
|
|
194
|
-
*/
|
|
186
|
+
/** Cross-process delegate client used by orchestration stations through DelegateBridge. */
|
|
195
187
|
get delegate(): DelegateClient;
|
|
196
188
|
/** Whether a session id has been registered via session/new on this connection. */
|
|
197
189
|
hasSession(sessionId: string): boolean;
|