dsh-thinking-guard 0.1.17 → 0.1.20
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 +40 -130
- package/cordis.patch.yml +5 -0
- package/lib/client.d.ts +8 -2
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +4627 -6732
- package/lib/guard-core.js +74 -15
- package/lib/guard-core.js.map +1 -1
- package/lib/guard-loop-core.js +158 -24
- package/lib/guard-loop-core.js.map +1 -1
- package/lib/guard.js +228 -85
- package/lib/guard.js.map +1 -1
- package/lib/host-face.js +1 -0
- package/lib/host-face.js.map +1 -1
- package/lib/index.js +11 -1
- package/lib/index.js.map +1 -1
- package/lib/invoke.js +16 -10
- package/lib/invoke.js.map +1 -1
- package/lib/policy-state.js +29 -1
- package/lib/policy-state.js.map +1 -1
- package/lib/policy.js +178 -10
- package/lib/policy.js.map +1 -1
- package/lib/registry.js +12 -2
- package/lib/registry.js.map +1 -1
- package/lib/server/call-index-remote.js +110 -0
- package/lib/server/call-index-remote.js.map +1 -0
- package/lib/server/remote.js +13 -0
- package/lib/server/remote.js.map +1 -1
- package/lib/types/guard-core.d.ts +91 -6
- package/lib/types/guard-core.d.ts.map +1 -1
- package/lib/types/guard-loop-core.d.ts +64 -3
- package/lib/types/guard-loop-core.d.ts.map +1 -1
- package/lib/types/guard.d.ts +7 -1
- package/lib/types/guard.d.ts.map +1 -1
- package/lib/types/host-face.d.ts.map +1 -1
- package/lib/types/index.d.ts +5 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/invoke.d.ts.map +1 -1
- package/lib/types/policy-state.d.ts +6 -0
- package/lib/types/policy-state.d.ts.map +1 -1
- package/lib/types/policy.d.ts +34 -3
- package/lib/types/policy.d.ts.map +1 -1
- package/lib/types/registry.d.ts.map +1 -1
- package/lib/types/server/call-index-remote.d.ts +17 -0
- package/lib/types/server/call-index-remote.d.ts.map +1 -0
- package/lib/types/server/remote.d.ts +9 -0
- package/lib/types/server/remote.d.ts.map +1 -1
- package/lib/types/usage/call-index-core.d.ts +152 -0
- package/lib/types/usage/call-index-core.d.ts.map +1 -0
- package/lib/types/usage/call-index-host-face.d.ts +44 -0
- package/lib/types/usage/call-index-host-face.d.ts.map +1 -0
- package/lib/types/usage/call-index-host.d.ts +7 -0
- package/lib/types/usage/call-index-host.d.ts.map +1 -0
- package/lib/types/usage/call-index-query.d.ts +97 -0
- package/lib/types/usage/call-index-query.d.ts.map +1 -0
- package/lib/types/usage/call-index-runtime.d.ts +46 -0
- package/lib/types/usage/call-index-runtime.d.ts.map +1 -0
- package/lib/types/usage/call-index-scope.d.ts +59 -0
- package/lib/types/usage/call-index-scope.d.ts.map +1 -0
- package/lib/types/usage/call-index-wire.d.ts +286 -0
- package/lib/types/usage/call-index-wire.d.ts.map +1 -0
- package/lib/types/usage/session-index.d.ts +149 -0
- package/lib/types/usage/session-index.d.ts.map +1 -0
- package/lib/usage/call-index-core.js +761 -0
- package/lib/usage/call-index-core.js.map +1 -0
- package/lib/usage/call-index-host-face.js +77 -0
- package/lib/usage/call-index-host-face.js.map +1 -0
- package/lib/usage/call-index-host.js +13 -0
- package/lib/usage/call-index-host.js.map +1 -0
- package/lib/usage/call-index-query.js +669 -0
- package/lib/usage/call-index-query.js.map +1 -0
- package/lib/usage/call-index-runtime.js +376 -0
- package/lib/usage/call-index-runtime.js.map +1 -0
- package/lib/usage/call-index-scope.js +79 -0
- package/lib/usage/call-index-scope.js.map +1 -0
- package/lib/usage/call-index-wire.js +490 -0
- package/lib/usage/call-index-wire.js.map +1 -0
- package/lib/usage/session-index.js +600 -0
- package/lib/usage/session-index.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-index-host-face.d.ts","sourceRoot":"","sources":["../../../src/usage/call-index-host-face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,KAAK,EAAoC,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAWvF,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,uBAAoB,CAAA;AAE7D,mDAAmD;AACnD,eAAO,MAAM,8BAA8B,cAAc,CAAA;AAEzD,qFAAqF;AACrF,eAAO,MAAM,4BAA4B,qBAAqB,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qBAAqB,CAAA;AAE5D;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC,CAQ1G,CAAA;AA+BD,yDAAyD;AACzD,wBAAgB,iBAAiB,IAAI,cAAc,CAoBlD;AAED,gFAAgF;AAChF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { type CallIndexRuntimeConfig } from './call-index-runtime.ts';
|
|
3
|
+
export declare const name = "thinking-guard-call-index";
|
|
4
|
+
export declare const Config: import("@deepseek-ai/schemastery").default<CallIndexRuntimeConfig>;
|
|
5
|
+
/** Lifecycle belongs to this plugin fiber; no production profile or Session writes. */
|
|
6
|
+
export declare function apply(ctx: Context, config?: CallIndexRuntimeConfig): void;
|
|
7
|
+
//# sourceMappingURL=call-index-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-index-host.d.ts","sourceRoot":"","sources":["../../../src/usage/call-index-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAA4C,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAC/G,eAAO,MAAM,IAAI,8BAA8B,CAAA;AAC/C,eAAO,MAAM,MAAM,oEAAkB,CAAA;AACrC,uFAAuF;AACvF,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,sBAA2B,GAAG,IAAI,CAK7E"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { SessionCallIndex } from './session-index.ts';
|
|
2
|
+
import { type CallIndexReply } from './call-index-wire.ts';
|
|
3
|
+
/** Structural type of `SessionCallIndex.snapshot()` — type-only, never bundled. */
|
|
4
|
+
export type CallIndexQuerySnapshot = ReturnType<SessionCallIndex['snapshot']>;
|
|
5
|
+
/** Everything the query layer needs from the Host; the runtime owns it. */
|
|
6
|
+
export interface CallIndexQuerySource {
|
|
7
|
+
readonly snapshot: () => CallIndexQuerySnapshot;
|
|
8
|
+
/** Cheap authorization/rescan stamp. Changes on scope change or a full rescan. */
|
|
9
|
+
readonly stamp: () => string;
|
|
10
|
+
readonly isSessionVisible: (id: string) => Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Optional cheap freshness probe. When present, pagination can report
|
|
13
|
+
* `hasUpdates` after live additions WITHOUT re-reading `snapshot()`. When
|
|
14
|
+
* absent, frozen views simply report `hasUpdates: false`.
|
|
15
|
+
*/
|
|
16
|
+
readonly generation?: () => number;
|
|
17
|
+
}
|
|
18
|
+
export interface CallIndexQueryOptions {
|
|
19
|
+
now?: () => number;
|
|
20
|
+
ttlMs?: number;
|
|
21
|
+
maxViews?: number;
|
|
22
|
+
maxBytes?: number;
|
|
23
|
+
maxReplyBytes?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Immutable, bounded query views behind the `callIndex` namespace.
|
|
27
|
+
*
|
|
28
|
+
* One instance is owned by the Host runtime. Views are frozen captures of a
|
|
29
|
+
* single `snapshot()`; cursors point at offsets inside one view.
|
|
30
|
+
*/
|
|
31
|
+
export declare class CallIndexQueries {
|
|
32
|
+
private readonly source;
|
|
33
|
+
private readonly now;
|
|
34
|
+
private readonly ttlMs;
|
|
35
|
+
private readonly maxViews;
|
|
36
|
+
private readonly maxBytes;
|
|
37
|
+
private readonly maxReplyBytes;
|
|
38
|
+
private readonly views;
|
|
39
|
+
private readonly cursors;
|
|
40
|
+
private readonly cursorKeys;
|
|
41
|
+
private totalBytes;
|
|
42
|
+
constructor(source: CallIndexQuerySource, options?: CallIndexQueryOptions);
|
|
43
|
+
/**
|
|
44
|
+
* Wire envelope shared by every page.
|
|
45
|
+
*
|
|
46
|
+
* `totalExact` means "this number is the whole truth for the filter". The two
|
|
47
|
+
* kinds of provenance filter are NOT symmetric, and the asymmetry decides the
|
|
48
|
+
* flag:
|
|
49
|
+
*
|
|
50
|
+
* - `sourceKind: 'mcp' | 'native' | 'plugin-tool' | 'skill'` — the predicate
|
|
51
|
+
* means "the real source IS mcp", but the stored label only means "the
|
|
52
|
+
* catalog resolved it to mcp". A call from a since-removed plugin is
|
|
53
|
+
* labelled `unknown` although it really was MCP, so this count is a LOWER
|
|
54
|
+
* BOUND and must not claim exact.
|
|
55
|
+
* - `sourceKind: 'unknown'` — the predicate is the label itself. Every row
|
|
56
|
+
* carries exactly one label (`buildRow` always writes it, and
|
|
57
|
+
* `projectRow` drops a row with an invalid one), so "rows matching this
|
|
58
|
+
* filter" equals "rows labelled unknown" by definition: nothing can be
|
|
59
|
+
* missed and nothing counted twice. That exactness is definitional, not
|
|
60
|
+
* evidential, which is why it survives.
|
|
61
|
+
*
|
|
62
|
+
* What `unknown` must NOT be read as is "calls whose real source is unknown":
|
|
63
|
+
* it also holds calls whose source is known but whose tool left the catalog.
|
|
64
|
+
* It is a superset of the truly-unresolved, so the UI has to say
|
|
65
|
+
* "provenance unresolved", never "未知来源的真实总数".
|
|
66
|
+
*/
|
|
67
|
+
private meta;
|
|
68
|
+
private bounded;
|
|
69
|
+
/** Drop every cached view and cursor (explicit rescan / disable / dispose). */
|
|
70
|
+
invalidate(): void;
|
|
71
|
+
private estimateBytes;
|
|
72
|
+
private dropView;
|
|
73
|
+
private evictExpired;
|
|
74
|
+
private evictOldest;
|
|
75
|
+
private capture;
|
|
76
|
+
private resolveView;
|
|
77
|
+
private hasUpdates;
|
|
78
|
+
private cursorKey;
|
|
79
|
+
/** Reuse the cursor id for an identical (view, kind, filter, offset) position. */
|
|
80
|
+
private newCursor;
|
|
81
|
+
private fitCount;
|
|
82
|
+
private listContext;
|
|
83
|
+
private sessionsFor;
|
|
84
|
+
/** Summarise the whole filtered set (not the current page). */
|
|
85
|
+
getSummary(request?: unknown): CallIndexReply;
|
|
86
|
+
/** One page of Session metadata; zero-call Sessions are included when unfiltered. */
|
|
87
|
+
listSessions(request?: unknown): CallIndexReply;
|
|
88
|
+
/** One page of call rows in stable `(startedAt DESC, sessionId, callSeq)` order. */
|
|
89
|
+
listCalls(request?: unknown): CallIndexReply;
|
|
90
|
+
/**
|
|
91
|
+
* Safely read one call's metadata. The row must be in the frozen view, then
|
|
92
|
+
* the Session must still be visible, then the authorization stamp must still
|
|
93
|
+
* match — a detail read never trusts a browser-supplied id by itself.
|
|
94
|
+
*/
|
|
95
|
+
getCallDetail(request: unknown): Promise<CallIndexReply>;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=call-index-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-index-query.d.ts","sourceRoot":"","sources":["../../../src/usage/call-index-query.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAkBL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAA;AAE7B,mFAAmF;AACnF,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAA;AAE7E,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,sBAAsB,CAAA;IAC/C,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAA;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,CAAC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CAAC,SAAS;IAiBjB,OAAO,CAAC,QAAQ;IAkBhB,OAAO,CAAC,WAAW;IA4BnB,OAAO,CAAC,WAAW;IAanB,+DAA+D;IAC/D,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc;IAsB7C,qFAAqF;IACrF,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc;IA8B/C,oFAAoF;IACpF,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc;IA8B5C;;;;OAIG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;CAiC/D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Formal Host owner of the call index. Scope is explicit; storage remains read-only. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import z from '@deepseek-ai/schemastery';
|
|
4
|
+
import { type CallIndexReply } from './call-index-wire.ts';
|
|
5
|
+
export interface CallIndexRuntimeConfig {
|
|
6
|
+
scope?: 'disabled' | 'host-visible';
|
|
7
|
+
liveDebounceMs?: number;
|
|
8
|
+
maxEventsPerRun?: number;
|
|
9
|
+
queryTtlMs?: number;
|
|
10
|
+
queryMaxViews?: number;
|
|
11
|
+
queryMaxBytes?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
maxBytes?: number;
|
|
14
|
+
maxCalls?: number;
|
|
15
|
+
maxSessions?: number;
|
|
16
|
+
maxLiveQueue?: number;
|
|
17
|
+
/** Run one history scan automatically when the plugin mounts (D-031). */
|
|
18
|
+
autoIndex?: boolean;
|
|
19
|
+
/** Which pass the automatic scan requests. Incremental by default. */
|
|
20
|
+
autoIndexMode?: 'full' | 'incremental';
|
|
21
|
+
/** Delay before the automatic scan, so the mount and scope resolve first. */
|
|
22
|
+
autoIndexDelayMs?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare const CallIndexConfig: z<CallIndexRuntimeConfig>;
|
|
25
|
+
export interface CallIndexRuntime {
|
|
26
|
+
getIndexStatus(): CallIndexReply;
|
|
27
|
+
startIndex(request?: unknown): CallIndexReply;
|
|
28
|
+
cancelIndex(request: unknown): CallIndexReply;
|
|
29
|
+
getSummary(request?: unknown): CallIndexReply;
|
|
30
|
+
listSessions(request?: unknown): CallIndexReply;
|
|
31
|
+
listCalls(request?: unknown): CallIndexReply;
|
|
32
|
+
getCallDetail(request: unknown): Promise<CallIndexReply>;
|
|
33
|
+
whenIdle(): Promise<void>;
|
|
34
|
+
dispose(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export interface CallIndexRuntimeOptions {
|
|
37
|
+
now?: () => number;
|
|
38
|
+
schedule?: (callback: () => void, delay: number) => () => void;
|
|
39
|
+
}
|
|
40
|
+
declare module '@deepseek-ai/cordis' {
|
|
41
|
+
interface Context {
|
|
42
|
+
callIndexRuntime: CallIndexRuntime;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export declare function installCallIndexRuntime(ctx: Context, config?: CallIndexRuntimeConfig, options?: CallIndexRuntimeOptions): CallIndexRuntime;
|
|
46
|
+
//# sourceMappingURL=call-index-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-index-runtime.d.ts","sourceRoot":"","sources":["../../../src/usage/call-index-runtime.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAIxC,OAAO,EAAkC,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAK1F,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,CAAA;IACnC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAA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A;KAAE;CAAE;AAsDjG,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,sBAA2B,EAAE,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAwMlJ"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explicit scope contract for the new call index (D-026).
|
|
3
|
+
* `host-visible` means the public service corpus, potentially across Profiles.
|
|
4
|
+
* It never claims Profile ownership. The legacy Usage gate is not changed.
|
|
5
|
+
* Resolving a scope never lists or opens history; this is a server-only lease.
|
|
6
|
+
*/
|
|
7
|
+
import type { SessionPersistence } from '@deepseek-ai/dsh-session-persistence';
|
|
8
|
+
export type CallIndexScopeMode = 'disabled' | 'host-visible';
|
|
9
|
+
export type CallIndexBackend = Pick<SessionPersistence, 'identity' | 'list' | 'stat' | 'open'>;
|
|
10
|
+
export type CallIndexScope = {
|
|
11
|
+
readonly status: 'disabled';
|
|
12
|
+
readonly mode: 'disabled';
|
|
13
|
+
readonly reason: 'not-enabled';
|
|
14
|
+
} | {
|
|
15
|
+
readonly status: 'unavailable';
|
|
16
|
+
readonly mode: 'disabled' | 'host-visible';
|
|
17
|
+
readonly reason: 'unsupported-scope' | 'persistence-unavailable';
|
|
18
|
+
} | {
|
|
19
|
+
readonly status: 'ready';
|
|
20
|
+
readonly mode: 'host-visible';
|
|
21
|
+
readonly epoch: number;
|
|
22
|
+
readonly token: symbol;
|
|
23
|
+
readonly backend: CallIndexBackend;
|
|
24
|
+
};
|
|
25
|
+
export interface CallIndexScopeDescription {
|
|
26
|
+
readonly status: CallIndexScope['status'];
|
|
27
|
+
readonly mode: CallIndexScopeMode;
|
|
28
|
+
readonly scope?: 'host-visible';
|
|
29
|
+
readonly includesOtherProfiles?: true;
|
|
30
|
+
readonly epoch?: number;
|
|
31
|
+
readonly reason?: 'not-enabled' | 'unsupported-scope' | 'persistence-unavailable';
|
|
32
|
+
}
|
|
33
|
+
/** Instance-local epochs and tickets; neither is a persistent Profile identity. */
|
|
34
|
+
export declare class CallIndexScopeController {
|
|
35
|
+
private counter;
|
|
36
|
+
private identity;
|
|
37
|
+
private ticket;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the live scope.
|
|
40
|
+
*
|
|
41
|
+
* `undefined` now means "use the configured default", which since D-029 is
|
|
42
|
+
* `host-visible` — matching `CallIndexConfig.scope`'s schema default. Keeping
|
|
43
|
+
* the two in step matters: this method is called directly by
|
|
44
|
+
* `installCallIndexRuntime`, so a schema-only default would leave a host that
|
|
45
|
+
* builds the runtime from a plain object quietly disabled.
|
|
46
|
+
*
|
|
47
|
+
* `'disabled'` still hard-disables, and any unrecognized mode stays
|
|
48
|
+
* `unavailable` rather than guessing.
|
|
49
|
+
*/
|
|
50
|
+
resolve(mode?: unknown, backend?: unknown): CallIndexScope;
|
|
51
|
+
/** Callers must resolve the current live mode/backend before using this check. */
|
|
52
|
+
isCurrent(scope: CallIndexScope): scope is Extract<CallIndexScope, {
|
|
53
|
+
status: 'ready';
|
|
54
|
+
}>;
|
|
55
|
+
invalidate(): void;
|
|
56
|
+
}
|
|
57
|
+
/** Fixed wire projection: no service, symbol, path, Profile inference or raw error. */
|
|
58
|
+
export declare function describeCallIndexScope(scope: CallIndexScope): CallIndexScopeDescription;
|
|
59
|
+
//# sourceMappingURL=call-index-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-index-scope.d.ts","sourceRoot":"","sources":["../../../src/usage/call-index-scope.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AAE9E,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,cAAc,CAAA;AAC5D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,CAAA;AAC9F,MAAM,MAAM,cAAc,GACtB;IAAE,QAA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AAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC;IAIvF,UAAU,IAAI,IAAI;CAInB;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG,yBAAyB,CAQvF"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe wire contract for the `callIndex` Remote namespace (D-026).
|
|
3
|
+
*
|
|
4
|
+
* This module is the single place both faces agree on. It is imported at
|
|
5
|
+
* RUNTIME by the browser contribution (`src/client/call-index-remote.ts`) and by
|
|
6
|
+
* the Host face (`src/usage/call-index-host-face.ts`), so it may only depend on
|
|
7
|
+
* `zod`; it must never runtime-import a Node module or `session-index.ts` (a
|
|
8
|
+
* type-only import is fine because it is erased before the browser bundle).
|
|
9
|
+
*
|
|
10
|
+
* @module dsh-thinking-guard/usage/call-index-wire
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
/** Every reply kind on the `callIndex` wire. */
|
|
14
|
+
export declare const CALL_INDEX_REPLY_KINDS: readonly ["status", "task", "summary", "sessions", "calls", "detail", "error"];
|
|
15
|
+
export type CallIndexReplyKind = (typeof CALL_INDEX_REPLY_KINDS)[number];
|
|
16
|
+
/** Stable failure codes; anything else normalizes to `internal-error`. */
|
|
17
|
+
export declare const CALL_INDEX_ERROR_REASONS: readonly ["invalid-request", "scope-disabled", "persistence-unavailable", "cursor-stale", "query-capacity", "reply-too-large", "not-visible", "runtime-unavailable", "task-not-found", "internal-error"];
|
|
18
|
+
export type CallIndexErrorReason = (typeof CALL_INDEX_ERROR_REASONS)[number];
|
|
19
|
+
/** Call statuses mirrored from `CallIndexRow.outcome`. */
|
|
20
|
+
export declare const CALL_INDEX_OUTCOMES: readonly ["success", "error", "cancelled", "unresolved", "unknown", "running"];
|
|
21
|
+
export type CallIndexOutcome = (typeof CALL_INDEX_OUTCOMES)[number];
|
|
22
|
+
/** Known call source categories (the core currently emits only `unknown`). */
|
|
23
|
+
export declare const CALL_INDEX_SOURCE_KINDS: readonly ["mcp", "plugin-tool", "native", "skill", "unknown"];
|
|
24
|
+
export type CallIndexSourceKind = (typeof CALL_INDEX_SOURCE_KINDS)[number];
|
|
25
|
+
/** Shared literal bounds; Host and browser must agree. */
|
|
26
|
+
export declare const CALL_INDEX_MAX_ID_LENGTH = 512;
|
|
27
|
+
export declare const CALL_INDEX_MAX_CWD_LENGTH = 4096;
|
|
28
|
+
export declare const CALL_INDEX_MAX_CURSOR_LENGTH = 256;
|
|
29
|
+
export declare const CALL_INDEX_DEFAULT_LIMIT = 50;
|
|
30
|
+
export declare const CALL_INDEX_MAX_LIMIT = 200;
|
|
31
|
+
export declare const CALL_INDEX_DEFAULT_TTL_MS = 60000;
|
|
32
|
+
export declare const CALL_INDEX_DEFAULT_MAX_VIEWS = 4;
|
|
33
|
+
export declare const CALL_INDEX_DEFAULT_MAX_BYTES: number;
|
|
34
|
+
export declare const CALL_INDEX_MAX_REPLY_BYTES: number;
|
|
35
|
+
/**
|
|
36
|
+
* Reply envelope. Intentionally loose at the type level (`kind` + `data`) so
|
|
37
|
+
* the runtime owner can build `{ schemaVersion, ok, kind, data }` without
|
|
38
|
+
* importing every inner interface; the runtime guarantee comes from
|
|
39
|
+
* {@link callIndexReply}, which re-projects the value through closed schemas.
|
|
40
|
+
*/
|
|
41
|
+
export interface CallIndexReply {
|
|
42
|
+
readonly schemaVersion: 1;
|
|
43
|
+
readonly ok: boolean;
|
|
44
|
+
readonly kind: CallIndexReplyKind;
|
|
45
|
+
readonly data?: Record<string, unknown>;
|
|
46
|
+
readonly reason?: string;
|
|
47
|
+
readonly [key: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
/** Build a stable error reply; an unknown reason becomes `internal-error`. */
|
|
50
|
+
export declare function callIndexError(reason: string): CallIndexReply;
|
|
51
|
+
/** One filter shared by summary / list requests. Half-open `[fromMs, toMs)`. */
|
|
52
|
+
export declare const callIndexQuerySchema: z.ZodObject<{
|
|
53
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
toolName: z.ZodOptional<z.ZodString>;
|
|
55
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
56
|
+
outcome: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
success: "success";
|
|
58
|
+
error: "error";
|
|
59
|
+
cancelled: "cancelled";
|
|
60
|
+
unknown: "unknown";
|
|
61
|
+
unresolved: "unresolved";
|
|
62
|
+
running: "running";
|
|
63
|
+
}>>;
|
|
64
|
+
sourceKind: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
skill: "skill";
|
|
66
|
+
unknown: "unknown";
|
|
67
|
+
mcp: "mcp";
|
|
68
|
+
"plugin-tool": "plugin-tool";
|
|
69
|
+
native: "native";
|
|
70
|
+
}>>;
|
|
71
|
+
fromMs: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
toMs: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
includeInherited: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
}, z.core.$strict>;
|
|
75
|
+
/** Bounds for the client-supplied local-day offset (UTC-12:00 … UTC+14:00). */
|
|
76
|
+
export declare const CALL_INDEX_MIN_DAY_OFFSET_MINUTES = -720;
|
|
77
|
+
export declare const CALL_INDEX_MAX_DAY_OFFSET_MINUTES = 840;
|
|
78
|
+
/** Hard cap on returned day buckets: one calendar year of daily rows. */
|
|
79
|
+
export declare const CALL_INDEX_MAX_DAY_BUCKETS = 366;
|
|
80
|
+
export declare const callIndexSummaryRequestSchema: z.ZodObject<{
|
|
81
|
+
query: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
83
|
+
toolName: z.ZodOptional<z.ZodString>;
|
|
84
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
85
|
+
outcome: z.ZodOptional<z.ZodEnum<{
|
|
86
|
+
success: "success";
|
|
87
|
+
error: "error";
|
|
88
|
+
cancelled: "cancelled";
|
|
89
|
+
unknown: "unknown";
|
|
90
|
+
unresolved: "unresolved";
|
|
91
|
+
running: "running";
|
|
92
|
+
}>>;
|
|
93
|
+
sourceKind: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
skill: "skill";
|
|
95
|
+
unknown: "unknown";
|
|
96
|
+
mcp: "mcp";
|
|
97
|
+
"plugin-tool": "plugin-tool";
|
|
98
|
+
native: "native";
|
|
99
|
+
}>>;
|
|
100
|
+
fromMs: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
toMs: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
includeInherited: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
snapshotId: z.ZodOptional<z.ZodString>;
|
|
105
|
+
dayOffsetMinutes: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
export declare const callIndexListRequestSchema: z.ZodObject<{
|
|
108
|
+
query: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
110
|
+
toolName: z.ZodOptional<z.ZodString>;
|
|
111
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
112
|
+
outcome: z.ZodOptional<z.ZodEnum<{
|
|
113
|
+
success: "success";
|
|
114
|
+
error: "error";
|
|
115
|
+
cancelled: "cancelled";
|
|
116
|
+
unknown: "unknown";
|
|
117
|
+
unresolved: "unresolved";
|
|
118
|
+
running: "running";
|
|
119
|
+
}>>;
|
|
120
|
+
sourceKind: z.ZodOptional<z.ZodEnum<{
|
|
121
|
+
skill: "skill";
|
|
122
|
+
unknown: "unknown";
|
|
123
|
+
mcp: "mcp";
|
|
124
|
+
"plugin-tool": "plugin-tool";
|
|
125
|
+
native: "native";
|
|
126
|
+
}>>;
|
|
127
|
+
fromMs: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
toMs: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
includeInherited: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
}, z.core.$strict>>;
|
|
131
|
+
snapshotId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
133
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
export declare const callIndexDetailRequestSchema: z.ZodObject<{
|
|
136
|
+
sessionId: z.ZodString;
|
|
137
|
+
callSeq: z.ZodNumber;
|
|
138
|
+
snapshotId: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
/** `startIndex(request?)`; the runtime owns the actual scan mode. */
|
|
141
|
+
export declare const callIndexStartRequestSchema: z.ZodObject<{
|
|
142
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
143
|
+
full: "full";
|
|
144
|
+
incremental: "incremental";
|
|
145
|
+
}>>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
/** `cancelIndex(request)`; `request` is required even when it carries nothing. */
|
|
148
|
+
export declare const callIndexCancelRequestSchema: z.ZodObject<{
|
|
149
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strict>;
|
|
151
|
+
/** Fixed metadata fields of one call row (mirrors `CallIndexRow`, never args). */
|
|
152
|
+
export declare const callIndexWireRowSchema: z.ZodObject<{
|
|
153
|
+
sessionId: z.ZodString;
|
|
154
|
+
callSeq: z.ZodNumber;
|
|
155
|
+
callId: z.ZodString;
|
|
156
|
+
toolName: z.ZodString;
|
|
157
|
+
turn: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
startedAt: z.ZodNumber;
|
|
160
|
+
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
resultSeq: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
outcome: z.ZodEnum<{
|
|
164
|
+
success: "success";
|
|
165
|
+
error: "error";
|
|
166
|
+
cancelled: "cancelled";
|
|
167
|
+
unknown: "unknown";
|
|
168
|
+
unresolved: "unresolved";
|
|
169
|
+
running: "running";
|
|
170
|
+
}>;
|
|
171
|
+
inherited: z.ZodBoolean;
|
|
172
|
+
sourceKind: z.ZodEnum<{
|
|
173
|
+
skill: "skill";
|
|
174
|
+
unknown: "unknown";
|
|
175
|
+
mcp: "mcp";
|
|
176
|
+
"plugin-tool": "plugin-tool";
|
|
177
|
+
native: "native";
|
|
178
|
+
}>;
|
|
179
|
+
layer: z.ZodString;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export declare const callIndexWireSessionSchema: z.ZodObject<{
|
|
182
|
+
sessionId: z.ZodString;
|
|
183
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
184
|
+
revision: z.ZodString;
|
|
185
|
+
cut: z.ZodNumber;
|
|
186
|
+
coverage: z.ZodEnum<{
|
|
187
|
+
complete: "complete";
|
|
188
|
+
partial: "partial";
|
|
189
|
+
}>;
|
|
190
|
+
stale: z.ZodBoolean;
|
|
191
|
+
reasons: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
/**
|
|
194
|
+
* Overview aggregates over the whole filtered set (never the current page).
|
|
195
|
+
*
|
|
196
|
+
* `bySource` always carries every source kind, including zeros, so a caller can
|
|
197
|
+
* distinguish "known to be zero" from "not reported". `byDay` is bounded and
|
|
198
|
+
* ordered oldest-first; a request whose span exceeds
|
|
199
|
+
* {@link CALL_INDEX_MAX_DAY_BUCKETS} fails with `reply-too-large` instead of
|
|
200
|
+
* silently truncating a trend line.
|
|
201
|
+
*/
|
|
202
|
+
/**
|
|
203
|
+
* Per-source counts. All five keys are always emitted by this Host, but a reply
|
|
204
|
+
* that omits one is still readable: the missing kind is 0 and the caller renders
|
|
205
|
+
* it as "not resolved" anyway (R-009 forbids reading 0 as "unused"). Rejecting
|
|
206
|
+
* the whole overview over one absent key was never worth it.
|
|
207
|
+
*/
|
|
208
|
+
export declare const callIndexSourceCountsSchema: z.ZodPipe<z.ZodObject<{
|
|
209
|
+
mcp: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
'plugin-tool': z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
native: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
skill: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
unknown: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
215
|
+
mcp: number;
|
|
216
|
+
'plugin-tool': number;
|
|
217
|
+
native: number;
|
|
218
|
+
skill: number;
|
|
219
|
+
unknown: number;
|
|
220
|
+
}, {
|
|
221
|
+
mcp?: number | undefined;
|
|
222
|
+
'plugin-tool'?: number | undefined;
|
|
223
|
+
native?: number | undefined;
|
|
224
|
+
skill?: number | undefined;
|
|
225
|
+
unknown?: number | undefined;
|
|
226
|
+
}>>;
|
|
227
|
+
export declare const callIndexAggregatesSchema: z.ZodObject<{
|
|
228
|
+
distinctTools: z.ZodNumber;
|
|
229
|
+
bySource: z.ZodPipe<z.ZodObject<{
|
|
230
|
+
mcp: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
'plugin-tool': z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
native: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
skill: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
unknown: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
236
|
+
mcp: number;
|
|
237
|
+
'plugin-tool': number;
|
|
238
|
+
native: number;
|
|
239
|
+
skill: number;
|
|
240
|
+
unknown: number;
|
|
241
|
+
}, {
|
|
242
|
+
mcp?: number | undefined;
|
|
243
|
+
'plugin-tool'?: number | undefined;
|
|
244
|
+
native?: number | undefined;
|
|
245
|
+
skill?: number | undefined;
|
|
246
|
+
unknown?: number | undefined;
|
|
247
|
+
}>>;
|
|
248
|
+
byDay: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
249
|
+
day: z.ZodString;
|
|
250
|
+
calls: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
success: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
error: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
cancelled: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
unresolved: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
unknown: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
running: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
258
|
+
day: string;
|
|
259
|
+
calls: number;
|
|
260
|
+
success: number;
|
|
261
|
+
error: number;
|
|
262
|
+
cancelled: number;
|
|
263
|
+
unresolved: number;
|
|
264
|
+
unknown: number;
|
|
265
|
+
running: number;
|
|
266
|
+
}, {
|
|
267
|
+
day: string;
|
|
268
|
+
calls?: number | undefined;
|
|
269
|
+
success?: number | undefined;
|
|
270
|
+
error?: number | undefined;
|
|
271
|
+
cancelled?: number | undefined;
|
|
272
|
+
unresolved?: number | undefined;
|
|
273
|
+
unknown?: number | undefined;
|
|
274
|
+
running?: number | undefined;
|
|
275
|
+
}>>>>;
|
|
276
|
+
dayOffsetMinutes: z.ZodNumber;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
/** Public, non-throwing projector used by the Host gateway and the client codec. */
|
|
279
|
+
export declare function callIndexReply(value: unknown): CallIndexReply;
|
|
280
|
+
/**
|
|
281
|
+
* Zod codec for replies. `.parse` always succeeds and returns the projected
|
|
282
|
+
* reply, so a malformed Host payload degrades to `internal-error` instead of a
|
|
283
|
+
* transport failure.
|
|
284
|
+
*/
|
|
285
|
+
export declare const callIndexReplySchema: z.ZodPipe<z.ZodAny, z.ZodTransform<CallIndexReply, any>>;
|
|
286
|
+
//# sourceMappingURL=call-index-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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