qlogicagent 2.18.6 → 2.18.8
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.js +30 -30
- package/dist/cli.js +1 -1
- package/dist/host-contract.js +1 -0
- package/dist/index.js +538 -528
- package/dist/orchestration.js +4 -4
- package/dist/permissions.js +1 -1
- package/dist/plugin-marketplace-compute.js +1 -0
- package/dist/protocol.js +1 -1
- package/dist/skills/mcp/astraclaw-native-mcp-server.js +4 -4
- package/dist/tunables.js +1 -0
- package/dist/types/agent/runtime-vars.d.ts +1 -2
- package/dist/types/agent/tool-loop.d.ts +6 -0
- package/dist/types/agent/tool-loop.test-harness.d.ts +20 -0
- package/dist/types/agent/types.d.ts +2 -0
- package/dist/types/cli/acp-extended-handlers.d.ts +7 -0
- package/dist/types/cli/acp-extended-host-adapter.d.ts +2 -0
- package/dist/types/cli/acp-session-host.d.ts +15 -2
- package/dist/types/cli/base-tool-bootstrap.d.ts +1 -0
- package/dist/types/cli/community-skill-installer.d.ts +2 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +4 -0
- package/dist/types/cli/core-tools/config-tool-bootstrap.d.ts +3 -1
- package/dist/types/cli/core-tools/config-tool-service.d.ts +7 -5
- package/dist/types/cli/default-project-bootstrap.d.ts +1 -0
- package/dist/types/cli/handlers/agents-handler.d.ts +4 -1
- package/dist/types/cli/handlers/community-handler.d.ts +2 -0
- package/dist/types/cli/handlers/config-handler.d.ts +2 -15
- package/dist/types/cli/handlers/pet-handler.d.ts +3 -2
- package/dist/types/cli/handlers/session-handler.d.ts +1 -1
- package/dist/types/cli/handlers/skills-handler.d.ts +12 -10
- package/dist/types/cli/handlers/solo-handler.d.ts +3 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +47 -33
- package/dist/types/cli/handlers/workflow-handler.d.ts +6 -0
- package/dist/types/cli/mcp-bootstrap.d.ts +0 -2
- package/dist/types/cli/media-inline.d.ts +14 -0
- package/dist/types/cli/media-understanding.d.ts +65 -8
- package/dist/types/cli/memory-coordinator.d.ts +8 -0
- package/dist/types/cli/multi-agent-handler-host.d.ts +2 -0
- package/dist/types/cli/permission-bootstrap.d.ts +2 -0
- package/dist/types/cli/pet-runtime.d.ts +0 -1
- package/dist/types/cli/plugin-bootstrap.d.ts +2 -1
- package/dist/types/cli/product-coordinator.d.ts +4 -1
- package/dist/types/cli/rpc-registry.d.ts +1 -3
- package/dist/types/cli/runtime-watcher-bootstrap.d.ts +0 -2
- package/dist/types/cli/session-context.d.ts +4 -2
- package/dist/types/cli/skill-invocation-service.d.ts +2 -0
- package/dist/types/cli/skill-tools-bootstrap.d.ts +2 -0
- package/dist/types/cli/skills-query-service.d.ts +2 -1
- package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +9 -0
- package/dist/types/cli/stdio-acp-request-host.d.ts +11 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +1 -1
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +6 -0
- package/dist/types/cli/stdio-runtime-services.d.ts +6 -1
- package/dist/types/cli/stdio-server.d.ts +33 -4
- package/dist/types/cli/task-distillation-coordinator.d.ts +9 -4
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +3 -0
- package/dist/types/cli/tool-bootstrap-media-registration.d.ts +10 -0
- package/dist/types/cli/tool-bootstrap-web-registration.d.ts +1 -0
- package/dist/types/cli/tool-bootstrap.d.ts +9 -0
- package/dist/types/cli/turn-core.d.ts +2 -0
- package/dist/types/cli/turn-preview-browser-setup.d.ts +15 -0
- package/dist/types/cli/turn-project-router.d.ts +1 -1
- package/dist/types/cli/workflow-host-adapter.d.ts +2 -0
- package/dist/types/contracts/structured-planner.d.ts +2 -0
- package/dist/types/host-contract/index.d.ts +1475 -0
- package/dist/types/host-contract/project-id.d.ts +5 -0
- package/dist/types/host-contract/provider-profile.d.ts +46 -0
- package/dist/types/orchestration/agent-instance.d.ts +6 -0
- package/dist/types/orchestration/delegation-coordinator.d.ts +40 -0
- package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -0
- package/dist/types/orchestration/product-planner.d.ts +3 -0
- package/dist/types/orchestration/solo-evaluator.d.ts +19 -5
- package/dist/types/orchestration/solo-persistence.d.ts +2 -0
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +4 -0
- package/dist/types/permissions.d.ts +2 -0
- package/dist/types/protocol/methods.d.ts +0 -199
- package/dist/types/protocol/wire/acp-protocol.d.ts +16 -1
- package/dist/types/protocol/wire/agent-methods.d.ts +1 -173
- package/dist/types/protocol/wire/chat-types.d.ts +6 -0
- package/dist/types/runtime/config/tunable-defaults.d.ts +13 -3
- package/dist/types/runtime/execution/dream-agent.d.ts +9 -8
- package/dist/types/runtime/infra/agent-paths.d.ts +3 -3
- package/dist/types/runtime/infra/astraclaw-capabilities.d.ts +1 -1
- package/dist/types/runtime/infra/clixml-sanitize.d.ts +16 -0
- package/dist/types/runtime/infra/external-agent-approvals.d.ts +18 -0
- package/dist/types/runtime/infra/feedback-distillation.d.ts +3 -1
- package/dist/types/runtime/infra/feedback-host-authority.d.ts +4 -0
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +2 -13
- package/dist/types/runtime/infra/model-registry.d.ts +3 -1
- package/dist/types/runtime/infra/project-authority-facade.d.ts +11 -0
- package/dist/types/runtime/infra/project-host-authority.d.ts +10 -0
- package/dist/types/runtime/ports/memory-provider.d.ts +11 -7
- package/dist/types/runtime/ports/tool-contracts.d.ts +2 -0
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +2 -2
- package/dist/types/runtime/session/session-persistence.d.ts +29 -10
- package/dist/types/runtime/session/session-recovery.d.ts +4 -0
- package/dist/types/runtime/session/session-summary.d.ts +3 -1
- package/dist/types/runtime/session/session-transcript-store.d.ts +7 -0
- package/dist/types/skills/memory/host-memory-provider.d.ts +148 -0
- package/dist/types/skills/memory/local-memory-provider.d.ts +19 -10
- package/dist/types/skills/memory/task-distillation.d.ts +6 -0
- package/dist/types/skills/plugins/plugin-marketplace.d.ts +23 -57
- package/dist/types/skills/tools/media-understand-tool.d.ts +28 -0
- package/dist/types/skills/tools/preview-browser-tool.d.ts +136 -0
- package/dist/types/skills/tools/shell/task-output.d.ts +10 -1
- package/dist/types/skills/tools/skill-tool.d.ts +1 -1
- package/dist/types/skills/web-search/brave-source.d.ts +2 -1
- package/dist/types/skills/web-search/crawl4ai-extractor.d.ts +3 -2
- package/dist/types/skills/web-search/exa-source.d.ts +2 -1
- package/dist/types/skills/web-search/search-svc-source.d.ts +4 -3
- package/dist/types/skills/web-search/searxng-source.d.ts +3 -1
- package/dist/types/skills/web-search/serper-source.d.ts +2 -1
- package/dist/types/skills/web-search/source-factory.d.ts +2 -1
- package/dist/types/skills/web-search/web-tunable-resolver.d.ts +16 -0
- package/dist/types/test-support/global-home-setup.d.ts +2 -0
- package/dist/types/transport/acp-server.d.ts +29 -0
- package/dist/types/transport/delegate-client.d.ts +82 -0
- package/dist/types/transport/host-capability-client.d.ts +21 -0
- package/dist/types/transport/host-feedback-client.d.ts +25 -0
- package/dist/types/transport/host-profile-client.d.ts +19 -0
- package/dist/types/transport/host-project-client.d.ts +16 -0
- package/dist/types/transport/host-request-client.d.ts +38 -0
- package/dist/types/transport/host-session-client.d.ts +29 -0
- package/dist/types/tunables.d.ts +2 -0
- package/package.json +26 -3
- package/dist/types/cli/handlers/settings-handler.d.ts +0 -19
- package/dist/types/cli/permission-rule-persistence.d.ts +0 -16
- package/dist/types/cli/tunable-store.d.ts +0 -26
- package/dist/types/skills/permissions/settings-watcher.d.ts +0 -26
- /package/dist/types/{skills/memory → host-contract}/fts-segment.d.ts +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Agent RPC Method Map — complete typed contract for ALL agent JSON-RPC methods.
|
|
3
3
|
*
|
|
4
4
|
* This extends GatewayRpcMethodMap (26 methods Gateway directly calls) with all
|
|
5
|
-
* additional agent-specific methods (thread, memory,
|
|
5
|
+
* additional agent-specific methods (thread, memory, agents, solo, product, etc.).
|
|
6
6
|
*
|
|
7
7
|
* Consumers use this for fully typed RPC clients:
|
|
8
8
|
* import type { AgentRpcMethodMap } from "qlogicagent/protocol";
|
|
@@ -375,22 +375,6 @@ export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
|
|
|
375
375
|
}>;
|
|
376
376
|
};
|
|
377
377
|
};
|
|
378
|
-
"config.get": {
|
|
379
|
-
params: {
|
|
380
|
-
keys?: string[];
|
|
381
|
-
};
|
|
382
|
-
result: {
|
|
383
|
-
config: Record<string, unknown>;
|
|
384
|
-
};
|
|
385
|
-
};
|
|
386
|
-
"config.update": {
|
|
387
|
-
params: {
|
|
388
|
-
updates: Record<string, unknown>;
|
|
389
|
-
};
|
|
390
|
-
result: {
|
|
391
|
-
ok: boolean;
|
|
392
|
-
};
|
|
393
|
-
};
|
|
394
378
|
"todos.list": {
|
|
395
379
|
params: {
|
|
396
380
|
sessionId?: string;
|
|
@@ -661,144 +645,6 @@ export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
|
|
|
661
645
|
model?: string;
|
|
662
646
|
};
|
|
663
647
|
};
|
|
664
|
-
"settings.listProviders": {
|
|
665
|
-
params: undefined;
|
|
666
|
-
result: {
|
|
667
|
-
providers: Array<{
|
|
668
|
-
id: string;
|
|
669
|
-
displayName: string;
|
|
670
|
-
baseUrl: string;
|
|
671
|
-
modelCount: number;
|
|
672
|
-
}>;
|
|
673
|
-
};
|
|
674
|
-
};
|
|
675
|
-
"settings.addKey": {
|
|
676
|
-
params: {
|
|
677
|
-
providerId: string;
|
|
678
|
-
key: string;
|
|
679
|
-
label?: string;
|
|
680
|
-
};
|
|
681
|
-
result: {
|
|
682
|
-
keyId: string;
|
|
683
|
-
providerId: string;
|
|
684
|
-
};
|
|
685
|
-
};
|
|
686
|
-
"settings.removeKey": {
|
|
687
|
-
params: {
|
|
688
|
-
keyId: string;
|
|
689
|
-
};
|
|
690
|
-
result: {
|
|
691
|
-
ok: true;
|
|
692
|
-
};
|
|
693
|
-
};
|
|
694
|
-
"settings.getKey": {
|
|
695
|
-
params: {
|
|
696
|
-
keyId: string;
|
|
697
|
-
};
|
|
698
|
-
result: {
|
|
699
|
-
key: string;
|
|
700
|
-
};
|
|
701
|
-
};
|
|
702
|
-
"settings.copyKey": {
|
|
703
|
-
params: {
|
|
704
|
-
keyId: string;
|
|
705
|
-
};
|
|
706
|
-
result: {
|
|
707
|
-
ok: true;
|
|
708
|
-
};
|
|
709
|
-
};
|
|
710
|
-
"settings.toggleKey": {
|
|
711
|
-
params: {
|
|
712
|
-
keyId: string;
|
|
713
|
-
enabled: boolean;
|
|
714
|
-
};
|
|
715
|
-
result: {
|
|
716
|
-
ok: true;
|
|
717
|
-
};
|
|
718
|
-
};
|
|
719
|
-
"settings.toggleModel": {
|
|
720
|
-
params: {
|
|
721
|
-
modelId: string;
|
|
722
|
-
enabled: boolean;
|
|
723
|
-
purpose?: string;
|
|
724
|
-
};
|
|
725
|
-
result: {
|
|
726
|
-
ok: true;
|
|
727
|
-
};
|
|
728
|
-
};
|
|
729
|
-
"settings.listModels": {
|
|
730
|
-
params: {
|
|
731
|
-
purpose?: string;
|
|
732
|
-
provider?: string;
|
|
733
|
-
};
|
|
734
|
-
result: {
|
|
735
|
-
models: unknown[];
|
|
736
|
-
grouped: Record<string, unknown[]>;
|
|
737
|
-
};
|
|
738
|
-
};
|
|
739
|
-
"settings.setActiveModel": {
|
|
740
|
-
params: {
|
|
741
|
-
purpose: string;
|
|
742
|
-
modelId: string;
|
|
743
|
-
};
|
|
744
|
-
result: {
|
|
745
|
-
ok: true;
|
|
746
|
-
};
|
|
747
|
-
};
|
|
748
|
-
"settings.getActiveModel": {
|
|
749
|
-
params: {
|
|
750
|
-
purpose: string;
|
|
751
|
-
};
|
|
752
|
-
result: {
|
|
753
|
-
model: {
|
|
754
|
-
id: string;
|
|
755
|
-
provider: string;
|
|
756
|
-
model: string;
|
|
757
|
-
displayName: string;
|
|
758
|
-
routeIntents: string[];
|
|
759
|
-
capabilityProfile?: Record<string, unknown>;
|
|
760
|
-
enabled: boolean;
|
|
761
|
-
} | null;
|
|
762
|
-
available: boolean;
|
|
763
|
-
};
|
|
764
|
-
};
|
|
765
|
-
"settings.getOverview": {
|
|
766
|
-
params: undefined;
|
|
767
|
-
result: {
|
|
768
|
-
providers: Array<{
|
|
769
|
-
providerId: string;
|
|
770
|
-
baseUrl?: string;
|
|
771
|
-
keyCount: number;
|
|
772
|
-
healthyKeys: number;
|
|
773
|
-
totalKeys: number;
|
|
774
|
-
}>;
|
|
775
|
-
purposes: Record<string, {
|
|
776
|
-
bound: boolean;
|
|
777
|
-
modelId?: string;
|
|
778
|
-
modelName?: string;
|
|
779
|
-
available: boolean;
|
|
780
|
-
}>;
|
|
781
|
-
};
|
|
782
|
-
};
|
|
783
|
-
"settings.refreshModels": {
|
|
784
|
-
params: undefined;
|
|
785
|
-
result: {
|
|
786
|
-
ok: true;
|
|
787
|
-
catalogRefreshed?: boolean;
|
|
788
|
-
};
|
|
789
|
-
};
|
|
790
|
-
"settings.validateKey": {
|
|
791
|
-
params: {
|
|
792
|
-
providerId: string;
|
|
793
|
-
apiKey: string;
|
|
794
|
-
baseUrl?: string;
|
|
795
|
-
};
|
|
796
|
-
result: {
|
|
797
|
-
valid: boolean;
|
|
798
|
-
status: number;
|
|
799
|
-
error?: string;
|
|
800
|
-
};
|
|
801
|
-
};
|
|
802
648
|
"provider.list": {
|
|
803
649
|
params: undefined;
|
|
804
650
|
result: {
|
|
@@ -816,24 +662,6 @@ export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
|
|
|
816
662
|
}>;
|
|
817
663
|
};
|
|
818
664
|
};
|
|
819
|
-
"config.tunables": {
|
|
820
|
-
params: undefined;
|
|
821
|
-
result: {
|
|
822
|
-
defaults: Record<string, unknown>;
|
|
823
|
-
overrides: Record<string, unknown>;
|
|
824
|
-
};
|
|
825
|
-
};
|
|
826
|
-
"config.updateTunable": {
|
|
827
|
-
params: {
|
|
828
|
-
key: string;
|
|
829
|
-
value?: unknown;
|
|
830
|
-
};
|
|
831
|
-
result: {
|
|
832
|
-
ok: true;
|
|
833
|
-
key: string;
|
|
834
|
-
value: unknown;
|
|
835
|
-
};
|
|
836
|
-
};
|
|
837
665
|
"community.resolveInstall": {
|
|
838
666
|
params: {
|
|
839
667
|
resourceId: string;
|
|
@@ -36,6 +36,12 @@ export interface ChatMessage {
|
|
|
36
36
|
tool_call_id?: string;
|
|
37
37
|
/** For tool result messages — tool name. */
|
|
38
38
|
name?: string;
|
|
39
|
+
/** Tool-result error flag (AP2) — propagated so every transport can signal failure to the model. */
|
|
40
|
+
is_error?: boolean;
|
|
41
|
+
/** OpenAI-chat reasoning content (GLM/DeepSeek) carried across tool-call rounds on the assistant message. */
|
|
42
|
+
reasoning_content?: string;
|
|
43
|
+
/** Anthropic tool_reference metadata for tool_result blocks. */
|
|
44
|
+
toolReferences?: string[];
|
|
39
45
|
/** Anthropic thinking blocks — must be passed back to API in subsequent requests. */
|
|
40
46
|
thinkingBlocks?: ThinkingBlock[];
|
|
41
47
|
/** Image URLs for vision-capable models. */
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* ALL configurable constants that external apps (Electron UI, CLI config)
|
|
5
5
|
* may want to read or override are defined here. This enables:
|
|
6
6
|
*
|
|
7
|
-
* 1.
|
|
7
|
+
* 1. Private X7 host profile tooling and local runtime consumers
|
|
8
8
|
* 2. Serialization to JSON for persistence (settings.json)
|
|
9
9
|
* 3. Environment variable overrides via QLOGICAGENT_* prefix
|
|
10
10
|
*
|
|
11
11
|
* Consumers import individual constants from this module.
|
|
12
|
-
* The full shape is exported as `TunableDefaults`
|
|
12
|
+
* The full shape is exported as `TunableDefaults` for the private host profile contract.
|
|
13
13
|
*
|
|
14
14
|
* Grouping follows subsystem boundaries.
|
|
15
15
|
*/
|
|
@@ -165,7 +165,7 @@ export declare const DREAM_COOLDOWN_MS = 14400000;
|
|
|
165
165
|
export declare const DREAM_MAX_DURATION_MS = 300000;
|
|
166
166
|
/**
|
|
167
167
|
* Full typed shape of all tunable defaults.
|
|
168
|
-
* Used by
|
|
168
|
+
* Used by private X7 host profile tooling and local runtime consumers.
|
|
169
169
|
*/
|
|
170
170
|
export interface TunableDefaults {
|
|
171
171
|
maxRoundsLimit: number;
|
|
@@ -241,3 +241,13 @@ export interface TunableDefaults {
|
|
|
241
241
|
* Use this for RPC serialization and external app display.
|
|
242
242
|
*/
|
|
243
243
|
export declare function getTunableDefaults(): TunableDefaults;
|
|
244
|
+
export type TunableKey = keyof TunableDefaults;
|
|
245
|
+
/** Validate a tunable name against the one authoritative defaults table. */
|
|
246
|
+
export declare function validateTunableKey(key: string): string | null;
|
|
247
|
+
/**
|
|
248
|
+
* Validate an already-coerced update. Error text deliberately reports only the declared/received
|
|
249
|
+
* types and never interpolates the rejected value (some string tunables are credentials).
|
|
250
|
+
*/
|
|
251
|
+
export declare function validateTunableUpdate(key: string, value: unknown): string | null;
|
|
252
|
+
/** Coerce a string toward a declared scalar type; unknown keys and unsafe numbers stay unchanged. */
|
|
253
|
+
export declare function coerceTunableValue(key: string, value: unknown): unknown;
|
|
@@ -212,8 +212,9 @@ export interface DreamRunDeps {
|
|
|
212
212
|
feedback?(memoryIds: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<{
|
|
213
213
|
affected: number;
|
|
214
214
|
}>;
|
|
215
|
-
/** Recent activity summary for temporal context injection into Dream.
|
|
216
|
-
|
|
215
|
+
/** Recent activity summary for temporal context injection into Dream.
|
|
216
|
+
* B3(X7)异步化:16 面 host-state proxy 方法(host 模式经 x/host.request 跨进程)。 */
|
|
217
|
+
getActivitySummary?(userId: string, days?: number): Promise<{
|
|
217
218
|
dailyCounts: Array<{
|
|
218
219
|
date: string;
|
|
219
220
|
count: number;
|
|
@@ -224,13 +225,13 @@ export interface DreamRunDeps {
|
|
|
224
225
|
importance: number;
|
|
225
226
|
date: string;
|
|
226
227
|
}>;
|
|
227
|
-
}
|
|
228
|
-
/** Synthesize a timeline narrative for a time range. */
|
|
229
|
-
synthesizeTimeline?(userId: string, startMs: number, endMs: number): string
|
|
230
|
-
/** Get/set user profile entries. */
|
|
228
|
+
}>;
|
|
229
|
+
/** Synthesize a timeline narrative for a time range. B3(X7)异步化。 */
|
|
230
|
+
synthesizeTimeline?(userId: string, startMs: number, endMs: number): Promise<string>;
|
|
231
|
+
/** Get/set user profile entries. B3(X7):setProfile/getAllProfiles 异步化(16 面);getProfile 面外保持同步。 */
|
|
231
232
|
getProfile?(userId: string, key: string): string | null;
|
|
232
|
-
setProfile?(userId: string, key: string, value: string): void
|
|
233
|
-
getAllProfiles?(userId: string): Record<string, string
|
|
233
|
+
setProfile?(userId: string, key: string, value: string): Promise<void>;
|
|
234
|
+
getAllProfiles?(userId: string): Promise<Record<string, string>>;
|
|
234
235
|
/** Drain consolidation backlog: resolve conflicts + promote corroborated pending claims. */
|
|
235
236
|
resolveConflicts?(userId: string, opts?: {
|
|
236
237
|
minEvidenceToPromote?: number;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* `<project>/.qlogicagent/` (project-level) must go through these
|
|
6
6
|
* helpers so the dot-dir name is defined in exactly one place.
|
|
7
7
|
*/
|
|
8
|
+
export { deriveProjectId } from "../../host-contract/project-id.js";
|
|
8
9
|
/** Dot-directory name used for both user-level and project-level storage. */
|
|
9
10
|
export declare const AGENT_DOT_DIR = ".qlogicagent";
|
|
10
11
|
/**
|
|
@@ -14,10 +15,9 @@ export declare const AGENT_DOT_DIR = ".qlogicagent";
|
|
|
14
15
|
* keeps the id length-safe on Windows (260-char path limit) while staying collision-free in
|
|
15
16
|
* practice. NOTE: deliberately NO ctime salt (VS Code salts single-folder ids so recreating a folder
|
|
16
17
|
* yields fresh state — a footgun for us; we want a recreated/rebound folder to map back to its data).
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* The implementation is owned by host-contract/project-id.ts so the shared contract remains a leaf;
|
|
19
|
+
* this module re-exports the same function for existing path-helper consumers.
|
|
19
20
|
*/
|
|
20
|
-
export declare function deriveProjectId(workspaceDir: string): string;
|
|
21
21
|
/** `~/.qlogicagent/` (or QLOGICAGENT_HOME override) */
|
|
22
22
|
export declare function getUserAgentHome(): string;
|
|
23
23
|
export declare function resolveActiveOwnerUserId(): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolCatalog } from "../ports/index.js";
|
|
2
2
|
export declare const ASTRACLAW_CAPABILITIES_SERVER_NAME = "astraclaw_capabilities";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const ASTRACLAW_CAPABILITIES_RETIRED_SERVER_NAMES: readonly ["astraclaw"];
|
|
4
4
|
export interface AstraClawCapabilityToolInput {
|
|
5
5
|
tool: string;
|
|
6
6
|
args: Record<string, unknown>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* De-serialize Windows PowerShell 5.1 CLIXML noise back to readable text.
|
|
3
|
+
*
|
|
4
|
+
* When PS 5.1's stderr is a redirected pipe (a spawned child) and a native command writes to stderr —
|
|
5
|
+
* or PS itself raises Write-Error / throw — it appends a `#< CLIXML\n<Objs …>…</Objs>` block that
|
|
6
|
+
* serializes the error/progress streams. Left raw, the model sees XML garbage and assumes its output
|
|
7
|
+
* was "swallowed", then flails. This replaces each CLIXML block with the decoded human-readable
|
|
8
|
+
* strings (`<S>…</S>` — the error/warning text), dropping the `<Obj>` progress/type-name scaffolding.
|
|
9
|
+
* A native command's own stderr already appears RAW before the block, so this only RECOVERS the
|
|
10
|
+
* PowerShell-native errors that would otherwise live solely inside the CLIXML. Non-PowerShell output
|
|
11
|
+
* (no CLIXML marker) is returned unchanged, so it is safe to call on any exec output — bash included.
|
|
12
|
+
*
|
|
13
|
+
* Callers pass a COMPLETE snapshot of the output (a full stdout/stderr string or a whole-file read),
|
|
14
|
+
* never a mid-stream chunk: an incomplete `<Objs>` block would not match and would be left raw.
|
|
15
|
+
*/
|
|
16
|
+
export declare function sanitizePowerShellClixml(text: string): string;
|
|
@@ -30,6 +30,24 @@ export interface ApprovalForwardDeps {
|
|
|
30
30
|
sendNotification?: (method: string, params: Record<string, unknown>) => void;
|
|
31
31
|
timeoutMs?: number;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* 激活层(S3c §1.1)delegate 路径的审批决议:输入是 SupervisorEventSink.onApprovalRequest 的已翻译
|
|
35
|
+
* 形状(toolName/options 已扁平,非 ACP 原始 session/request_permission params)。决议序与旧路径
|
|
36
|
+
* forwardExternalApproval 逐条对齐:①AstraClaw 只读能力自批 ②有交互上下文 → forward()发 UI 卡 +
|
|
37
|
+
* 同一 PENDING registry 等 agents.approvalResponse ③无上下文/超时 → reject 回退。返回最终 optionId
|
|
38
|
+
* (不透明,E2);调用方拿它走 x/delegate.respond(gateway 唯一应答口 respondApproval)。
|
|
39
|
+
*/
|
|
40
|
+
export declare function decideExternalApproval(input: {
|
|
41
|
+
agentId: string;
|
|
42
|
+
approvalId: string;
|
|
43
|
+
toolName?: string;
|
|
44
|
+
options: Array<Record<string, unknown>>;
|
|
45
|
+
/** 有流式回合上下文(turnId 在)才值得转 UI 卡;否则直接回退 reject。 */
|
|
46
|
+
hasInteractiveContext: boolean;
|
|
47
|
+
/** 发 agents.prompt.approval UI 卡(形状归属调用方;只在需要用户决议时调用)。 */
|
|
48
|
+
forward: () => void;
|
|
49
|
+
timeoutMs?: number;
|
|
50
|
+
}): Promise<string>;
|
|
33
51
|
/**
|
|
34
52
|
* Drive one interactive approval for an external agent: forward the ACP session/request_permission
|
|
35
53
|
* to the user (agents.prompt.approval), await the decision, and return the chosen optionId. Falls
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FeedbackEvent } from "./feedback-event-store.js";
|
|
2
|
+
type DistillableFeedback = Pick<FeedbackEvent, "feedbackId" | "rating" | "reason" | "state" | "sessionId" | "turnId">;
|
|
2
3
|
/** Minimum corroborating active events before a cluster becomes a proposal (mini-design §3.4). */
|
|
3
4
|
export declare const MIN_EVIDENCE = 2;
|
|
4
5
|
export interface FeedbackDistillationCandidate {
|
|
@@ -27,4 +28,5 @@ export interface FeedbackDistillationCandidate {
|
|
|
27
28
|
* (retracted / replaced are filtered — §11.1). Clusters below MIN_EVIDENCE are dropped. Output is
|
|
28
29
|
* sorted by clusterKey for deterministic ordering across runs.
|
|
29
30
|
*/
|
|
30
|
-
export declare function distillFeedback(events:
|
|
31
|
+
export declare function distillFeedback(events: DistillableFeedback[]): FeedbackDistillationCandidate[];
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HostFeedbackClient } from "../../transport/host-feedback-client.js";
|
|
2
|
+
/** Process-lifetime binding installed by stdio-server after ACP initialize capability negotiation. */
|
|
3
|
+
export declare function configureHostFeedbackAuthority(resolver: () => HostFeedbackClient | undefined): void;
|
|
4
|
+
export declare function getHostFeedbackAuthority(): HostFeedbackClient | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ModelCapabilityProfile, ModelEntry, ModelPurpose, ModelRegistry, ReasoningMode } from "./model-registry.js";
|
|
2
2
|
import type { ConfigPort } from "../ports/index.js";
|
|
3
|
+
import { type ProviderCatalogDef } from "../../host-contract/provider-profile.js";
|
|
3
4
|
export declare const LLMROUTER_CATALOG_UNAVAILABLE_MESSAGE = "\u65E0\u6CD5\u8FDE\u63A5 llmrouter \u6A21\u578B\u76EE\u5F55";
|
|
4
5
|
export declare const LLMROUTER_PROVIDER_ID = "llmrouter";
|
|
5
6
|
export declare const LLMROUTER_PROVIDER_NAME = "LLMRouter";
|
|
@@ -19,19 +20,7 @@ export declare class LlmrouterAuthError extends Error {
|
|
|
19
20
|
readonly status: number;
|
|
20
21
|
constructor(status: number, message?: string);
|
|
21
22
|
}
|
|
22
|
-
export interface LlmrouterCatalogProvider {
|
|
23
|
-
id: string;
|
|
24
|
-
name?: string;
|
|
25
|
-
displayName?: string;
|
|
26
|
-
group?: string;
|
|
27
|
-
baseUrl?: string;
|
|
28
|
-
base_url?: string;
|
|
29
|
-
transport?: string;
|
|
30
|
-
authType?: string;
|
|
31
|
-
apiKeyEnvVars?: string[];
|
|
32
|
-
models?: Array<{
|
|
33
|
-
id?: string;
|
|
34
|
-
}>;
|
|
23
|
+
export interface LlmrouterCatalogProvider extends ProviderCatalogDef {
|
|
35
24
|
}
|
|
36
25
|
export interface LlmrouterCatalogModel {
|
|
37
26
|
id: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { MODEL_PURPOSES, type ModelPurpose } from "../../host-contract/index.js";
|
|
1
2
|
import { type KeyConfig, type KeyHandle, type LoadBalanceStrategy, type PoolStatus, type ProviderPoolConfig } from "./key-pool.js";
|
|
2
3
|
export type RegistryChangeCallback = () => void;
|
|
3
4
|
export type ReasoningMode = "none" | "adaptive" | "collapsed" | "effort";
|
|
4
|
-
export type ModelPurpose
|
|
5
|
+
export { MODEL_PURPOSES, type ModelPurpose };
|
|
5
6
|
export interface ModelInfo {
|
|
6
7
|
id: string;
|
|
7
8
|
name?: string;
|
|
@@ -97,6 +98,7 @@ export interface ResolvedModel {
|
|
|
97
98
|
baseUrl?: string;
|
|
98
99
|
keyHandle: KeyHandle;
|
|
99
100
|
}
|
|
101
|
+
/** @deprecated Use MODEL_PURPOSES; retained as a compatibility alias. */
|
|
100
102
|
export declare const ALL_PURPOSES: ModelPurpose[];
|
|
101
103
|
export declare class ModelRegistry {
|
|
102
104
|
private keyPool;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Business mutations choose gateway X7 when negotiated, otherwise the standalone local store. */
|
|
2
|
+
import type { ProjectInfo, ProjectType } from "../../protocol/methods.js";
|
|
3
|
+
export declare function createProjectAuthoritative(params: {
|
|
4
|
+
name: string;
|
|
5
|
+
workspaceDir?: string;
|
|
6
|
+
type?: ProjectType;
|
|
7
|
+
groupId?: string;
|
|
8
|
+
skipAutoSwitch?: boolean;
|
|
9
|
+
}): Promise<ProjectInfo>;
|
|
10
|
+
export declare function updateProjectAuthoritative(projectId: string, patch: Partial<Pick<ProjectInfo, "planStatus" | "planAgents" | "planWinnerId" | "leaderSessionId" | "primaryWorkflowId">>): Promise<ProjectInfo | null>;
|
|
11
|
+
export declare function switchProjectAuthoritative(projectIdOrQuery: string): Promise<ProjectInfo | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** In-memory ExtHost-style project proxy. Durable registry bytes remain gateway-owned. */
|
|
2
|
+
import type { HostProjectInfo, HostProjectSnapshotResult } from "../../host-contract/index.js";
|
|
3
|
+
import type { HostProjectClient } from "../../transport/host-project-client.js";
|
|
4
|
+
export declare function configureHostProjectAuthority(resolver: () => HostProjectClient | undefined): void;
|
|
5
|
+
export declare function hasHostProjectAuthority(): boolean;
|
|
6
|
+
export declare function hydrateHostProjectSnapshot(): Promise<void>;
|
|
7
|
+
export declare function readHostProjectSnapshot(): HostProjectSnapshotResult | undefined;
|
|
8
|
+
export declare function createHostProject(params: Parameters<HostProjectClient["create"]>[0]): Promise<HostProjectInfo>;
|
|
9
|
+
export declare function switchHostProject(projectIdOrQuery: string): Promise<HostProjectInfo>;
|
|
10
|
+
export declare function updateHostProject(projectId: string, patch: Parameters<HostProjectClient["update"]>[1]): Promise<HostProjectInfo>;
|
|
@@ -64,7 +64,8 @@ export interface MemoryToolLocalProvider {
|
|
|
64
64
|
category?: string;
|
|
65
65
|
importance?: number;
|
|
66
66
|
}): Promise<unknown>;
|
|
67
|
-
|
|
67
|
+
/** B3(X7)异步化:16 面 host-state proxy 方法(host 模式经 x/host.request 跨进程)。 */
|
|
68
|
+
synthesizeTimeline(userId: string, startMs: number, endMs: number): Promise<string>;
|
|
68
69
|
feedback(ids: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<{
|
|
69
70
|
affected: number;
|
|
70
71
|
}>;
|
|
@@ -124,8 +125,10 @@ export interface MemoryUpdatePatch {
|
|
|
124
125
|
tags?: string[];
|
|
125
126
|
}
|
|
126
127
|
export interface MemoryHandlerProvider extends MemoryProvider {
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
/** B3(X7)异步化:16 面 host-state proxy 方法(host 模式经 x/host.request 跨进程)。 */
|
|
129
|
+
getAtlas?(userId: string, options?: Record<string, unknown>): Promise<MemoryAtlasResult>;
|
|
130
|
+
/** B3(X7)异步化:16 面 host-state proxy 方法。 */
|
|
131
|
+
getActivitySummary?(userId: string, days: number): Promise<MemoryActivitySummary>;
|
|
129
132
|
observeExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
130
133
|
proposeExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
131
134
|
ingestExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
@@ -188,11 +191,12 @@ export interface MemoryDreamProvider {
|
|
|
188
191
|
feedback?(memoryIds: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong"): Promise<{
|
|
189
192
|
affected: number;
|
|
190
193
|
}>;
|
|
191
|
-
|
|
192
|
-
|
|
194
|
+
/** B3(X7)异步化:以下四个 16 面 host-state proxy 方法签名统一 Promise(host 模式经 x/host.request 跨进程)。 */
|
|
195
|
+
getActivitySummary?(userId: string, days?: number): Promise<MemoryActivitySummary>;
|
|
196
|
+
synthesizeTimeline?(userId: string, startMs: number, endMs: number): Promise<string>;
|
|
193
197
|
getProfile?(userId: string, key: string): string | null;
|
|
194
|
-
setProfile?(userId: string, key: string, value: string): void
|
|
195
|
-
getAllProfiles?(userId: string): Record<string, string
|
|
198
|
+
setProfile?(userId: string, key: string, value: string): Promise<void>;
|
|
199
|
+
getAllProfiles?(userId: string): Promise<Record<string, string>>;
|
|
196
200
|
}
|
|
197
201
|
export interface MemoryDecayProvider {
|
|
198
202
|
triggerDecay(userId: string): Promise<{
|
|
@@ -67,6 +67,8 @@ export interface ToolBootstrapConfig {
|
|
|
67
67
|
getCurrentTurnId?(): string | undefined;
|
|
68
68
|
sendNotification?(method: string, params: Record<string, unknown>): void;
|
|
69
69
|
onExecProgress?(progress: ToolBootstrapProgress): void;
|
|
70
|
+
/** Lazy host-owned tunable overrides; web registration must not call it until first invoke. */
|
|
71
|
+
loadTunableOverrides?(): Promise<Record<string, unknown>>;
|
|
70
72
|
}
|
|
71
73
|
export interface ToolBootstrap {
|
|
72
74
|
getAllBaseTools(config?: ToolBootstrapConfig): RuntimeToolContract[];
|
|
@@ -11,8 +11,8 @@ export interface ToolNameLike {
|
|
|
11
11
|
}
|
|
12
12
|
export interface FreshWorkspaceEvidencePolicy {
|
|
13
13
|
requiresFreshTool: boolean;
|
|
14
|
-
reason?: "file-read" | "memory-mutation" | "media-generation" | "directory-list" | "content-search" | "shell" | "web";
|
|
15
|
-
mediaKind?: "image" | "tts" | "music";
|
|
14
|
+
reason?: "file-read" | "memory-mutation" | "media-generation" | "media-understanding" | "directory-list" | "content-search" | "shell" | "web";
|
|
15
|
+
mediaKind?: "image" | "video" | "tts" | "music";
|
|
16
16
|
allowedToolNames: string[];
|
|
17
17
|
}
|
|
18
18
|
export declare function getFreshWorkspaceEvidencePolicy(messages: readonly PromptMessageLike[] | string): FreshWorkspaceEvidencePolicy;
|
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Session persistence authority facade.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* - session-resume.ts: resume assembly
|
|
8
|
-
* - session-catalog.ts: list/delete/prune
|
|
9
|
-
* - session-summary.ts: title and task-summary generation
|
|
4
|
+
* When gateway advertises Session X7, durable reads/writes go through HostSessionClient. Without
|
|
5
|
+
* that capability (gate-off/tests/standalone), the legacy local implementation remains the inert
|
|
6
|
+
* compatibility path. A single call never writes both stores.
|
|
10
7
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
9
|
+
import type { HostSessionClient } from "../../transport/host-session-client.js";
|
|
10
|
+
import { type AppendMessageOutcome } from "./session-transcript-store.js";
|
|
11
|
+
import { getSessionMetadata, readSessionMetadata } from "./session-metadata-store.js";
|
|
12
|
+
import type { MessageDisplayMetadata, PersistedSession, SessionMetadataPatch, SessionStateSaveMetadata, SessionUsageSnapshot, TokenUsage } from "./session-types.js";
|
|
13
|
+
export declare function configureHostSessionPersistence(resolver: () => HostSessionClient | undefined): void;
|
|
14
|
+
export declare function isHostSessionPersistenceActive(): boolean;
|
|
15
|
+
export declare function requestHostGroupSplit(sessionId: string, operationId: string, reason: "idle" | "turn-limit", cas?: {
|
|
16
|
+
expectedLastActiveAt?: string;
|
|
17
|
+
expectedTurnCount?: number;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
status: "updated" | "duplicate" | "session-deleted";
|
|
20
|
+
nextSessionId?: string;
|
|
21
|
+
} | undefined>;
|
|
22
|
+
export declare function appendMessage(sessionId: string, message: ChatMessage, projectRoot: string, turnId?: string, metadata?: {
|
|
23
|
+
usage?: TokenUsage;
|
|
24
|
+
displayMetadata?: MessageDisplayMetadata;
|
|
25
|
+
}): Promise<AppendMessageOutcome>;
|
|
26
|
+
export declare function waitForSessionPersistenceAppends(sessionId: string, projectRoot: string): Promise<void>;
|
|
27
|
+
export declare function loadSessionForResume(sessionId: string, projectRoot: string, options?: {
|
|
28
|
+
includeDisplayMetadata?: boolean;
|
|
29
|
+
}): Promise<PersistedSession | null>;
|
|
30
|
+
export declare function saveSessionState(sessionId: string, usageSnapshot: SessionUsageSnapshot, metadata: SessionStateSaveMetadata, projectRoot: string): Promise<void>;
|
|
31
|
+
export declare function updateSessionMetadata(sessionId: string, patch: SessionMetadataPatch, projectRoot: string): Promise<import("./session-types.js").SessionMetadata | null>;
|
|
32
|
+
export { getSessionMetadata, readSessionMetadata };
|
|
14
33
|
export { collectAdoptedNativeIds, deleteSession, listSessions, pruneOldSessions } from "./session-catalog.js";
|
|
15
34
|
export { generateSessionTitle, maybeGenerateTaskSummary, shouldGenerateTaskSummary, } from "./session-summary.js";
|
|
16
35
|
export { SESSION_SCHEMA_VERSION, type MessageDisplayMetadata, type PersistedChatMessage, type PersistedSession, type SessionListEntry, type SessionMetadata, type TaskSummaryDeps, } from "./session-types.js";
|
|
@@ -38,6 +38,8 @@ export declare function enumerateSessionMetadataFiles(): Promise<SessionMetaLoca
|
|
|
38
38
|
* 直接原子改写 metadata.json(不经 updateSessionMetadata 的 projectRoot 解析)。返回清理数。
|
|
39
39
|
*/
|
|
40
40
|
export declare function clearAllInflightMarkers(): Promise<number>;
|
|
41
|
+
/** 读同目录 transcript.jsonl 最后一条 assistant 消息的 ts(毫秒)。无则 null。 */
|
|
42
|
+
declare function readLastAssistantTs(metadataPath: string): Promise<number | null>;
|
|
41
43
|
export interface CrashedTurnInfo {
|
|
42
44
|
sessionId: string;
|
|
43
45
|
turnId: string;
|
|
@@ -55,4 +57,6 @@ export interface CrashedTurnInfo {
|
|
|
55
57
|
* - 否则:保留标记 + 递增中断计数,收进待恢复列表(交给 UI 让用户手动续)。
|
|
56
58
|
*/
|
|
57
59
|
export declare function scanForCrashedTurns(): Promise<CrashedTurnInfo[]>;
|
|
60
|
+
/** Test-only escape hatch: readLastAssistantTs is otherwise module-private (Cut 5.2). */
|
|
61
|
+
export declare const __test_readLastAssistantTs: typeof readLastAssistantTs;
|
|
58
62
|
export {};
|
|
@@ -2,4 +2,6 @@ import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
|
2
2
|
import type { SessionMetadata, TaskSummaryDeps } from "./session-types.js";
|
|
3
3
|
export declare function shouldGenerateTaskSummary(metadata: SessionMetadata): boolean;
|
|
4
4
|
export declare function generateSessionTitle(userMessage: string, deps: TaskSummaryDeps): Promise<string | null>;
|
|
5
|
-
export declare function maybeGenerateTaskSummary(sessionId: string, metadata: SessionMetadata, recentMessages: ChatMessage[], deps: TaskSummaryDeps, projectRoot: string): Promise<string | null>;
|
|
5
|
+
export declare function maybeGenerateTaskSummary(sessionId: string, metadata: SessionMetadata, recentMessages: ChatMessage[], deps: TaskSummaryDeps, projectRoot: string, persist?: (summary: string, generatedAtTurn: number) => Promise<void>): Promise<string | null>;
|
|
6
|
+
declare function buildDigestContext(recentMessages: ChatMessage[]): string;
|
|
7
|
+
export { buildDigestContext as __test_buildDigestContext };
|
|
@@ -17,6 +17,13 @@ export declare function appendMessage(sessionId: string, message: ChatMessage, p
|
|
|
17
17
|
usage?: TokenUsage;
|
|
18
18
|
displayMetadata?: MessageDisplayMetadata;
|
|
19
19
|
}): Promise<AppendMessageOutcome>;
|
|
20
|
+
/**
|
|
21
|
+
* Public drain: await all queued transcript appends for one session to hit disk. Wraps the
|
|
22
|
+
* composite-key `waitForTranscriptAppends` (the queue is keyed by projectRoot+sessionId, not
|
|
23
|
+
* sessionId alone). Call before a process kill / cold-restart test — reading the file does NOT
|
|
24
|
+
* flush a same-process fire-and-forget tail (Cut 8).
|
|
25
|
+
*/
|
|
26
|
+
export declare function waitForSessionTranscriptAppends(sessionId: string, projectRoot: string): Promise<void>;
|
|
20
27
|
export declare function countTranscriptMessages(sessionId: string, projectRoot: string): Promise<number | null>;
|
|
21
28
|
export declare function loadTranscript(sessionId: string, projectRoot: string, options?: {
|
|
22
29
|
includeDisplayMetadata?: boolean;
|