@dsh-enhanced/assistant-growth-driver 0.1.34
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/LICENSE +21 -0
- package/README.md +200 -0
- package/cordis.patch.yml +3 -0
- package/lib/config.d.ts +122 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +207 -0
- package/lib/config.js.map +1 -0
- package/lib/deposit.d.ts +53 -0
- package/lib/deposit.d.ts.map +1 -0
- package/lib/deposit.js +55 -0
- package/lib/deposit.js.map +1 -0
- package/lib/growth-agent.d.ts +63 -0
- package/lib/growth-agent.d.ts.map +1 -0
- package/lib/growth-agent.js +563 -0
- package/lib/growth-agent.js.map +1 -0
- package/lib/index.d.ts +73 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +427 -0
- package/lib/index.js.map +1 -0
- package/lib/source-edits.d.ts +22 -0
- package/lib/source-edits.d.ts.map +1 -0
- package/lib/source-edits.js +77 -0
- package/lib/source-edits.js.map +1 -0
- package/lib/source-port.d.ts +139 -0
- package/lib/source-port.d.ts.map +1 -0
- package/lib/source-port.js +31 -0
- package/lib/source-port.js.map +1 -0
- package/lib/usage-runtime.d.ts +58 -0
- package/lib/usage-runtime.d.ts.map +1 -0
- package/lib/usage-runtime.js +258 -0
- package/lib/usage-runtime.js.map +1 -0
- package/lib/usage-store.d.ts +49 -0
- package/lib/usage-store.d.ts.map +1 -0
- package/lib/usage-store.js +121 -0
- package/lib/usage-store.js.map +1 -0
- package/lib/version.d.ts +2 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +2 -0
- package/lib/version.js.map +1 -0
- package/package.json +142 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-edits.js","sourceRoot":"","sources":["../src/source-edits.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAClC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAA;AA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K,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;YACzD,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAE,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QAC/H,CAAC;QACD,IAAI,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAE,CAAA;QACtC,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,OAAO,EAAE;YAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QACrI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,qBAAqB;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;QAC3G,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IAClC,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,gBAAgB,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,sBAAsB,EAAE,CAAC;QACzJ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACjE,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural seam between the growth agent and the plugin-control-plane source
|
|
3
|
+
* lane. The driver depends on this NARROW shape, not on the concrete service:
|
|
4
|
+
* index.ts adapts `ctx.get('pluginControlPlane', false)` onto it. When the
|
|
5
|
+
* service is absent or the owner did not opt in, no source-plane tool is
|
|
6
|
+
* registered and the capability fails closed.
|
|
7
|
+
*
|
|
8
|
+
* This module intentionally carries no runtime import of
|
|
9
|
+
* @dsh-enhanced/plugin-control-plane (an optional peer): every field here is a
|
|
10
|
+
* structural subset, so the driver still builds and loads without that package.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Local mirror of the control-plane protected-plugin denylist
|
|
14
|
+
* (PROTECTED_PLUGIN_DENYLIST in plugins/plugin-control-plane/src/source-workspace.ts).
|
|
15
|
+
* It is the growth-side SECOND layer of defence; the control plane re-checks
|
|
16
|
+
* the identical set inside prepareModifySourcePlan. Keep both lists in sync;
|
|
17
|
+
* a growth proposal may never retarget a T3 safety-root plugin.
|
|
18
|
+
*/
|
|
19
|
+
export declare const GROWTH_PROTECTED_PLUGIN_DENYLIST: ReadonlySet<string>;
|
|
20
|
+
/** Projection of an pre-existing control-plane capability gap safe to surface to the model. */
|
|
21
|
+
export interface GrowthSourceGap {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly capability: string;
|
|
24
|
+
readonly context: string;
|
|
25
|
+
readonly status: 'open' | 'matched' | 'closed';
|
|
26
|
+
readonly candidateId?: string;
|
|
27
|
+
readonly createdAt: number;
|
|
28
|
+
}
|
|
29
|
+
export interface GrowthSourcePreparedFile {
|
|
30
|
+
/** Path relative to plugins/<plugin_name>/; the Host rejects any escape. */
|
|
31
|
+
readonly path: string;
|
|
32
|
+
readonly content: string;
|
|
33
|
+
}
|
|
34
|
+
/** Read-only projection of the persisted pending modify plan. */
|
|
35
|
+
export interface GrowthSourcePreparedPlan {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly status: string;
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly mode: string;
|
|
40
|
+
readonly repository?: string;
|
|
41
|
+
readonly worktree?: string;
|
|
42
|
+
readonly baseCommit?: string;
|
|
43
|
+
/** Present on modify plans: the frozen isolated-worktree checked digests. */
|
|
44
|
+
readonly sourceCheck?: {
|
|
45
|
+
readonly treeDigest: string;
|
|
46
|
+
readonly patchDigest: string;
|
|
47
|
+
readonly checkedAt: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Content-free projection of a Host-owned durable source job. */
|
|
51
|
+
export interface SourceJobProjection {
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly gapId: string;
|
|
55
|
+
readonly baseCommit: string;
|
|
56
|
+
readonly status: 'queued' | 'running' | 'prepared' | 'failed' | 'unknown';
|
|
57
|
+
readonly createdAt: number;
|
|
58
|
+
readonly expiresAt: number;
|
|
59
|
+
readonly planId?: string;
|
|
60
|
+
readonly failureCode?: string;
|
|
61
|
+
}
|
|
62
|
+
/** @deprecated Prefer SourceJobProjection; retained for local source-port compatibility. */
|
|
63
|
+
export type GrowthSourceJobProjection = SourceJobProjection;
|
|
64
|
+
export interface GrowthSourceJobOwner {
|
|
65
|
+
readonly ownerRouteId: string;
|
|
66
|
+
readonly principalId: string;
|
|
67
|
+
readonly principalRecordId: string;
|
|
68
|
+
readonly principalVersion: number;
|
|
69
|
+
readonly workspace: string;
|
|
70
|
+
readonly preset: string;
|
|
71
|
+
}
|
|
72
|
+
export interface GrowthSourceSnapshot {
|
|
73
|
+
readonly name: string;
|
|
74
|
+
readonly baseCommit: string;
|
|
75
|
+
/** Complete eligible committed-text manifest; omission must never mean a file is new. */
|
|
76
|
+
readonly files: readonly {
|
|
77
|
+
readonly path: string;
|
|
78
|
+
readonly bytes: number;
|
|
79
|
+
}[];
|
|
80
|
+
readonly contents: readonly GrowthSourcePreparedFile[];
|
|
81
|
+
}
|
|
82
|
+
export interface GrowthSourcePlanePort {
|
|
83
|
+
/** Read committed text only; paths=[] discovers the bounded plugin manifest. */
|
|
84
|
+
inspectSource(input: {
|
|
85
|
+
repository: string;
|
|
86
|
+
name: string;
|
|
87
|
+
paths: readonly string[];
|
|
88
|
+
baseCommit?: string;
|
|
89
|
+
signal: AbortSignal;
|
|
90
|
+
assertCurrent: () => void;
|
|
91
|
+
}): Promise<GrowthSourceSnapshot>;
|
|
92
|
+
/** Enumerate recently recorded gaps; the caller filters to still-open ones. */
|
|
93
|
+
listOpenGaps(): readonly GrowthSourceGap[];
|
|
94
|
+
/**
|
|
95
|
+
* Prepare a PENDING modify source plan. Every build-shaping argument
|
|
96
|
+
* (repository, ttl, timeout, offline) is Host configuration forwarded
|
|
97
|
+
* verbatim — never model input. Resolves only with a pending-approval plan;
|
|
98
|
+
* any build/boundary failure rejects and leaves no plan row or gap claim.
|
|
99
|
+
*/
|
|
100
|
+
prepareModifySourcePlan(input: {
|
|
101
|
+
gapId: string;
|
|
102
|
+
name: string;
|
|
103
|
+
repository: string;
|
|
104
|
+
files: readonly GrowthSourcePreparedFile[];
|
|
105
|
+
idempotencyKey: string;
|
|
106
|
+
expectedBaseCommit: string;
|
|
107
|
+
ttlMs: number;
|
|
108
|
+
timeoutMs: number;
|
|
109
|
+
offline: boolean;
|
|
110
|
+
owner?: GrowthSourceJobOwner;
|
|
111
|
+
signal: AbortSignal;
|
|
112
|
+
assertCurrent: () => void;
|
|
113
|
+
}): Promise<GrowthSourcePreparedPlan>;
|
|
114
|
+
/** Queue Host-owned source preparation that outlives the model wake. */
|
|
115
|
+
enqueueSourceJob(input: {
|
|
116
|
+
gapId: string;
|
|
117
|
+
name: string;
|
|
118
|
+
repository: string;
|
|
119
|
+
files: readonly GrowthSourcePreparedFile[];
|
|
120
|
+
idempotencyKey: string;
|
|
121
|
+
expectedBaseCommit: string;
|
|
122
|
+
ttlMs: number;
|
|
123
|
+
owner: GrowthSourceJobOwner;
|
|
124
|
+
signal: AbortSignal;
|
|
125
|
+
assertCurrent: () => void;
|
|
126
|
+
}): Promise<SourceJobProjection>;
|
|
127
|
+
/** Read a content-free durable-job status under the live Growth owner. */
|
|
128
|
+
inspectSourceJob(input: {
|
|
129
|
+
id: string;
|
|
130
|
+
owner: GrowthSourceJobOwner;
|
|
131
|
+
}): SourceJobProjection;
|
|
132
|
+
}
|
|
133
|
+
/** Per-wake counters surfaced into driver health by the index.ts adapter. */
|
|
134
|
+
export interface GrowthSourcePlaneStats {
|
|
135
|
+
queued: number;
|
|
136
|
+
prepared: number;
|
|
137
|
+
rejected: number;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=source-port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-port.d.ts","sourceRoot":"","sources":["../src/source-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,EAAE,WAAW,CAAC,MAAM,CAW/D,CAAA;AAEF,+FAA+F;AAC/F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC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,UAAU,EAAE,MAAM,CAAA;QAClB,KAAK,EAAE,SAAS,wBAAwB,EAAE,CAAA;QAC1C,cAAc,EAAE,MAAM,CAAA;QACtB,kBAAkB,EAAE,MAAM,CAAA;QAC1B,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,oBAAoB,CAAA;QAC3B,MAAM,EAAE,WAAW,CAAA;QACnB,aAAa,EAAE,MAAM,IAAI,CAAA;KAC1B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAChC,0EAA0E;IAC1E,gBAAgB,CAAC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,oBAAoB,CAAA;KAAE,GAAG,mBAAmB,CAAA;CAC1F;AAED,6EAA6E;AAC7E,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural seam between the growth agent and the plugin-control-plane source
|
|
3
|
+
* lane. The driver depends on this NARROW shape, not on the concrete service:
|
|
4
|
+
* index.ts adapts `ctx.get('pluginControlPlane', false)` onto it. When the
|
|
5
|
+
* service is absent or the owner did not opt in, no source-plane tool is
|
|
6
|
+
* registered and the capability fails closed.
|
|
7
|
+
*
|
|
8
|
+
* This module intentionally carries no runtime import of
|
|
9
|
+
* @dsh-enhanced/plugin-control-plane (an optional peer): every field here is a
|
|
10
|
+
* structural subset, so the driver still builds and loads without that package.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Local mirror of the control-plane protected-plugin denylist
|
|
14
|
+
* (PROTECTED_PLUGIN_DENYLIST in plugins/plugin-control-plane/src/source-workspace.ts).
|
|
15
|
+
* It is the growth-side SECOND layer of defence; the control plane re-checks
|
|
16
|
+
* the identical set inside prepareModifySourcePlan. Keep both lists in sync;
|
|
17
|
+
* a growth proposal may never retarget a T3 safety-root plugin.
|
|
18
|
+
*/
|
|
19
|
+
export const GROWTH_PROTECTED_PLUGIN_DENYLIST = new Set([
|
|
20
|
+
'assistant-policy', // 策略规则、授权寿命、急停根
|
|
21
|
+
'credentials-keychain', // 凭据根
|
|
22
|
+
'assistant-evaluation', // 评测答案根
|
|
23
|
+
'assistant-verifier', // 验证/私钥评测根
|
|
24
|
+
'assistant-deepseek-budget', // 预算上限根
|
|
25
|
+
'assistant-super-relay-budget', // 预算上限根
|
|
26
|
+
'assistant-skills', // sealed holdout 私钥与 holdout 数据集
|
|
27
|
+
'assistant-isolation', // 隔离沙箱机制本身
|
|
28
|
+
'assistant-web-owner', // owner 安全控制台
|
|
29
|
+
'plugin-control-plane', // 审批/激活控制面本身(自举提权面)
|
|
30
|
+
]);
|
|
31
|
+
//# sourceMappingURL=source-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-port.js","sourceRoot":"","sources":["../src/source-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAwB,IAAI,GAAG,CAAC;IAC3E,kBAAkB,EAAE,gBAAgB;IACpC,sBAAsB,EAAE,MAAM;IAC9B,sBAAsB,EAAE,QAAQ;IAChC,oBAAoB,EAAE,WAAW;IACjC,2BAA2B,EAAE,QAAQ;IACrC,8BAA8B,EAAE,QAAQ;IACxC,kBAAkB,EAAE,iCAAiC;IACrD,qBAAqB,EAAE,WAAW;IAClC,qBAAqB,EAAE,cAAc;IACrC,sBAAsB,EAAE,oBAAoB;CAC7C,CAAC,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AssistantAutomationsService } from '@dsh-enhanced/assistant-automations';
|
|
2
|
+
import type { AssistantEvaluationService } from '@dsh-enhanced/assistant-evaluation';
|
|
3
|
+
import type { AssistantDeliveryService, OwnerForegroundLearningTask } from '@dsh-enhanced/assistant-delivery';
|
|
4
|
+
import type { NormalizedGrowthDriverConfig } from './config.js';
|
|
5
|
+
import { type UsageModel } from './usage-store.js';
|
|
6
|
+
type Evaluation = Pick<AssistantEvaluationService, 'canonicalHostScope' | 'listTrustedTaskLearningProjections' | 'withTrustedCanonicalTaskWriterFence' | 'onTrustedTaskChange'>;
|
|
7
|
+
type Delivery = Pick<AssistantDeliveryService, 'validateOwnerRoute' | 'inspectOwnerForegroundLearningTask'>;
|
|
8
|
+
type Automations = Pick<AssistantAutomationsService, 'registerHostExecutor' | 'reconcileSystem' | 'inspectSystemOwnedActivation' | 'inspectSystemOwned'>;
|
|
9
|
+
export interface UsageReviewInput {
|
|
10
|
+
id: string;
|
|
11
|
+
model: UsageModel;
|
|
12
|
+
source: OwnerForegroundLearningTask;
|
|
13
|
+
signal: AbortSignal;
|
|
14
|
+
assertCurrent(): void;
|
|
15
|
+
}
|
|
16
|
+
export type UsageReviewResult = 'reviewed' | 'failed' | 'unknown';
|
|
17
|
+
/** Durable task-driven reviews; only native Automations owns timers/claims. */
|
|
18
|
+
export declare class UsageLearningRuntime {
|
|
19
|
+
private readonly config;
|
|
20
|
+
private readonly ports;
|
|
21
|
+
private readonly store;
|
|
22
|
+
private readonly lane;
|
|
23
|
+
private readonly configDigest;
|
|
24
|
+
private readonly scanId;
|
|
25
|
+
private readonly abort;
|
|
26
|
+
private readonly flights;
|
|
27
|
+
private unregister;
|
|
28
|
+
private unsubscribe;
|
|
29
|
+
private active;
|
|
30
|
+
private scanning;
|
|
31
|
+
private lastError;
|
|
32
|
+
private lastScanAt;
|
|
33
|
+
private closing;
|
|
34
|
+
constructor(config: NormalizedGrowthDriverConfig, ports: {
|
|
35
|
+
evaluation: Evaluation;
|
|
36
|
+
delivery: Delivery;
|
|
37
|
+
automations: Automations;
|
|
38
|
+
review(input: UsageReviewInput): Promise<UsageReviewResult>;
|
|
39
|
+
});
|
|
40
|
+
health: () => {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
connected: boolean;
|
|
43
|
+
lastScanAt: number | null;
|
|
44
|
+
lastError: string | null;
|
|
45
|
+
counts: Readonly<Record<string, number>>;
|
|
46
|
+
};
|
|
47
|
+
start(): void;
|
|
48
|
+
close(): Promise<void>;
|
|
49
|
+
private owner;
|
|
50
|
+
private source;
|
|
51
|
+
/** Synchronous nudge, bounded to 1000 heads. Native scan resumes the cursor. */
|
|
52
|
+
scan: () => void;
|
|
53
|
+
private definition;
|
|
54
|
+
private schedule;
|
|
55
|
+
private execute;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=usage-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-runtime.d.ts","sourceRoot":"","sources":["../src/usage-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAuF,MAAM,qCAAqC,CAAA;AAC3K,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAE7G,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAA+C,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAK/F,KAAK,UAAU,GAAG,IAAI,CAAC,0BAA0B,EAAE,oBAAoB,GAAG,oCAAoC,GAAG,qCAAqC,GAAG,qBAAqB,CAAC,CAAA;AAC/K,KAAK,QAAQ,GAAG,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,GAAG,oCAAoC,CAAC,CAAA;AAC3G,KAAK,WAAW,GAAG,IAAI,CAAC,2BAA2B,EAAE,sBAAsB,GAAG,iBAAiB,GAAG,8BAA8B,GAAG,oBAAoB,CAAC,CAAA;AACxJ,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,EAAE,2BAA2B,CAAA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@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { acceptanceDigest } from '@dsh-enhanced/task-acceptance-contract';
|
|
2
|
+
import { UsageStore } from './usage-store.js';
|
|
3
|
+
const OWNER = 'assistant-growth-usage';
|
|
4
|
+
const EXECUTOR = 'assistant-growth-usage-v1';
|
|
5
|
+
const CATALOG = acceptanceDigest({ executor: EXECUTOR, version: 1 });
|
|
6
|
+
const same = (a, b) => acceptanceDigest(a) === acceptanceDigest(b);
|
|
7
|
+
/** Durable task-driven reviews; only native Automations owns timers/claims. */
|
|
8
|
+
export class UsageLearningRuntime {
|
|
9
|
+
config;
|
|
10
|
+
ports;
|
|
11
|
+
store;
|
|
12
|
+
lane;
|
|
13
|
+
configDigest;
|
|
14
|
+
scanId;
|
|
15
|
+
abort = new AbortController();
|
|
16
|
+
flights = new Set();
|
|
17
|
+
unregister;
|
|
18
|
+
unsubscribe;
|
|
19
|
+
active = false;
|
|
20
|
+
scanning = false;
|
|
21
|
+
lastError = null;
|
|
22
|
+
lastScanAt = null;
|
|
23
|
+
closing;
|
|
24
|
+
constructor(config, ports) {
|
|
25
|
+
this.config = config;
|
|
26
|
+
this.ports = ports;
|
|
27
|
+
if (!config.usageLearning.enabled || !config.scope || !config.usageLearning.databasePath || !config.budgetId)
|
|
28
|
+
throw new Error('usage learning configuration missing');
|
|
29
|
+
if (typeof ports.evaluation.listTrustedTaskLearningProjections !== 'function'
|
|
30
|
+
|| typeof ports.evaluation.withTrustedCanonicalTaskWriterFence !== 'function'
|
|
31
|
+
|| typeof ports.evaluation.onTrustedTaskChange !== 'function'
|
|
32
|
+
|| typeof ports.delivery.inspectOwnerForegroundLearningTask !== 'function'
|
|
33
|
+
|| typeof ports.automations.registerHostExecutor !== 'function'
|
|
34
|
+
|| typeof ports.automations.inspectSystemOwnedActivation !== 'function') {
|
|
35
|
+
throw new Error('usage learning requires compatible Evaluation, Delivery and Automations Host APIs');
|
|
36
|
+
}
|
|
37
|
+
this.store = new UsageStore(config.usageLearning.databasePath);
|
|
38
|
+
this.lane = acceptanceDigest(config.scope);
|
|
39
|
+
this.configDigest = acceptanceDigest(config);
|
|
40
|
+
this.scanId = `usage-scan-${this.lane}`;
|
|
41
|
+
}
|
|
42
|
+
health = () => ({ enabled: true, connected: this.active, lastScanAt: this.lastScanAt,
|
|
43
|
+
lastError: this.lastError, counts: this.store.counts(this.lane) });
|
|
44
|
+
start() {
|
|
45
|
+
this.store.interrupt(this.lane);
|
|
46
|
+
this.unregister = this.ports.automations.registerHostExecutor({
|
|
47
|
+
descriptor: { executorId: EXECUTOR, contractVersion: 1, catalogDigest: CATALOG },
|
|
48
|
+
accepts: spec => spec.executorId === EXECUTOR && spec.executorContractVersion === 1
|
|
49
|
+
&& spec.catalogDigest === CATALOG && spec.runbookVersion === 1 && ['scan', 'review'].includes(spec.runbookId),
|
|
50
|
+
execute: input => {
|
|
51
|
+
const flight = this.execute(input);
|
|
52
|
+
this.flights.add(flight);
|
|
53
|
+
void flight.finally(() => this.flights.delete(flight)).catch(() => { });
|
|
54
|
+
return flight;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
this.active = true;
|
|
58
|
+
this.unsubscribe = this.ports.evaluation.onTrustedTaskChange(() => this.scan());
|
|
59
|
+
// This persisted scan also discovers writes made by another Host process.
|
|
60
|
+
this.ports.automations.reconcileSystem({ owner: OWNER, automationId: this.scanId,
|
|
61
|
+
idempotencyKey: `${this.scanId}:${this.configDigest}`, desiredStatus: 'active', definition: this.definition() });
|
|
62
|
+
this.scan();
|
|
63
|
+
}
|
|
64
|
+
close() {
|
|
65
|
+
return this.closing ??= (async () => {
|
|
66
|
+
this.active = false;
|
|
67
|
+
this.unsubscribe?.();
|
|
68
|
+
this.unregister?.();
|
|
69
|
+
this.abort.abort(new Error('usage learning provider disposed'));
|
|
70
|
+
await Promise.allSettled(this.flights);
|
|
71
|
+
this.store.close();
|
|
72
|
+
})();
|
|
73
|
+
}
|
|
74
|
+
owner() {
|
|
75
|
+
if (!this.active)
|
|
76
|
+
throw new Error('usage learning unavailable');
|
|
77
|
+
const scope = this.config.scope;
|
|
78
|
+
return this.ports.delivery.validateOwnerRoute({ authorityId: scope.ownerRouteId, principalId: scope.principalId,
|
|
79
|
+
workspace: scope.workspace, agentPreset: scope.preset });
|
|
80
|
+
}
|
|
81
|
+
source(job) {
|
|
82
|
+
this.abort.signal.throwIfAborted();
|
|
83
|
+
if (job.intent.configDigest !== this.configDigest || job.intent.expiresAt <= Date.now()
|
|
84
|
+
|| !same(this.owner(), job.intent.source.owner))
|
|
85
|
+
throw new Error('usage authority changed or expired');
|
|
86
|
+
const owner = job.intent.source.owner;
|
|
87
|
+
const source = this.ports.delivery.inspectOwnerForegroundLearningTask({ authorityId: owner.authorityId,
|
|
88
|
+
principalId: owner.principalId, workspace: owner.workspace, agentPreset: owner.agentPreset,
|
|
89
|
+
outcomeId: job.intent.source.canonical.triggerOutcomeId });
|
|
90
|
+
if (!source || !same(source.canonical.projection, job.intent.source.canonical.projection)
|
|
91
|
+
|| !same(source.source, job.intent.source.source) || !same(source.owner, owner))
|
|
92
|
+
throw new Error('usage source changed');
|
|
93
|
+
return source;
|
|
94
|
+
}
|
|
95
|
+
/** Synchronous nudge, bounded to 1000 heads. Native scan resumes the cursor. */
|
|
96
|
+
scan = () => {
|
|
97
|
+
if (!this.active || this.scanning)
|
|
98
|
+
return;
|
|
99
|
+
this.scanning = true;
|
|
100
|
+
try {
|
|
101
|
+
const owner = this.owner();
|
|
102
|
+
for (const job of this.store.pending(this.lane))
|
|
103
|
+
if (job.state === 'queued') {
|
|
104
|
+
try {
|
|
105
|
+
this.source(job);
|
|
106
|
+
this.schedule(job);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
this.store.settle(job.id, 'failed', 'queued-source-or-schedule-unavailable');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const scope = this.ports.evaluation.canonicalHostScope({ workspace: owner.workspace, preset: owner.agentPreset });
|
|
113
|
+
let stop = false;
|
|
114
|
+
for (let pageNumber = 0; pageNumber < 10 && !stop; pageNumber += 1) {
|
|
115
|
+
const page = this.ports.evaluation.listTrustedTaskLearningProjections({ scope,
|
|
116
|
+
...(this.store.cursor(this.lane) === undefined ? {} : { after: this.store.cursor(this.lane) }), limit: 100 });
|
|
117
|
+
for (const item of page.items) {
|
|
118
|
+
const canonical = item.receipt;
|
|
119
|
+
const source = canonical.projection.subjectKind === 'foreground-turn'
|
|
120
|
+
? this.ports.delivery.inspectOwnerForegroundLearningTask({ authorityId: owner.authorityId,
|
|
121
|
+
principalId: owner.principalId, workspace: owner.workspace, agentPreset: owner.agentPreset,
|
|
122
|
+
outcomeId: canonical.triggerOutcomeId }) : undefined;
|
|
123
|
+
const model = this.config.provider !== null && this.config.model !== null
|
|
124
|
+
? { provider: this.config.provider, model: this.config.model,
|
|
125
|
+
...(this.config.reasoningEffort === null ? {} : { reasoningEffort: this.config.reasoningEffort }) }
|
|
126
|
+
: source?.source.modelSelection;
|
|
127
|
+
const now = Date.now();
|
|
128
|
+
const occurredAt = canonical.objective?.occurredAt ?? 0;
|
|
129
|
+
const eligible = source !== undefined && source.source.quiescent && !source.source.truncated
|
|
130
|
+
&& canonical.projection.disposition === 'upsert' && source.judgement !== 'unresolved'
|
|
131
|
+
&& occurredAt <= now && now - occurredAt <= this.config.usageLearning.lookbackMs && model !== undefined;
|
|
132
|
+
const intent = eligible ? { configDigest: this.configDigest, source: source, model: model,
|
|
133
|
+
createdAt: now, expiresAt: now + this.config.usageLearning.lookbackMs } : undefined;
|
|
134
|
+
const result = this.ports.evaluation.withTrustedCanonicalTaskWriterFence({ scope, scopeWatermark: page.scopeWatermark,
|
|
135
|
+
evidence: [canonical.projection] }, () => {
|
|
136
|
+
if (!same(owner, this.owner()))
|
|
137
|
+
throw new Error('usage owner changed during scan');
|
|
138
|
+
return this.store.consume({ lane: this.lane, scopeKey: page.nextCursor.scopeKey, watermark: item.watermark,
|
|
139
|
+
subject: `${canonical.projection.subjectKind}:${canonical.projection.subjectRef}`,
|
|
140
|
+
...(intent === undefined ? {} : { intent }), maxPending: this.config.usageLearning.maxPending });
|
|
141
|
+
});
|
|
142
|
+
if (!result.matched || !result.value) {
|
|
143
|
+
stop = true;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (!page.hasMore)
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
for (const job of this.store.pending(this.lane))
|
|
151
|
+
if (job.state === 'queued') {
|
|
152
|
+
try {
|
|
153
|
+
this.schedule(job);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
this.store.settle(job.id, 'failed', 'schedule-rejected');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
this.lastError = null;
|
|
160
|
+
this.lastScanAt = Date.now();
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
this.lastError = error instanceof Error ? error.message.slice(0, 200) : 'usage-scan-failed';
|
|
164
|
+
}
|
|
165
|
+
finally {
|
|
166
|
+
this.scanning = false;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
definition(job) {
|
|
170
|
+
const scope = this.config.scope;
|
|
171
|
+
return { name: job ? 'Review real task feedback' : 'Discover real task feedback',
|
|
172
|
+
schedule: job ? { kind: 'at', at: new Date(job.intent.createdAt + 1000).toISOString() }
|
|
173
|
+
: { kind: 'cron', expression: '* * * * *', timezone: 'UTC' },
|
|
174
|
+
workspace: scope.workspace, agentPreset: scope.preset, timeoutMs: job ? this.config.maxDurationMs + 5000 : 30_000,
|
|
175
|
+
misfire: { kind: 'latest' }, overlap: 'skip', retrySafety: 'never', maxRetries: 0, principal: scope.principalId,
|
|
176
|
+
...(job ? { budgetId: this.config.budgetId, budgetAmount: this.config.budgetAmount }
|
|
177
|
+
: { budgetId: this.config.usageLearning.scanBudgetId, budgetAmount: this.config.usageLearning.scanBudgetAmount }),
|
|
178
|
+
execution: { kind: 'host', executorId: EXECUTOR, executorContractVersion: 1, runbookId: job ? 'review' : 'scan',
|
|
179
|
+
runbookVersion: 1, catalogDigest: CATALOG, targetScope: { workspace: scope.workspace, preset: scope.preset },
|
|
180
|
+
scopeDigest: acceptanceDigest([scope.workspace, scope.preset]), ownerRouteId: scope.ownerRouteId,
|
|
181
|
+
activationNonce: job?.digest ?? this.configDigest } };
|
|
182
|
+
}
|
|
183
|
+
schedule(input) {
|
|
184
|
+
let job = input;
|
|
185
|
+
this.source(job);
|
|
186
|
+
const definition = this.definition(job);
|
|
187
|
+
if (job.definitionHash === null) {
|
|
188
|
+
this.ports.automations.reconcileSystem({ owner: OWNER, automationId: job.id,
|
|
189
|
+
idempotencyKey: `${job.id}:prepare`, desiredStatus: 'paused', definition });
|
|
190
|
+
const receipt = this.ports.automations.inspectSystemOwnedActivation({ owner: OWNER, automationId: job.id });
|
|
191
|
+
if (!receipt || receipt.activationNonce !== job.digest || receipt.ownerRouteId !== this.config.scope.ownerRouteId)
|
|
192
|
+
throw new Error('usage registration mismatch');
|
|
193
|
+
job = this.store.bind(job.id, receipt.definitionHash);
|
|
194
|
+
}
|
|
195
|
+
const current = this.ports.automations.inspectSystemOwnedActivation({ owner: OWNER, automationId: job.id });
|
|
196
|
+
if (!current || current.definitionHash !== job.definitionHash || current.activationNonce !== job.digest)
|
|
197
|
+
throw new Error('usage definition changed');
|
|
198
|
+
const terminal = this.ports.automations.inspectSystemOwned({ owner: OWNER, automationId: job.id }).latestTerminalRuns.production;
|
|
199
|
+
if (terminal && terminal.immutableContext.state === 'verified' && terminal.immutableContext.definitionHash === job.definitionHash) {
|
|
200
|
+
this.store.settle(job.id, 'failed', 'native-run-ended-before-claim');
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.ports.automations.reconcileSystem({ owner: OWNER, automationId: job.id,
|
|
204
|
+
idempotencyKey: `${job.id}:activate`, desiredStatus: 'active', definition });
|
|
205
|
+
}
|
|
206
|
+
async execute(input) {
|
|
207
|
+
const result = (outcome) => ({ outcome,
|
|
208
|
+
failureClass: outcome === 'succeeded' ? 'none' : outcome === 'unknown' ? 'unknown' : 'configuration',
|
|
209
|
+
failurePhase: outcome === 'succeeded' ? 'none' : 'host-execution', failureCode: outcome === 'succeeded' ? 'none' : 'usage-review-rejected',
|
|
210
|
+
sideEffectState: outcome === 'unknown' ? 'unknown' : outcome === 'succeeded' ? 'possible' : 'none',
|
|
211
|
+
retryability: outcome === 'succeeded' || outcome === 'unknown' ? 'unsafe' : 'after-intervention' });
|
|
212
|
+
let claimed;
|
|
213
|
+
try {
|
|
214
|
+
const owner = this.owner();
|
|
215
|
+
if (input.executionMode !== 'production' || input.catalogDigest !== CATALOG || input.ownerRouteId !== owner.authorityId
|
|
216
|
+
|| input.principal !== owner.principalId || input.targetScope.workspace !== owner.workspace || input.targetScope.preset !== owner.agentPreset)
|
|
217
|
+
throw new Error('usage dispatch scope mismatch');
|
|
218
|
+
input.signal.throwIfAborted();
|
|
219
|
+
if (input.automationId === this.scanId) {
|
|
220
|
+
const current = this.ports.automations.inspectSystemOwnedActivation({ owner: OWNER, automationId: this.scanId });
|
|
221
|
+
if (input.activationNonce !== this.configDigest || current?.definitionHash !== input.definitionHash)
|
|
222
|
+
throw new Error('usage scanner changed');
|
|
223
|
+
this.scan();
|
|
224
|
+
return result(this.lastError === null ? 'succeeded' : 'failed');
|
|
225
|
+
}
|
|
226
|
+
const queued = this.store.get(input.automationId);
|
|
227
|
+
if (!queued || queued.state !== 'queued' || queued.digest !== input.activationNonce || queued.definitionHash !== input.definitionHash)
|
|
228
|
+
throw new Error('usage review is not queued');
|
|
229
|
+
this.source(queued);
|
|
230
|
+
claimed = this.store.claim(queued.id, input.definitionHash, input.occurrenceId);
|
|
231
|
+
const job = claimed;
|
|
232
|
+
const signal = AbortSignal.any([input.signal, this.abort.signal,
|
|
233
|
+
AbortSignal.timeout(Math.max(1, Math.min(this.config.maxDurationMs, job.intent.expiresAt - Date.now())))]);
|
|
234
|
+
const assertCurrent = () => {
|
|
235
|
+
signal.throwIfAborted();
|
|
236
|
+
this.source(job);
|
|
237
|
+
const stored = this.store.get(job.id);
|
|
238
|
+
if (stored?.state !== 'running' || stored.occurrenceId !== input.occurrenceId)
|
|
239
|
+
throw new Error('usage dispatch no longer owned');
|
|
240
|
+
};
|
|
241
|
+
assertCurrent();
|
|
242
|
+
const outcome = await this.ports.review({ id: job.id, model: job.intent.model, source: job.intent.source, signal, assertCurrent });
|
|
243
|
+
assertCurrent();
|
|
244
|
+
this.store.settle(job.id, outcome, outcome === 'reviewed' ? 'review-complete-not-adopted' : 'review-incomplete', input.occurrenceId);
|
|
245
|
+
return result(outcome === 'reviewed' ? 'succeeded' : outcome);
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
if (claimed)
|
|
249
|
+
this.store.settle(claimed.id, 'unknown', 'interrupted-after-dispatch', input.occurrenceId);
|
|
250
|
+
return result(claimed ? 'unknown' : 'failed');
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
if (this.active)
|
|
254
|
+
this.scan();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=usage-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-runtime.js","sourceRoot":"","sources":["../src/usage-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAEzE,OAAO,EAAE,UAAU,EAAoD,MAAM,kBAAkB,CAAA;AAE/F,MAAM,KAAK,GAAG,wBAAwB,CAAA;AACtC,MAAM,QAAQ,GAAG,2BAA2B,CAAA;AAC5C,MAAM,OAAO,GAAG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;AAYpE,MAAM,IAAI,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAA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AC,CAAC,CAAC,QAAQ,CAAC,CAAA;QAC/C,CAAC;gBAAS,CAAC;YAAC,IAAI,IAAI,CAAC,MAAM;gBAAE,IAAI,CAAC,IAAI,EAAE,CAAA;QAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { OwnerForegroundLearningTask } from '@dsh-enhanced/assistant-delivery';
|
|
2
|
+
export type UsageModel = Readonly<{
|
|
3
|
+
provider: string;
|
|
4
|
+
model: string;
|
|
5
|
+
reasoningEffort?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export interface UsageIntent {
|
|
8
|
+
configDigest: string;
|
|
9
|
+
source: OwnerForegroundLearningTask;
|
|
10
|
+
model: UsageModel;
|
|
11
|
+
createdAt: number;
|
|
12
|
+
expiresAt: number;
|
|
13
|
+
}
|
|
14
|
+
export interface UsageJob {
|
|
15
|
+
id: string;
|
|
16
|
+
intent: UsageIntent;
|
|
17
|
+
digest: string;
|
|
18
|
+
state: 'queued' | 'running' | 'reviewed' | 'failed' | 'unknown' | 'superseded';
|
|
19
|
+
definitionHash: string | null;
|
|
20
|
+
occurrenceId: string | null;
|
|
21
|
+
reason: string | null;
|
|
22
|
+
}
|
|
23
|
+
/** Intent/index only. Evaluation remains the sole task-result ledger. */
|
|
24
|
+
export declare class UsageStore {
|
|
25
|
+
private readonly db;
|
|
26
|
+
constructor(path: string);
|
|
27
|
+
close(): void;
|
|
28
|
+
cursor(lane: string): {
|
|
29
|
+
scopeKey: string;
|
|
30
|
+
watermark: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
get(id: string): UsageJob | undefined;
|
|
33
|
+
pending(lane: string): UsageJob[];
|
|
34
|
+
counts(lane: string): Readonly<Record<string, number>>;
|
|
35
|
+
/** Called only while the caller holds Evaluation's current canonical writer fence. */
|
|
36
|
+
consume(input: {
|
|
37
|
+
lane: string;
|
|
38
|
+
scopeKey: string;
|
|
39
|
+
watermark: number;
|
|
40
|
+
subject: string;
|
|
41
|
+
intent?: UsageIntent;
|
|
42
|
+
maxPending: number;
|
|
43
|
+
}): boolean;
|
|
44
|
+
interrupt(lane: string): void;
|
|
45
|
+
bind(id: string, definitionHash: string): UsageJob;
|
|
46
|
+
claim(id: string, definitionHash: string, occurrenceId: string): UsageJob;
|
|
47
|
+
settle(id: string, state: 'reviewed' | 'failed' | 'unknown' | 'superseded', reason: string, occurrenceId?: string): void;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=usage-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-store.d.ts","sourceRoot":"","sources":["../src/usage-store.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAEnF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAChG,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,2BAA2B,CAAA;IACnC,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AACD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAA;IAC9E,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAKD,yEAAyE;AACzE,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAA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