@eddyskywalker/dsh-chatgpt-subscription 0.99.1 → 1.0.0
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 +2 -1
- package/lib/client.js +1562 -578
- package/lib/client.js.map +1 -1
- package/lib/codemode.js +1 -1
- package/lib/index.js +3318 -904
- package/lib/{preset-sync-CF9xlG1l.js → preset-sync-DWOAwSyl.js} +5 -4
- package/lib/reverse-board.js +1726 -0
- package/lib/{tool-result-pruner-Ds--y6hJ.js → tool-result-pruner-C6CDvZtG.js} +2 -1
- package/lib/tool-result-pruner.js +1 -1
- package/lib/types/client/common/ModelChecklist.d.ts +3 -3
- package/lib/types/client/common/ModelChecklist.d.ts.map +1 -1
- package/lib/types/client/common/format.d.ts +10 -0
- package/lib/types/client/common/format.d.ts.map +1 -1
- package/lib/types/client/features/progress-updates/locales.d.ts +8 -2
- package/lib/types/client/features/progress-updates/locales.d.ts.map +1 -1
- package/lib/types/client/features/progress-updates/settings-binding.d.ts +3 -1
- package/lib/types/client/features/progress-updates/settings-binding.d.ts.map +1 -1
- package/lib/types/client/features/progress-updates/settings-section.d.ts +2 -0
- package/lib/types/client/features/progress-updates/settings-section.d.ts.map +1 -1
- package/lib/types/client/hub/brand-icons.d.ts +1 -1
- package/lib/types/client/hub/brand-icons.d.ts.map +1 -1
- package/lib/types/client/hub/providers.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locales-ru/claude-api.d.ts.map +1 -1
- package/lib/types/client/locales-ru/claude.d.ts.map +1 -1
- package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
- package/lib/types/client/locales-ru/index.d.ts.map +1 -1
- package/lib/types/client/locales-ru/kimi-code.d.ts.map +1 -1
- package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
- package/lib/types/client/locales-ru/sub2api.d.ts +3 -0
- package/lib/types/client/locales-ru/sub2api.d.ts.map +1 -0
- package/lib/types/client/providers/claude/ClaudeSection.d.ts.map +1 -1
- package/lib/types/client/providers/claude/locales.d.ts +8 -2
- package/lib/types/client/providers/claude/locales.d.ts.map +1 -1
- package/lib/types/client/providers/claude/useClaudeSection.d.ts +1 -0
- package/lib/types/client/providers/claude/useClaudeSection.d.ts.map +1 -1
- package/lib/types/client/providers/claude-api/ClaudeApiSection.d.ts.map +1 -1
- package/lib/types/client/providers/claude-api/locales.d.ts +5 -1
- package/lib/types/client/providers/claude-api/locales.d.ts.map +1 -1
- package/lib/types/client/providers/claude-api/useClaudeApiSection.d.ts +1 -0
- package/lib/types/client/providers/claude-api/useClaudeApiSection.d.ts.map +1 -1
- package/lib/types/client/providers/codex-chatgpt/CodexSubscriptionSection.d.ts.map +1 -1
- package/lib/types/client/providers/codex-chatgpt/locales.d.ts +5 -3
- package/lib/types/client/providers/codex-chatgpt/locales.d.ts.map +1 -1
- package/lib/types/client/providers/codex-chatgpt/styles.d.ts.map +1 -1
- package/lib/types/client/providers/command-code/CommandCodeSection.d.ts.map +1 -1
- package/lib/types/client/providers/command-code/locales.d.ts +2 -2
- package/lib/types/client/providers/glm-coding-plan/GlmCodingPlanSection.d.ts.map +1 -1
- package/lib/types/client/providers/kimi-code/KimiCodeSection.d.ts.map +1 -1
- package/lib/types/client/providers/kimi-code/locales.d.ts +8 -2
- package/lib/types/client/providers/kimi-code/locales.d.ts.map +1 -1
- package/lib/types/client/providers/minimax-code/MinimaxCodeSection.d.ts.map +1 -1
- package/lib/types/client/providers/opencode-zen/useZenSection.d.ts +1 -0
- package/lib/types/client/providers/opencode-zen/useZenSection.d.ts.map +1 -1
- package/lib/types/client/providers/relayone/locales.d.ts +12 -12
- package/lib/types/client/providers/step-code/StepCodeSection.d.ts.map +1 -1
- package/lib/types/client/providers/sub2api/Sub2ApiSection.d.ts +7 -0
- package/lib/types/client/providers/sub2api/Sub2ApiSection.d.ts.map +1 -0
- package/lib/types/client/providers/sub2api/locales.d.ts +212 -0
- package/lib/types/client/providers/sub2api/locales.d.ts.map +1 -0
- package/lib/types/client/providers/sub2api/styles.d.ts +3 -0
- package/lib/types/client/providers/sub2api/styles.d.ts.map +1 -0
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/compat.d.ts.map +1 -1
- package/lib/types/entries/reverse-board.d.ts +6 -0
- package/lib/types/entries/reverse-board.d.ts.map +1 -0
- package/lib/types/entries/tool-result-pruner.d.ts.map +1 -1
- package/lib/types/host/common/i18n/zh.d.ts +1 -1
- package/lib/types/host/common/model-request-control.d.ts +1 -1
- package/lib/types/host/common/model-request-control.d.ts.map +1 -1
- package/lib/types/host/common/prompt-cache-policy.d.ts.map +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts +1 -1
- package/lib/types/host/common/request-diagnostics.d.ts.map +1 -1
- package/lib/types/host/providers/claude/routes.d.ts.map +1 -1
- package/lib/types/host/providers/claude/token-store.d.ts +3 -0
- package/lib/types/host/providers/claude/token-store.d.ts.map +1 -1
- package/lib/types/host/providers/claude-api/routes.d.ts.map +1 -1
- package/lib/types/host/providers/claude-api/token-store.d.ts +3 -0
- package/lib/types/host/providers/claude-api/token-store.d.ts.map +1 -1
- package/lib/types/host/providers/kimi-code/cache-wait.d.ts +12 -0
- package/lib/types/host/providers/kimi-code/cache-wait.d.ts.map +1 -1
- package/lib/types/host/providers/kimi-code/routes.d.ts.map +1 -1
- package/lib/types/host/providers/kimi-code/token-store.d.ts +4 -0
- package/lib/types/host/providers/kimi-code/token-store.d.ts.map +1 -1
- package/lib/types/host/providers/relayone/types.d.ts +1 -1
- package/lib/types/host/providers/relayone/types.d.ts.map +1 -1
- package/lib/types/host/providers/sub2api/account-pool.d.ts +34 -0
- package/lib/types/host/providers/sub2api/account-pool.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/adapter.d.ts +59 -0
- package/lib/types/host/providers/sub2api/adapter.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/cache-stats.d.ts +19 -0
- package/lib/types/host/providers/sub2api/cache-stats.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/client.d.ts +6 -0
- package/lib/types/host/providers/sub2api/client.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/mapper-gemini.d.ts +10 -0
- package/lib/types/host/providers/sub2api/mapper-gemini.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/mapper-messages.d.ts +14 -0
- package/lib/types/host/providers/sub2api/mapper-messages.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/mapper-responses.d.ts +7 -0
- package/lib/types/host/providers/sub2api/mapper-responses.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/mapper.d.ts +34 -0
- package/lib/types/host/providers/sub2api/mapper.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/model-catalog.d.ts +72 -0
- package/lib/types/host/providers/sub2api/model-catalog.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/remote-compaction.d.ts +32 -0
- package/lib/types/host/providers/sub2api/remote-compaction.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/routes.d.ts +16 -0
- package/lib/types/host/providers/sub2api/routes.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/token-store.d.ts +43 -0
- package/lib/types/host/providers/sub2api/token-store.d.ts.map +1 -0
- package/lib/types/host/providers/sub2api/types.d.ts +14 -0
- package/lib/types/host/providers/sub2api/types.d.ts.map +1 -0
- package/lib/types/host/runtime/compact-after-turn/index.d.ts +15 -0
- package/lib/types/host/runtime/compact-after-turn/index.d.ts.map +1 -1
- package/lib/types/host/runtime/compaction-gate.d.ts +67 -0
- package/lib/types/host/runtime/compaction-gate.d.ts.map +1 -0
- package/lib/types/host/runtime/guards/compaction-policy-guard.d.ts +1 -0
- package/lib/types/host/runtime/guards/compaction-policy-guard.d.ts.map +1 -1
- package/lib/types/host/runtime/guards/ptc-sdk-cache-guard.d.ts.map +1 -1
- package/lib/types/host/runtime/guards/timeline-cache-guard.d.ts.map +1 -1
- package/lib/types/host/runtime/presets/agent-preset.d.ts +10 -25
- package/lib/types/host/runtime/presets/agent-preset.d.ts.map +1 -1
- package/lib/types/host/runtime/presets/preset-sync.d.ts +2 -0
- package/lib/types/host/runtime/presets/preset-sync.d.ts.map +1 -1
- package/lib/types/host/runtime/presets/reverse-persona.d.ts +3 -0
- package/lib/types/host/runtime/presets/reverse-persona.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/frontier.d.ts +10 -0
- package/lib/types/host/runtime/reverse/frontier.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/ids.d.ts +8 -0
- package/lib/types/host/runtime/reverse/ids.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/index.d.ts +20 -0
- package/lib/types/host/runtime/reverse/index.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/indexer.d.ts +9 -0
- package/lib/types/host/runtime/reverse/indexer.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/policy.d.ts +5 -0
- package/lib/types/host/runtime/reverse/policy.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/route-policy.d.ts +10 -0
- package/lib/types/host/runtime/reverse/route-policy.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/store.d.ts +91 -0
- package/lib/types/host/runtime/reverse/store.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/templates.d.ts +10 -0
- package/lib/types/host/runtime/reverse/templates.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/tool.d.ts +25 -0
- package/lib/types/host/runtime/reverse/tool.d.ts.map +1 -0
- package/lib/types/host/runtime/reverse/types.d.ts +182 -0
- package/lib/types/host/runtime/reverse/types.d.ts.map +1 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/claude-api-contracts.d.ts +2 -0
- package/lib/types/shared/claude-api-contracts.d.ts.map +1 -1
- package/lib/types/shared/claude-contracts.d.ts +3 -0
- package/lib/types/shared/claude-contracts.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +1 -1
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/lib/types/shared/kimi-code-contracts.d.ts +3 -0
- package/lib/types/shared/kimi-code-contracts.d.ts.map +1 -1
- package/lib/types/shared/relayone-contracts.d.ts +2 -2
- package/lib/types/shared/relayone-contracts.d.ts.map +1 -1
- package/lib/types/shared/sub2api-contracts.d.ts +103 -0
- package/lib/types/shared/sub2api-contracts.d.ts.map +1 -0
- package/package.json +6 -2
- package/presets/reverse/README.md +30 -0
- package/presets/reverse/agent.cordis.yml +228 -0
- package/presets/reverse/preset.yml +3 -0
- package/presets/team/README.md +0 -72
- package/presets/team/agent.cordis.yml +0 -414
- package/presets/team/preset.yml +0 -3
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { catalogSnapshotPath } from '../../common/catalog-snapshot.ts';
|
|
2
|
+
import type { Sub2ApiCatalogDto, Sub2ApiModelDto } from '../../../shared/sub2api-contracts.ts';
|
|
3
|
+
import type { Sub2ApiSettings } from './token-store.ts';
|
|
4
|
+
export interface Sub2ApiModelEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
vendor: string | null;
|
|
8
|
+
contextWindow: number;
|
|
9
|
+
maxOutputTokens: number;
|
|
10
|
+
supportsImages: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Parse every listing shape Sub2API deployments use for `/v1/models`:
|
|
14
|
+
* OpenAI (`data[].id`), Anthropic (`data[].id` + `display_name`) and Gemini
|
|
15
|
+
* (`models[].name = "models/..."`). Capabilities are read only when the gateway
|
|
16
|
+
* actually sends them; nothing is guessed from a model name.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseSub2ApiModelListing(payload: unknown): Sub2ApiModelEntry[];
|
|
19
|
+
/**
|
|
20
|
+
* Read the group shape from a model listing. This is only a save-time default:
|
|
21
|
+
* an explicit account protocol always wins, and a shape we cannot name falls
|
|
22
|
+
* back to the Chat entry every deployment supports.
|
|
23
|
+
*/
|
|
24
|
+
export declare function detectSub2ApiProtocol(payload: unknown): 'responses' | 'messages' | 'gemini' | 'chat';
|
|
25
|
+
export declare function persistedSub2ApiModelEntries(entries: readonly Sub2ApiModelEntry[]): Sub2ApiModelEntry[];
|
|
26
|
+
export declare function parsePersistedSub2ApiModelEntries(value: unknown): Sub2ApiModelEntry[] | undefined;
|
|
27
|
+
export declare function resolveSub2ApiModel(entries: readonly Sub2ApiModelEntry[], id: string): Sub2ApiModelEntry | undefined;
|
|
28
|
+
export declare function sub2ApiModelOptions(entries: readonly Sub2ApiModelEntry[], settings: Sub2ApiSettings): Sub2ApiModelDto[];
|
|
29
|
+
export declare class Sub2ApiCatalogManager {
|
|
30
|
+
private scope;
|
|
31
|
+
private entries;
|
|
32
|
+
private fetchedAt;
|
|
33
|
+
private rehydrated;
|
|
34
|
+
private state;
|
|
35
|
+
private error;
|
|
36
|
+
private inFlight;
|
|
37
|
+
private readonly ttlMs;
|
|
38
|
+
constructor(ttlMs?: number);
|
|
39
|
+
snapshot(): {
|
|
40
|
+
entries: readonly Sub2ApiModelEntry[];
|
|
41
|
+
fetchedAt: number;
|
|
42
|
+
scope: string;
|
|
43
|
+
};
|
|
44
|
+
dto(): Sub2ApiCatalogDto;
|
|
45
|
+
fingerprint(): string;
|
|
46
|
+
reset(): void;
|
|
47
|
+
restore(scope: string): Promise<readonly Sub2ApiModelEntry[]>;
|
|
48
|
+
private rehydrate;
|
|
49
|
+
warm(target: {
|
|
50
|
+
accountId: string;
|
|
51
|
+
baseUrl: string;
|
|
52
|
+
apiKey: string;
|
|
53
|
+
}, fetchFn?: typeof fetch): Promise<readonly Sub2ApiModelEntry[]>;
|
|
54
|
+
startRefresh(target: {
|
|
55
|
+
accountId: string;
|
|
56
|
+
baseUrl: string;
|
|
57
|
+
apiKey: string;
|
|
58
|
+
}, fetchFn?: typeof fetch): void;
|
|
59
|
+
/** Refresh behind a status answer only when the cached listing is missing or stale. */
|
|
60
|
+
startWarm(target: {
|
|
61
|
+
accountId: string;
|
|
62
|
+
baseUrl: string;
|
|
63
|
+
apiKey: string;
|
|
64
|
+
}, fetchFn?: typeof fetch): void;
|
|
65
|
+
refresh(target: {
|
|
66
|
+
accountId: string;
|
|
67
|
+
baseUrl: string;
|
|
68
|
+
apiKey: string;
|
|
69
|
+
}, fetchFn?: typeof fetch): Promise<Sub2ApiModelEntry[]>;
|
|
70
|
+
}
|
|
71
|
+
export { catalogSnapshotPath };
|
|
72
|
+
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../../src/host/providers/sub2api/model-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,mBAAmB,EAA+C,MAAM,kCAAkC,CAAA;AACxI,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGvD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,OAAO,CAAA;CACxB;AAyBD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,EAAE,CAyB9E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAOpG;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAEvG;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,EAAE,GAAG,SAAS,CAoBjG;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,iBAA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C;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,GAAE,OAAO,KAAa,GAAG,IAAI;IAMxG,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,GAAE,OAAO,KAAa,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CA6B3I;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Message, StreamChunk } from '../../common/llm-compat.ts';
|
|
2
|
+
import { type CodexRemoteCompactionCheckpoint } from '../codex-chatgpt/codex-remote-compaction.ts';
|
|
3
|
+
/** An encrypted checkpoint is valid only for the key that minted it. */
|
|
4
|
+
export interface Sub2ApiRemoteCompactionCheckpoint extends CodexRemoteCompactionCheckpoint {
|
|
5
|
+
readonly scope: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function sub2ApiRemoteCompactionEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
8
|
+
/** Compaction is a GPT/Codex feature; other Responses models keep the full transcript. */
|
|
9
|
+
export declare function sub2ApiRemoteCompactionModel(model: string): boolean;
|
|
10
|
+
export declare function noteSub2ApiModelProtocol(model: string, protocol: string): void;
|
|
11
|
+
export declare function noteSub2ApiModelProtocols(models: readonly string[], protocol: string): void;
|
|
12
|
+
export declare function noteSub2ApiSessionProtocol(sessionId: string | undefined, model: string, protocol: string): void;
|
|
13
|
+
/** Whether ordinary pressure compaction should be left to the native Responses path. */
|
|
14
|
+
export declare function sub2ApiRemoteCompactionOwns(sessionId: string | undefined, model: string, env?: NodeJS.ProcessEnv): boolean;
|
|
15
|
+
export declare function noteSub2ApiRemoteCompactionResult(sessionId: string | undefined, model: string, supported: boolean): void;
|
|
16
|
+
/** Test seam; production state changes only through request outcomes. */
|
|
17
|
+
export declare function resetSub2ApiRemoteCompaction(): void;
|
|
18
|
+
export declare function shouldCompactSub2ApiPayload(payload: Record<string, unknown>, contextWindow: number, sessionId: string | undefined, model: string, env?: NodeJS.ProcessEnv): boolean;
|
|
19
|
+
export declare function withSub2ApiCompactionTrigger(payload: Record<string, unknown>): Record<string, unknown>;
|
|
20
|
+
export declare function projectFreshSub2ApiCompaction<T extends Record<string, unknown>>(payload: T, checkpoint: Sub2ApiRemoteCompactionCheckpoint): T;
|
|
21
|
+
export declare function sub2ApiCheckpointFromOutputItems(items: readonly unknown[], model: string, scope: string): Sub2ApiRemoteCompactionCheckpoint | null;
|
|
22
|
+
/** Latest compatible checkpoint in the durable DSH transcript. */
|
|
23
|
+
export declare function latestSub2ApiCompaction(messages: readonly Message[], model: string, scope: string): {
|
|
24
|
+
index: number;
|
|
25
|
+
checkpoint: Sub2ApiRemoteCompactionCheckpoint;
|
|
26
|
+
} | null;
|
|
27
|
+
export declare function sub2ApiCompactionReplayMetadata(checkpoint: Sub2ApiRemoteCompactionCheckpoint): Record<string, unknown>;
|
|
28
|
+
/** Preserve the key scope that the Codex parser's own metadata does not know about. */
|
|
29
|
+
export declare function withSub2ApiCompactionMetadata(chunk: StreamChunk, checkpoint: Sub2ApiRemoteCompactionCheckpoint): StreamChunk;
|
|
30
|
+
/** Only a definite protocol refusal disables remote attempts; transport failures stay retryable. */
|
|
31
|
+
export declare function isDefiniteSub2ApiCompactionFailure(error: unknown): boolean;
|
|
32
|
+
//# sourceMappingURL=remote-compaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-compaction.d.ts","sourceRoot":"","sources":["../../../../../src/host/providers/sub2api/remote-compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAOL,KAAK,+BAA+B,EACrC,MAAM,6CAA6C,CAAA;AAEpD,wEAAwE;AACxE,MAAM,WAAW,iC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B,6BAA6B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7E,OAAO,EAAE,CAAC,EACV,UAAU,EAAE,iCAAiC,GAC5C,CAAC,CAEH;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,iCAAiC,GAAG,IAAI,CAG1C;AAED,kEAAkE;AAClE,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,iCAAiC,CAAA;CAAE,GAAG,IAAI,CAazE;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,iCAAiC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtH;AAED,uFAAuF;AACvF,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,iCAAiC,GAC5C,WAAW,CAWb;AAED,oGAAoG;AACpG,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK1E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { type Sub2ApiStatusDto } from '../../../shared/sub2api-contracts.ts';
|
|
3
|
+
import type { Sub2ApiAccountPool } from './account-pool.ts';
|
|
4
|
+
import type { Sub2ApiCatalogManager } from './model-catalog.ts';
|
|
5
|
+
import { type Sub2ApiSettingsStore } from './token-store.ts';
|
|
6
|
+
export interface Sub2ApiRouteOptions {
|
|
7
|
+
fetchFn?: typeof fetch;
|
|
8
|
+
serving?: boolean | (() => boolean);
|
|
9
|
+
conflict?: string | null | (() => string | null);
|
|
10
|
+
}
|
|
11
|
+
/** Local-first status; a stale catalog refresh begins behind the answer. */
|
|
12
|
+
export declare function getSub2ApiWebStatus(pool: Sub2ApiAccountPool, settingsStore: Sub2ApiSettingsStore, catalog: Sub2ApiCatalogManager, options?: Sub2ApiRouteOptions): Promise<Sub2ApiStatusDto>;
|
|
13
|
+
export declare function registerSub2ApiRoutes(ctx: Context, pool: Sub2ApiAccountPool, settingsStore: Sub2ApiSettingsStore, catalog: Sub2ApiCatalogManager, options?: Sub2ApiRouteOptions): () => void;
|
|
14
|
+
/** Startup warm-up is deliberately fire-and-forget in the plugin entry. */
|
|
15
|
+
export declare function warmSub2ApiCatalogOnStartup(pool: Sub2ApiAccountPool, catalog: Sub2ApiCatalogManager, fetchFn?: typeof fetch): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/host/providers/sub2api/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,OAAO,EAAuD,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAiCjH,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAA;CACjD;AAWD,4EAA4E;AAC5E,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,kBAAkB,EACxB,aAAa,EAAE,oBAAoB,EACnC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,gBAAgB,CAAC,CAwB3B;AA6BD,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,kBAAkB,EACxB,aAAa,EAAE,oBAAoB,EACnC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,mBAAwB,GAChC,MAAM,IAAI,CAuHZ;AAED,2EAA2E;AAC3E,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,GAAE,OAAO,KAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxJ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ContextWindowOverridePatch } from '../../common/context-window-overrides.ts';
|
|
2
|
+
import type { Sub2ApiProtocol, Sub2ApiResolvedProtocol, Sub2ApiSettingsUpdateDto } from '../../../shared/sub2api-contracts.ts';
|
|
3
|
+
export interface Sub2ApiCredentials {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
authenticatedAt: number;
|
|
6
|
+
/** Selected mode; old rows default to chat, which is what they were using. */
|
|
7
|
+
protocol: Sub2ApiProtocol;
|
|
8
|
+
/** Effective native protocol when the selected mode is `auto`. */
|
|
9
|
+
resolvedProtocol: Sub2ApiResolvedProtocol | null;
|
|
10
|
+
}
|
|
11
|
+
export interface Sub2ApiPoolCredentials extends Sub2ApiCredentials {
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Sub2ApiSettings {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
/** null = every currently listed model; [] = explicitly none. */
|
|
17
|
+
enabledModelIds: string[] | null;
|
|
18
|
+
contextWindowOverrides: Record<string, number>;
|
|
19
|
+
}
|
|
20
|
+
export interface Sub2ApiSettingsPatch {
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
enabledModelIds?: string[];
|
|
23
|
+
contextWindowOverrides?: ContextWindowOverridePatch;
|
|
24
|
+
}
|
|
25
|
+
export declare function parseSub2ApiCredentials(value: unknown): Sub2ApiCredentials;
|
|
26
|
+
export declare function normalizeSub2ApiProtocol(value: unknown): Sub2ApiProtocol;
|
|
27
|
+
export declare function normalizeSub2ApiResolvedProtocol(value: unknown): Sub2ApiResolvedProtocol | null;
|
|
28
|
+
export declare function sub2ApiEffectiveProtocol(credentials: Pick<Sub2ApiCredentials, 'protocol' | 'resolvedProtocol'>): Sub2ApiResolvedProtocol;
|
|
29
|
+
/** Pool identity is the key AND the deployment it is used against. */
|
|
30
|
+
export declare function sub2ApiCredentialFingerprint(credentials: Sub2ApiPoolCredentials): string;
|
|
31
|
+
export declare function defaultSub2ApiSettings(): Sub2ApiSettings;
|
|
32
|
+
export declare function parseSub2ApiSettings(value: unknown): Sub2ApiSettings;
|
|
33
|
+
export declare function mergeSub2ApiSettings(current: Sub2ApiSettings, patch: Sub2ApiSettingsPatch): Sub2ApiSettings;
|
|
34
|
+
export declare function sub2ApiSettingsPath(): string;
|
|
35
|
+
export declare class Sub2ApiSettingsStore {
|
|
36
|
+
private readonly filePath;
|
|
37
|
+
constructor(filePath?: string);
|
|
38
|
+
path(): string;
|
|
39
|
+
read(): Promise<Sub2ApiSettings>;
|
|
40
|
+
write(settings: Sub2ApiSettings): Promise<void>;
|
|
41
|
+
update(patch: Sub2ApiSettingsPatch | Sub2ApiSettingsUpdateDto): Promise<Sub2ApiSettings>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=token-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-store.d.ts","sourceRoot":"","sources":["../../../../../src/host/providers/sub2api/token-store.ts"],"names":[],"mappings":"AAKA,OAAO,EAA+B,KAAK,0BAA0B,EAAE,MAAM,0CAA0C,CAAA;AACvH,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AAG9H,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MA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;IACnB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,GAAE,MAA8B;IACrE,IAAI,IAAI,MAAM;IACR,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAIhC,KAAK,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAc/C,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;CAO/F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PROVIDER_ID = "sub2api";
|
|
2
|
+
export declare const PROVIDER_NAME = "Sub2API";
|
|
3
|
+
export declare const SUB2API_DEFAULT_ORIGIN = "http://127.0.0.1:8080";
|
|
4
|
+
/** Paths documented by the Sub2API gateway; `/v1` is part of each path, not the account URL. */
|
|
5
|
+
export declare const SUB2API_MODELS_PATH = "/v1/models";
|
|
6
|
+
export declare const SUB2API_CHAT_PATH = "/v1/chat/completions";
|
|
7
|
+
export declare const SUB2API_USER_AGENT = "dsh-sub2api/1.0.0";
|
|
8
|
+
export declare const SUB2API_CATALOG_TTL_MS: number;
|
|
9
|
+
export declare const SUB2API_COOLDOWN_MS = 60000;
|
|
10
|
+
export declare const SUB2API_MAX_REQUEST_IMAGE_BYTES: number;
|
|
11
|
+
/** Remove a credential echoed by an upstream error before it reaches a DTO or a log. */
|
|
12
|
+
export declare function sub2ApiSafeDetail(value: unknown, apiKey?: string, limit?: number): string;
|
|
13
|
+
export declare function sub2ApiHeaders(apiKey: string, json?: boolean): Record<string, string>;
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/host/providers/sub2api/types.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,YAAsB,CAAA;AAC9C,eAAO,MAAM,aAAa,YAAwB,CAAA;AAClD,eAAO,MAAM,sBAAsB,0BAA2B,CAAA;AAE9D,gGAAgG;AAChG,eAAO,MAAM,mBAAmB,eAAe,CAAA;AAC/C,eAAO,MAAM,iBAAiB,yBAAyB,CAAA;AAEvD,eAAO,MAAM,kBAAkB,sBAAsB,CAAA;AACrD,eAAO,MAAM,sBAAsB,QAAa,CAAA;AAChD,eAAO,MAAM,mBAAmB,QAAS,CAAA;AACzC,eAAO,MAAM,+BAA+B,QAAmB,CAAA;AAE/D,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,SAAO,GAAG,MAAM,CAGvF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,UAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOlF"}
|
|
@@ -74,6 +74,12 @@ export declare class CompactAfterTurnController {
|
|
|
74
74
|
private readonly sessions;
|
|
75
75
|
/** The latest agent seen per session; its scope is where the engine lives. */
|
|
76
76
|
private readonly agents;
|
|
77
|
+
/**
|
|
78
|
+
* Latest `agent/status` per session, kept outside {@link SessionState} because
|
|
79
|
+
* the state is pruned as soon as it carries nothing, while a drained delegation
|
|
80
|
+
* batch still needs to know whether the agent is idle right now.
|
|
81
|
+
*/
|
|
82
|
+
private readonly statusById;
|
|
77
83
|
private readonly now;
|
|
78
84
|
private readonly defer;
|
|
79
85
|
private disposed;
|
|
@@ -95,6 +101,13 @@ export declare class CompactAfterTurnController {
|
|
|
95
101
|
} | undefined, event: CompactAfterTurnEvent | undefined): void;
|
|
96
102
|
/** `agent/status` listener: an armed session (or eligible automatic child) that just went idle compacts once. */
|
|
97
103
|
onStatus(agent: CompactAfterTurnAgent | undefined, status: unknown): void;
|
|
104
|
+
/**
|
|
105
|
+
* External trigger: every delegated child and background job of this session
|
|
106
|
+
* has settled, so the wait-time keepalive no longer applies. The session
|
|
107
|
+
* compacts once at its next idle, or straight away when it already is.
|
|
108
|
+
* @param sessionId - the session whose delegation batch just drained.
|
|
109
|
+
*/
|
|
110
|
+
requestTaskComplete(sessionId: string): void;
|
|
98
111
|
/** `agent/disposed` listener: a compaction must not outlive its agent. */
|
|
99
112
|
onDisposed(agent: CompactAfterTurnAgent | undefined): void;
|
|
100
113
|
dispose(): void;
|
|
@@ -128,6 +141,8 @@ export interface CompactAfterTurnOptions {
|
|
|
128
141
|
* plain `get`, so the entry point tracks it and hands it over here.
|
|
129
142
|
*/
|
|
130
143
|
readonly engine?: () => unknown;
|
|
144
|
+
/** Handed the live controller, so a sibling subsystem can raise the task-complete trigger. */
|
|
145
|
+
readonly onController?: (controller: CompactAfterTurnController) => void;
|
|
131
146
|
}
|
|
132
147
|
/** Install the listeners and the route; returns the disposer (undefined on a Host without an event bus). */
|
|
133
148
|
export declare function installCompactAfterTurn(host: CompactAfterTurnHost, options?: CompactAfterTurnOptions): (() => void) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/compact-after-turn/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAChE,OAAO,EAEL,KAAK,yBAAyB,EAG9B,KAAK,wBAAwB,EAC9B,MAAM,uCAAuC,CAAA;AAO9C,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;IAC3D,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM;QAAE,MAAM,CAAC,EAAE;YAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE,GAAG,SAAS,CAAA;KAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAAA;CACzG;AAED,MAAM,WAAW,qBA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6B,CAAC,UAAU,EAAE,0BAA0B,aAC3D,eAAe,YAAY,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC,CA0BjF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 「全部任务完成后压缩」的判定。
|
|
3
|
+
*
|
|
4
|
+
* 一个纯函数,运行时只负责把事实喂进来:开关、阈值、还有没有委托任务在跑、
|
|
5
|
+
* 主对话上次写入的缓存档。把它做成纯函数是为了让三条口径能各自被测试到,
|
|
6
|
+
* 而不是埋在事件监听里要靠真机验证。
|
|
7
|
+
*
|
|
8
|
+
* 两条口径来自用户:
|
|
9
|
+
* - **全部任务完成** = 自动续热不再生效,即该会话没有在跑的子代理或后台任务;
|
|
10
|
+
* - **两条 Claude 线路**只在主对话 1 小时档(自动续热生效的那一档)上生效。
|
|
11
|
+
*
|
|
12
|
+
* 阈值 0 表示不限制;上下文长度未知时按「够得着」处理——开关是用户显式打开的,
|
|
13
|
+
* 缺一个测量值就静默失效比多压一次更难排查。
|
|
14
|
+
*
|
|
15
|
+
* @module dsh-chatgpt-subscription/host/compaction-gate
|
|
16
|
+
*/
|
|
17
|
+
/** 压缩阈值在插件 Config 里的字段名,与 `src/index.ts` 的 schema 逐字一致。 */
|
|
18
|
+
export declare const COMPACT_AFTER_TASKS_THRESHOLD_SETTING = "compactAfterTasksThreshold";
|
|
19
|
+
/** 阈值默认值:0 表示不限制。 */
|
|
20
|
+
export declare const COMPACT_AFTER_TASKS_THRESHOLD_DEFAULT = 0;
|
|
21
|
+
/** 迟滞值:volatile 字段在运行时是活引用。 */
|
|
22
|
+
interface ConfigRef<T> {
|
|
23
|
+
get(): T | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** 判定读到的配置切片。 */
|
|
26
|
+
export interface CompactGateConfigFields {
|
|
27
|
+
/** 压缩阈值;活引用或普通值。 */
|
|
28
|
+
compactAfterTasksThreshold?: number | ConfigRef<number> | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 读一次当前阈值。
|
|
32
|
+
* @param config - 插件配置(活引用或普通值)。
|
|
33
|
+
* @returns 正整数阈值,或 0(不限制)。
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveCompactThreshold(config?: CompactGateConfigFields): number;
|
|
36
|
+
/** 跳过原因;`undefined` 表示这次应当压缩。 */
|
|
37
|
+
export type CompactionSkipReason = 'off' | 'keepalive-pending' | 'other-tier' | 'below-threshold';
|
|
38
|
+
/** 判定需要的事实,全部由调用方观测而来。 */
|
|
39
|
+
export interface TaskCompleteFacts {
|
|
40
|
+
/** 该线路「全部任务完成后压缩」开关。 */
|
|
41
|
+
readonly enabled: boolean;
|
|
42
|
+
/** 压缩阈值;0 表示不限制。 */
|
|
43
|
+
readonly threshold: number;
|
|
44
|
+
/** 该会话还有在跑的子代理或后台任务(自动续热仍然生效)。 */
|
|
45
|
+
readonly pendingWork: boolean;
|
|
46
|
+
/** 主对话上一次请求的 prompt 规模(上下文长度)。 */
|
|
47
|
+
readonly contextTokens?: number | undefined;
|
|
48
|
+
/** 主对话上一次写入的缓存档;未记录时为 undefined。 */
|
|
49
|
+
readonly writtenTtlMs?: number | undefined;
|
|
50
|
+
/** 该线路自动续热所用的缓存档;线路没有续热时为 undefined。 */
|
|
51
|
+
readonly keepaliveTtlMs?: number | undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 上下文是否不到阈值。
|
|
55
|
+
* @param threshold - 阈值;0 表示不限制。
|
|
56
|
+
* @param contextTokens - 上下文长度;未知时按够得着处理。
|
|
57
|
+
* @returns 是否应当跳过。
|
|
58
|
+
*/
|
|
59
|
+
export declare function belowThreshold(threshold: number, contextTokens: number | undefined): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 主会话「全部任务完成后压缩」的判定。
|
|
62
|
+
* @param facts - 观测到的事实。
|
|
63
|
+
* @returns 跳过原因,或 undefined(压缩)。
|
|
64
|
+
*/
|
|
65
|
+
export declare function taskCompleteSkipReason(facts: TaskCompleteFacts): CompactionSkipReason | undefined;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=compaction-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction-gate.d.ts","sourceRoot":"","sources":["../../../../src/host/runtime/compaction-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,2DAA2D;AAC3D,eAAO,MAAM,qCAAqC,+BAA+B,CAAA;AAEjF,qBAAqB;AACrB,eAAO,MAAM,qCAAqC,IAAI,CAAA;AAEtD,+BAA+B;AAC/B,UAAU,SAAS,CAAC,CAAC;IACnB,GAAG,IAAI,CAAC,GAAG,SAAS,CAAA;CACrB;AAED,iBAAiB;AACjB,MAAM,WAAW,uBAAuB;IACtC,oBAAoB;IACpB,0BAA0B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CACpE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,uBAAuB,GAAG,MAAM,CAahF;AAED,iCAAiC;AACjC,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,CAAA;AAEjG,0BAA0B;AAC1B,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,oBAAoB;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,kCAAkC;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3C,oCAAoC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1C,wCAAwC;IACxC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE5F;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,GAAG,oBAAoB,GAAG,SAAS,CAQjG"}
|
|
@@ -5,6 +5,7 @@ export declare const KIMI_COMPACTION_PROVIDER = "kimi-code";
|
|
|
5
5
|
export declare const MINIMAX_COMPACTION_PROVIDER = "minimax-code";
|
|
6
6
|
export declare const CODEX_COMPACTION_PROVIDER = "codex-chatgpt";
|
|
7
7
|
export declare const RELAYONE_COMPACTION_PROVIDER = "relayone";
|
|
8
|
+
export declare const SUB2API_COMPACTION_PROVIDER = "sub2api";
|
|
8
9
|
/** 判定为 1M 长上下文档位的生效窗口阈值(>= 512K)。 */
|
|
9
10
|
export declare const KIMI_LONG_CONTEXT_WINDOW_THRESHOLD = 524288;
|
|
10
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-policy-guard.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/guards/compaction-policy-guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compaction-policy-guard.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/guards/compaction-policy-guard.ts"],"names":[],"mappings":"AAYA,oDAAoD;AACpD,eAAO,MAAM,uBAAuB,eAAe,CAAA;AAEnD,uBAAuB;AACvB,eAAO,MAAM,wBAAwB,cAAc,CAAA;AACnD,eAAO,MAAM,2BAA2B,iBAAiB,CAAA;AACzD,eAAO,MAAM,yBAAyB,kBAAkB,CAAA;AACxD,eAAO,MAAM,4BAA4B,aAAa,CAAA;AACtD,eAAO,MAAM,2BAA2B,YAAY,CAAA;AAEpD,qCAAqC;AACrC,eAAO,MAAM,kCAAkC,SAAU,CAAA;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,QAAQ,CAAA;AAEpD;;;;;;;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,+BAA+B,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"ptc-sdk-cache-guard.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/guards/ptc-sdk-cache-guard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,kCAAkC;AAClC,eAAO,MAAM,kBAAkB,cAAc,CAAA;AAE7C,qCAAqC;AACrC,eAAO,MAAM,qBAAqB,iBAAiB,CAAA;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,EAAE,SAAS,MAAM,EAiB3D,CAAA;AAEF,sBAAsB;AACtB,eAAO,MAAM,oBAAoB,cAAc,CAAA;AAE/C,YAAY;AACZ,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,OAAO,KAAK,OAAO,CAAA;CACnE;AAED,YAAY;AACZ,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,OAAO,IAAI,IAAI,CAAA;IACf;;;;;OAKG;IACH,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAA;CAC1C;AAsDD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA8CpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CAuNlB;AAmMD,eAAe,uBAAuB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-cache-guard.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/guards/timeline-cache-guard.ts"],"names":[],"mappings":"AAUA,wBAAwB;AACxB,eAAO,MAAM,gBAAgB,sBAAsB,CAAA;AAEnD,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"timeline-cache-guard.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/guards/timeline-cache-guard.ts"],"names":[],"mappings":"AAUA,wBAAwB;AACxB,eAAO,MAAM,gBAAgB,sBAAsB,CAAA;AAEnD,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,EAAE,SAAS,MAAM,EAiB5D,CAAA;AAEF,0BAA0B;AAC1B,eAAO,MAAM,2BAA2B,0BAA0B,CAAA;AAElE,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,0DAA0D;QAC1D,uBAAuB,EAAE;YAAE,IAAI,EAAE,uBAAuB,CAAA;SAAE,GAAG;YAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KACnG;CACF;AAED,eAAe;AACf,MAAM,WAAW,kBAAkB;IACjC,wBAAwB;IACxB,OAAO,IAAI,IAAI,CAAA;CAChB;AAED,YAAY;AACZ,MAAM,WAAW,yBAAyB;IACxC,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,OAAO,CAAA;IAChC,wEAAwE;IACxE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,OAAO,KAAK,OAAO,CAAA;CAC5E;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE;IAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GACnD,OAAO,CAET;AAgJD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE,yBAA8B,GACtC,kBAAkB,CA4UpB;AAED,eAAe,yBAAyB,CAAA"}
|
|
@@ -121,31 +121,16 @@ export type PresetInstall = 'registered' | 'legacy';
|
|
|
121
121
|
* for text the Loader evaluates, and nothing evaluates this.
|
|
122
122
|
*/
|
|
123
123
|
export declare const DISPATCH_PRESET: PresetDefinition;
|
|
124
|
-
/** The
|
|
125
|
-
export declare const
|
|
126
|
-
/** The model-facing half of the team domain, same generation. */
|
|
127
|
-
export declare const TEAM_BOARD_TOOL_PACKAGE = "@deepseek-ai/dsh-tool-agent-team";
|
|
128
|
-
/** The `team` (班组模式) preset id, and the directory `presets/team/` ships. */
|
|
129
|
-
export declare const TEAM_PRESET_ID = "team";
|
|
124
|
+
/** The reverse preset id, and the directory `presets/reverse/` ships. */
|
|
125
|
+
export declare const REVERSE_PRESET_ID = "reverse";
|
|
130
126
|
/**
|
|
131
|
-
* The
|
|
127
|
+
* The `reverse` (逆向模式) preset: a graph/frontier-driven reverse crew.
|
|
132
128
|
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* @returns the team persona prefix.
|
|
129
|
+
* It deliberately does not inherit the dispatch persona or the team topology.
|
|
130
|
+
* The only reverse-specific row is `reverse-board`, which exists only while this
|
|
131
|
+
* preset is mounted; src/index.ts never registers that tool globally.
|
|
137
132
|
*/
|
|
138
|
-
export declare
|
|
139
|
-
/**
|
|
140
|
-
* The `team` (班组模式) preset: identity from `presets/team/preset.yml`, rows and
|
|
141
|
-
* persona inherited from {@link DISPATCH_PRESET}.
|
|
142
|
-
*
|
|
143
|
-
* One row differs — the persona — and through {@link applyTeamDelta} only. The
|
|
144
|
-
* baseline is harness 0.2.1: the topology relies on `send_message` and
|
|
145
|
-
* `wait_agent` from the subagent-control row both presets already mount, and
|
|
146
|
-
* adds no package this plugin has to keep compatible.
|
|
147
|
-
*/
|
|
148
|
-
export declare const TEAM_PRESET: PresetDefinition;
|
|
133
|
+
export declare const REVERSE_PRESET: PresetDefinition;
|
|
149
134
|
/**
|
|
150
135
|
* Reconcile {@link DISPATCH_PRESET} with the running harness generation.
|
|
151
136
|
*
|
|
@@ -177,11 +162,11 @@ export declare const TEAM_PRESET: PresetDefinition;
|
|
|
177
162
|
*/
|
|
178
163
|
export declare function resolveDispatchPreset(resolves?: SpecifierResolver): PresetDefinition;
|
|
179
164
|
/**
|
|
180
|
-
* Reconcile {@link
|
|
165
|
+
* Reconcile {@link REVERSE_PRESET} with the running harness generation.
|
|
181
166
|
* @param resolves - whether a bare specifier resolves in this installation.
|
|
182
167
|
* @returns the preset definition for the running harness generation.
|
|
183
168
|
*/
|
|
184
|
-
export declare function
|
|
169
|
+
export declare function resolveReversePreset(resolves?: SpecifierResolver): PresetDefinition;
|
|
185
170
|
/**
|
|
186
171
|
* Declare `dispatch` to the running harness, when the harness has the mechanism.
|
|
187
172
|
*
|
|
@@ -206,5 +191,5 @@ export declare function installDispatchPreset(host: PresetHost, resolves?: Speci
|
|
|
206
191
|
* @param resolves - whether a bare specifier resolves in this installation.
|
|
207
192
|
* @returns `'registered'` when this call took the preset, `'legacy'` otherwise.
|
|
208
193
|
*/
|
|
209
|
-
export declare function
|
|
194
|
+
export declare function installReversePreset(host: PresetHost, resolves?: SpecifierResolver): PresetInstall;
|
|
210
195
|
//# sourceMappingURL=agent-preset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-preset.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/agent-preset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"agent-preset.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/agent-preset.ts"],"names":[],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a,CAErH;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,GAAE,iBAAoC,GAAG,aAAa,CAEpH"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import type { PresetHost, PresetInstall } from './agent-preset.ts';
|
|
7
7
|
/** The preset directory this package ships. */
|
|
8
8
|
export declare const BUNDLED_PRESET_IDS: readonly string[];
|
|
9
|
+
/** Previously bundled preset ids retired from the discovery root. */
|
|
10
|
+
export declare const RETIRED_PRESET_IDS: readonly string[];
|
|
9
11
|
/**
|
|
10
12
|
* Candidate directories where the running harness or profile packages reside.
|
|
11
13
|
* @param entryScript - harness CLI entry script, defaults to this process's.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-sync.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/preset-sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAElE,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"preset-sync.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/preset-sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAElE,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA4B,CAAA;AAE5E,qEAAqE;AACrE,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAa,CAAA;AAyF7D;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,GAAE,MAAM,GAAG,SAA2B,GAAG,MAAM,EAAE,CAyBjG;AAOD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,SAAS,MAA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3C;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AA0FD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa,GAChD,QAAQ,GAAG,SAAS,CA+CtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,SAAS,MAAM,EAAO,EAC9B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,gBAAgB,CAiClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,IAAI,CAiB1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reverse-persona.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/presets/reverse-persona.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,eAAe,QA+ChB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReverseAction, ReverseState } from './types.ts';
|
|
2
|
+
export interface FrontierOptions {
|
|
3
|
+
readonly cell?: string;
|
|
4
|
+
readonly posture?: string;
|
|
5
|
+
readonly island?: string;
|
|
6
|
+
readonly limit?: number;
|
|
7
|
+
readonly eliteCap?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function computeFrontier(state: ReverseState, options?: FrontierOptions): ReverseAction[];
|
|
10
|
+
//# sourceMappingURL=frontier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontier.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/frontier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAkC,YAAY,EAAE,MAAM,YAAY,CAAA;AAE7F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAiDD,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,GAAE,eAAoB,GAAG,aAAa,EAAE,CAoCnG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function sha256Hex(value: string | Buffer): string;
|
|
2
|
+
export declare function shortHash(value: string): string;
|
|
3
|
+
export declare function cellId(value: string): string;
|
|
4
|
+
export declare function artifactIdFromSha(sha: string): string;
|
|
5
|
+
export declare function functionId(cell: string, address: string): string;
|
|
6
|
+
export declare function findingId(cell: string, key: string): string;
|
|
7
|
+
export declare function actionId(type: string, targetId: string, params: unknown): string;
|
|
8
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/ids.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAEhF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host installer for the reverse preset row.
|
|
3
|
+
*
|
|
4
|
+
* This module is imported only by src/entries/reverse-board.ts, which is mounted
|
|
5
|
+
* only by presets/reverse. It is not imported by src/index.ts, so reverse_board
|
|
6
|
+
* never appears in another preset's tool catalog.
|
|
7
|
+
*
|
|
8
|
+
* @module dsh-chatgpt-subscription/host/runtime/reverse/index
|
|
9
|
+
*/
|
|
10
|
+
import { REVERSE_BOARD_TOOL } from './tool.ts';
|
|
11
|
+
export interface ReverseHost {
|
|
12
|
+
get(name: string): unknown;
|
|
13
|
+
logger?: {
|
|
14
|
+
info?(message: string): void;
|
|
15
|
+
warn?(message: string): void;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function installReverseBoard(host: ReverseHost): () => void;
|
|
19
|
+
export { REVERSE_BOARD_TOOL };
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAqB,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEjE,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAC1B,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;QAC5B,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;KAC7B,CAAA;CACF;AAUD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,IAAI,CAYjE;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReverseNode } from './types.ts';
|
|
2
|
+
export interface ArtifactIndexInput {
|
|
3
|
+
readonly id?: string;
|
|
4
|
+
readonly key?: string;
|
|
5
|
+
readonly label?: string;
|
|
6
|
+
readonly attrs?: Readonly<Record<string, unknown>>;
|
|
7
|
+
}
|
|
8
|
+
export declare function indexArtifact(input: ArtifactIndexInput, cell: string): Promise<ReverseNode>;
|
|
9
|
+
//# sourceMappingURL=indexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/indexer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACnD;AAmBD,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAyBjG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ReverseScope } from './types.ts';
|
|
2
|
+
export declare function assertPathScope(scope: ReverseScope | undefined, candidate: string): void;
|
|
3
|
+
export declare function assertResourceScope(scope: ReverseScope | undefined, resource: string): void;
|
|
4
|
+
export declare function assertSameCell(expected: string, actual: string): void;
|
|
5
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAO5D,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CASxF;AAMD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAM3F;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAIrE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Deterministic value/UCB route scoring; no hidden model dependency. @module */
|
|
2
|
+
import type { ReverseNode, ReverseRouteStat } from './types.ts';
|
|
3
|
+
export interface RouteScore {
|
|
4
|
+
readonly island: string;
|
|
5
|
+
readonly score: number;
|
|
6
|
+
readonly exploration: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function routeIsland(node: ReverseNode): string;
|
|
9
|
+
export declare function scoreRoute(node: ReverseNode, stat: ReverseRouteStat | undefined, totalAttempts: number): RouteScore;
|
|
10
|
+
//# sourceMappingURL=route-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-policy.d.ts","sourceRoot":"","sources":["../../../../../src/host/runtime/reverse/route-policy.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE/D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAOD,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAarD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,gBAAgB,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,UAAU,CAanH"}
|