@harrylabsj/kiwi 0.7.21 → 0.7.22

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.
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Copyright 2026 harrylabsj
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Buyer-owned supplier relationship store(pull-relationship 设计 v0.1 §6)。
18
+ *
19
+ * Relationship 是跨任务、生命周期更长的 Buyer 私有状态,与一次性商业任务
20
+ * (buyer_tasks)分离:同一 SQLite,独立表。所有调度时间(next_check_at)
21
+ * 落库,重启后只凭数据库恢复,不依赖进程内 timer。
22
+ *
23
+ * supplier_observations 只存规范化事实差异(§6.3)——payload 是 diff 结果,
24
+ * 绝不保存可执行远程内容;远程文本不进入本表之外的任何 prompt 上下文。
25
+ */
26
+ import type { DatabaseSync } from "node:sqlite";
27
+ export type SupplierRelationshipType = "saved" | "watched" | "preferred";
28
+ export type SupplierRelationshipStatus = "active" | "paused" | "review_required" | "expired" | "deleted";
29
+ export type SupplierConsentSource = "human_explicit" | "delegated_policy";
30
+ export type SupplierSourceType = "catalog_search" | "agent_card" | "ucp_profile" | "ucp_catalog";
31
+ export type SupplierObservationKind = "listing_added" | "listing_updated" | "listing_withdrawn" | "capability_changed" | "availability_hint_changed" | "lead_time_hint_changed" | "profile_or_identity_changed" | "freshness_changed" | "unreachable";
32
+ export interface SupplierRelationship {
33
+ relationship_id: string;
34
+ principal_id: string;
35
+ merchant_id: string;
36
+ canonical_domain: string;
37
+ agent_card_url: string;
38
+ ucp_profile_url?: string;
39
+ relationship_type: SupplierRelationshipType;
40
+ scope: Record<string, unknown>;
41
+ policy: Record<string, unknown>;
42
+ consent_source: SupplierConsentSource;
43
+ status: SupplierRelationshipStatus;
44
+ /** M3 receipt 预留(§10):M1 恒为 'none',不实现 receipt 收发。 */
45
+ receipt_status: "none" | "attested" | "revoke_pending";
46
+ receipt_expires_at?: string;
47
+ created_at: string;
48
+ updated_at: string;
49
+ expires_at?: string;
50
+ }
51
+ export interface SupplierObservationState {
52
+ relationship_id: string;
53
+ source_type: SupplierSourceType;
54
+ source_url_or_ref?: string;
55
+ etag?: string;
56
+ last_modified?: string;
57
+ source_revision?: string;
58
+ content_digest?: string;
59
+ /** 上一次成功拉取的规范化快照(固定 DTO 字段),供下次 diff。 */
60
+ snapshot?: Record<string, unknown>;
61
+ last_checked_at?: string;
62
+ last_success_at?: string;
63
+ next_check_at?: string;
64
+ failure_count: number;
65
+ backoff_until?: string;
66
+ unchanged_count: number;
67
+ last_verified_fingerprint?: string;
68
+ }
69
+ export interface SupplierObservation {
70
+ observation_id: string;
71
+ relationship_id: string;
72
+ kind: SupplierObservationKind;
73
+ source_type: SupplierSourceType;
74
+ payload: Record<string, unknown>;
75
+ content_digest: string;
76
+ observed_at: string;
77
+ fresh_until?: string;
78
+ verified: boolean;
79
+ }
80
+ export type SupplierStoreErrorCode = "validation" | "not_found";
81
+ export declare class SupplierStoreError extends Error {
82
+ readonly code: SupplierStoreErrorCode;
83
+ constructor(code: SupplierStoreErrorCode, message: string);
84
+ }
85
+ export interface SupplierRelationshipStoreOptions {
86
+ db: DatabaseSync;
87
+ principalId: string;
88
+ now?: () => string;
89
+ }
90
+ export declare class SupplierRelationshipStore {
91
+ private readonly db;
92
+ private readonly principalId;
93
+ private readonly now;
94
+ constructor(options: SupplierRelationshipStoreOptions);
95
+ saveRelationship(input: {
96
+ merchant_id: string;
97
+ canonical_domain: string;
98
+ agent_card_url: string;
99
+ ucp_profile_url?: string;
100
+ relationship_type: SupplierRelationshipType;
101
+ scope?: Record<string, unknown>;
102
+ policy?: Record<string, unknown>;
103
+ consent_source?: SupplierConsentSource;
104
+ expires_at?: string;
105
+ }): SupplierRelationship;
106
+ getRelationship(relationshipId: string): SupplierRelationship | undefined;
107
+ listRelationships(filter?: {
108
+ statuses?: SupplierRelationshipStatus[];
109
+ includeDeleted?: boolean;
110
+ }): SupplierRelationship[];
111
+ /**
112
+ * 状态流转。'deleted' 是软删:立即停止后续拉取(清除所有来源的
113
+ * next_check_at),历史 observation 与审计记录保留(§11)。
114
+ */
115
+ updateStatus(relationshipId: string, status: SupplierRelationshipStatus): SupplierRelationship;
116
+ updatePolicy(relationshipId: string, patch: {
117
+ scope?: Record<string, unknown>;
118
+ policy?: Record<string, unknown>;
119
+ expires_at?: string | null;
120
+ }): SupplierRelationship;
121
+ /**
122
+ * Scheduler 输入:到期关系(§8)。只轮询 watched/preferred;saved 不拉取。
123
+ * 关系无任何观察状态行(从未检查)视为立即到期;有状态行时要求至少一个
124
+ * 来源 next_check_at <= now 且不在退避窗口内。已过期(expires_at)与
125
+ * paused/review_required/deleted 关系不出现在轮询队列。
126
+ */
127
+ dueRelationships(now: string, limit: number): SupplierRelationship[];
128
+ /** active 且 expires_at 已过的关系(scheduler 惰性过期清扫用)。 */
129
+ expirableRelationships(now: string): SupplierRelationship[];
130
+ getState(relationshipId: string, sourceType: SupplierSourceType): SupplierObservationState | undefined;
131
+ statesFor(relationshipId: string): SupplierObservationState[];
132
+ /**
133
+ * 记录一次成功拉取的来源状态:digest / snapshot / 指纹 / 调度时间。
134
+ * unchanged=true 时递增 unchanged_count(无变化逐步放慢,§8),否则清零。
135
+ */
136
+ recordSourceSuccess(relationshipId: string, sourceType: SupplierSourceType, input: {
137
+ checked_at: string;
138
+ next_check_at: string;
139
+ source_url_or_ref?: string;
140
+ etag?: string;
141
+ last_modified?: string;
142
+ source_revision?: string;
143
+ content_digest?: string;
144
+ snapshot?: Record<string, unknown>;
145
+ last_verified_fingerprint?: string;
146
+ unchanged: boolean;
147
+ }): void;
148
+ /** 失败退避:failure_count++,下次检查推迟到 backoffAt(含 jitter,由调用方算)。 */
149
+ recordSourceFailure(relationshipId: string, sourceType: SupplierSourceType, input: {
150
+ checked_at: string;
151
+ backoff_at: string;
152
+ }): void;
153
+ /** content_digest 去重(§6.3):同一变化重复观察到时不重复落账。 */
154
+ addObservation(input: {
155
+ relationship_id: string;
156
+ kind: SupplierObservationKind;
157
+ source_type: SupplierSourceType;
158
+ payload: Record<string, unknown>;
159
+ content_digest: string;
160
+ observed_at: string;
161
+ fresh_until?: string;
162
+ verified?: boolean;
163
+ }): {
164
+ added: boolean;
165
+ observation_id: string;
166
+ };
167
+ listObservations(relationshipId: string, limit?: number): SupplierObservation[];
168
+ private rowToRelationship;
169
+ private rowToState;
170
+ private rowToObservation;
171
+ }
@@ -0,0 +1,343 @@
1
+ /**
2
+ * Copyright 2026 harrylabsj
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { uuidv7 } from "@earendil-works/pi-ai";
17
+ export class SupplierStoreError extends Error {
18
+ code;
19
+ constructor(code, message) {
20
+ super(message);
21
+ this.name = "SupplierStoreError";
22
+ this.code = code;
23
+ }
24
+ }
25
+ const RELATIONSHIP_TYPES = ["saved", "watched", "preferred"];
26
+ const RELATIONSHIP_STATUSES = [
27
+ "active",
28
+ "paused",
29
+ "review_required",
30
+ "expired",
31
+ "deleted",
32
+ ];
33
+ function opt(value) {
34
+ return value === null ? undefined : value;
35
+ }
36
+ export class SupplierRelationshipStore {
37
+ db;
38
+ principalId;
39
+ now;
40
+ constructor(options) {
41
+ this.db = options.db;
42
+ this.principalId = options.principalId;
43
+ // Normalize to UTC ISO: SQLite compares timestamps lexicographically.
44
+ const clock = options.now ?? (() => new Date().toISOString());
45
+ this.now = () => new Date(Date.parse(clock())).toISOString();
46
+ }
47
+ // ---- relationships ---------------------------------------------------------
48
+ saveRelationship(input) {
49
+ if (!RELATIONSHIP_TYPES.includes(input.relationship_type)) {
50
+ throw new SupplierStoreError("validation", `relationship_type must be one of ${RELATIONSHIP_TYPES.join("/")}`);
51
+ }
52
+ if (input.merchant_id.trim() === "" || input.canonical_domain.trim() === "") {
53
+ throw new SupplierStoreError("validation", "merchant_id and canonical_domain are required");
54
+ }
55
+ let expiresAt = null;
56
+ if (input.expires_at !== undefined) {
57
+ const t = Date.parse(input.expires_at);
58
+ if (Number.isNaN(t)) {
59
+ throw new SupplierStoreError("validation", "expires_at must be an RFC3339 timestamp");
60
+ }
61
+ expiresAt = new Date(t).toISOString();
62
+ }
63
+ const now = this.now();
64
+ const id = `rel_${uuidv7()}`;
65
+ this.db
66
+ .prepare(`INSERT INTO supplier_relationships
67
+ (relationship_id, principal_id, merchant_id, canonical_domain, agent_card_url,
68
+ ucp_profile_url, relationship_type, scope_json, policy_json, consent_source,
69
+ status, created_at, updated_at, expires_at)
70
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'active', ?, ?, ?)`)
71
+ .run(id, this.principalId, input.merchant_id, input.canonical_domain, input.agent_card_url, input.ucp_profile_url ?? null, input.relationship_type, JSON.stringify(input.scope ?? {}), JSON.stringify(input.policy ?? {}), input.consent_source ?? "human_explicit", now, now, expiresAt);
72
+ return this.getRelationship(id);
73
+ }
74
+ getRelationship(relationshipId) {
75
+ const row = this.db
76
+ .prepare("SELECT * FROM supplier_relationships WHERE relationship_id = ? AND principal_id = ?")
77
+ .get(relationshipId, this.principalId);
78
+ return row === undefined ? undefined : this.rowToRelationship(row);
79
+ }
80
+ listRelationships(filter = {}) {
81
+ const statuses = filter.statuses ??
82
+ (filter.includeDeleted === true
83
+ ? [...RELATIONSHIP_STATUSES]
84
+ : RELATIONSHIP_STATUSES.filter((s) => s !== "deleted"));
85
+ const rows = this.db
86
+ .prepare(`SELECT * FROM supplier_relationships
87
+ WHERE principal_id = ? AND (${statuses.map(() => "status = ?").join(" OR ")})
88
+ ORDER BY created_at, relationship_id`)
89
+ .all(this.principalId, ...statuses);
90
+ return rows.map((r) => this.rowToRelationship(r));
91
+ }
92
+ /**
93
+ * 状态流转。'deleted' 是软删:立即停止后续拉取(清除所有来源的
94
+ * next_check_at),历史 observation 与审计记录保留(§11)。
95
+ */
96
+ updateStatus(relationshipId, status) {
97
+ if (!RELATIONSHIP_STATUSES.includes(status)) {
98
+ throw new SupplierStoreError("validation", `illegal status ${status}`);
99
+ }
100
+ const existing = this.getRelationship(relationshipId);
101
+ if (existing === undefined) {
102
+ throw new SupplierStoreError("not_found", `no relationship ${relationshipId}`);
103
+ }
104
+ const now = this.now();
105
+ this.db.exec("BEGIN");
106
+ try {
107
+ this.db
108
+ .prepare("UPDATE supplier_relationships SET status = ?, updated_at = ? WHERE relationship_id = ?")
109
+ .run(status, now, relationshipId);
110
+ if (status === "deleted") {
111
+ this.db
112
+ .prepare("UPDATE supplier_observation_state SET next_check_at = NULL, backoff_until = NULL WHERE relationship_id = ?")
113
+ .run(relationshipId);
114
+ }
115
+ this.db.exec("COMMIT");
116
+ }
117
+ catch (err) {
118
+ this.db.exec("ROLLBACK");
119
+ throw err;
120
+ }
121
+ return this.getRelationship(relationshipId);
122
+ }
123
+ updatePolicy(relationshipId, patch) {
124
+ const existing = this.getRelationship(relationshipId);
125
+ if (existing === undefined) {
126
+ throw new SupplierStoreError("not_found", `no relationship ${relationshipId}`);
127
+ }
128
+ let expiresAt;
129
+ if (patch.expires_at === null) {
130
+ expiresAt = null;
131
+ }
132
+ else if (patch.expires_at !== undefined) {
133
+ const t = Date.parse(patch.expires_at);
134
+ if (Number.isNaN(t)) {
135
+ throw new SupplierStoreError("validation", "expires_at must be an RFC3339 timestamp");
136
+ }
137
+ expiresAt = new Date(t).toISOString();
138
+ }
139
+ this.db
140
+ .prepare(`UPDATE supplier_relationships
141
+ SET scope_json = ?, policy_json = ?, expires_at = ?, updated_at = ?
142
+ WHERE relationship_id = ?`)
143
+ .run(JSON.stringify(patch.scope ?? existing.scope), JSON.stringify(patch.policy ?? existing.policy), expiresAt === undefined ? (existing.expires_at ?? null) : expiresAt, this.now(), relationshipId);
144
+ return this.getRelationship(relationshipId);
145
+ }
146
+ /**
147
+ * Scheduler 输入:到期关系(§8)。只轮询 watched/preferred;saved 不拉取。
148
+ * 关系无任何观察状态行(从未检查)视为立即到期;有状态行时要求至少一个
149
+ * 来源 next_check_at <= now 且不在退避窗口内。已过期(expires_at)与
150
+ * paused/review_required/deleted 关系不出现在轮询队列。
151
+ */
152
+ dueRelationships(now, limit) {
153
+ const rows = this.db
154
+ .prepare(`SELECT r.* FROM supplier_relationships r
155
+ WHERE r.principal_id = ? AND r.status = 'active'
156
+ AND r.relationship_type IN ('watched','preferred')
157
+ AND (r.expires_at IS NULL OR r.expires_at > ?)
158
+ AND (
159
+ NOT EXISTS (
160
+ SELECT 1 FROM supplier_observation_state s
161
+ WHERE s.relationship_id = r.relationship_id
162
+ )
163
+ OR EXISTS (
164
+ SELECT 1 FROM supplier_observation_state s
165
+ WHERE s.relationship_id = r.relationship_id
166
+ AND s.next_check_at IS NOT NULL AND s.next_check_at <= ?
167
+ AND (s.backoff_until IS NULL OR s.backoff_until <= ?)
168
+ )
169
+ )
170
+ ORDER BY r.created_at, r.relationship_id LIMIT ?`)
171
+ .all(this.principalId, now, now, now, limit);
172
+ return rows.map((r) => this.rowToRelationship(r));
173
+ }
174
+ /** active 且 expires_at 已过的关系(scheduler 惰性过期清扫用)。 */
175
+ expirableRelationships(now) {
176
+ const rows = this.db
177
+ .prepare(`SELECT * FROM supplier_relationships
178
+ WHERE principal_id = ? AND status = 'active'
179
+ AND expires_at IS NOT NULL AND expires_at <= ?`)
180
+ .all(this.principalId, now);
181
+ return rows.map((r) => this.rowToRelationship(r));
182
+ }
183
+ // ---- observation state -------------------------------------------------------
184
+ getState(relationshipId, sourceType) {
185
+ const row = this.db
186
+ .prepare("SELECT * FROM supplier_observation_state WHERE relationship_id = ? AND source_type = ?")
187
+ .get(relationshipId, sourceType);
188
+ return row === undefined ? undefined : this.rowToState(row);
189
+ }
190
+ statesFor(relationshipId) {
191
+ const rows = this.db
192
+ .prepare("SELECT * FROM supplier_observation_state WHERE relationship_id = ? ORDER BY source_type")
193
+ .all(relationshipId);
194
+ return rows.map((r) => this.rowToState(r));
195
+ }
196
+ /**
197
+ * 记录一次成功拉取的来源状态:digest / snapshot / 指纹 / 调度时间。
198
+ * unchanged=true 时递增 unchanged_count(无变化逐步放慢,§8),否则清零。
199
+ */
200
+ recordSourceSuccess(relationshipId, sourceType, input) {
201
+ const previous = this.getState(relationshipId, sourceType);
202
+ const unchangedCount = input.unchanged ? (previous?.unchanged_count ?? 0) + 1 : 0;
203
+ this.db
204
+ .prepare(`INSERT INTO supplier_observation_state
205
+ (relationship_id, source_type, source_url_or_ref, etag, last_modified, source_revision,
206
+ content_digest, snapshot_json, last_checked_at, last_success_at, next_check_at,
207
+ failure_count, backoff_until, unchanged_count, last_verified_fingerprint)
208
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, NULL, ?, ?)
209
+ ON CONFLICT (relationship_id, source_type) DO UPDATE SET
210
+ source_url_or_ref = excluded.source_url_or_ref,
211
+ etag = excluded.etag,
212
+ last_modified = excluded.last_modified,
213
+ source_revision = excluded.source_revision,
214
+ content_digest = excluded.content_digest,
215
+ snapshot_json = excluded.snapshot_json,
216
+ last_checked_at = excluded.last_checked_at,
217
+ last_success_at = excluded.last_success_at,
218
+ next_check_at = excluded.next_check_at,
219
+ failure_count = 0,
220
+ backoff_until = NULL,
221
+ unchanged_count = excluded.unchanged_count,
222
+ last_verified_fingerprint = COALESCE(
223
+ excluded.last_verified_fingerprint,
224
+ supplier_observation_state.last_verified_fingerprint
225
+ )`)
226
+ .run(relationshipId, sourceType, input.source_url_or_ref ?? previous?.source_url_or_ref ?? null, input.etag ?? null, input.last_modified ?? null, input.source_revision ?? null, input.content_digest ?? null, input.snapshot !== undefined ? JSON.stringify(input.snapshot) : null, input.checked_at, input.checked_at, input.next_check_at, unchangedCount, input.last_verified_fingerprint ?? null);
227
+ }
228
+ /** 失败退避:failure_count++,下次检查推迟到 backoffAt(含 jitter,由调用方算)。 */
229
+ recordSourceFailure(relationshipId, sourceType, input) {
230
+ this.db
231
+ .prepare(`INSERT INTO supplier_observation_state
232
+ (relationship_id, source_type, last_checked_at, next_check_at, failure_count,
233
+ backoff_until, unchanged_count)
234
+ VALUES (?, ?, ?, ?, 1, ?, 0)
235
+ ON CONFLICT (relationship_id, source_type) DO UPDATE SET
236
+ last_checked_at = excluded.last_checked_at,
237
+ next_check_at = excluded.next_check_at,
238
+ failure_count = supplier_observation_state.failure_count + 1,
239
+ backoff_until = excluded.backoff_until,
240
+ unchanged_count = 0`)
241
+ .run(relationshipId, sourceType, input.checked_at, input.backoff_at, input.backoff_at);
242
+ }
243
+ // ---- observations ---------------------------------------------------------
244
+ /** content_digest 去重(§6.3):同一变化重复观察到时不重复落账。 */
245
+ addObservation(input) {
246
+ const existing = this.db
247
+ .prepare(`SELECT observation_id FROM supplier_observations
248
+ WHERE relationship_id = ? AND kind = ? AND content_digest = ?`)
249
+ .get(input.relationship_id, input.kind, input.content_digest);
250
+ if (existing !== undefined) {
251
+ return { added: false, observation_id: existing.observation_id };
252
+ }
253
+ const observationId = `sobs_${uuidv7()}`;
254
+ this.db
255
+ .prepare(`INSERT INTO supplier_observations
256
+ (observation_id, relationship_id, kind, source_type, payload_json, content_digest,
257
+ observed_at, fresh_until, verified)
258
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`)
259
+ .run(observationId, input.relationship_id, input.kind, input.source_type, JSON.stringify(input.payload), input.content_digest, input.observed_at, input.fresh_until ?? null, input.verified === true ? 1 : 0);
260
+ return { added: true, observation_id: observationId };
261
+ }
262
+ listObservations(relationshipId, limit = 50) {
263
+ const rows = this.db
264
+ .prepare(`SELECT * FROM supplier_observations
265
+ WHERE relationship_id = ? ORDER BY observed_at DESC, observation_id DESC LIMIT ?`)
266
+ .all(relationshipId, limit);
267
+ return rows.map((r) => this.rowToObservation(r));
268
+ }
269
+ // ---- row mapping ------------------------------------------------------------
270
+ rowToRelationship(row) {
271
+ const rel = {
272
+ relationship_id: row.relationship_id,
273
+ principal_id: row.principal_id,
274
+ merchant_id: row.merchant_id,
275
+ canonical_domain: row.canonical_domain,
276
+ agent_card_url: row.agent_card_url,
277
+ relationship_type: row.relationship_type,
278
+ scope: JSON.parse(row.scope_json),
279
+ policy: JSON.parse(row.policy_json),
280
+ consent_source: row.consent_source,
281
+ status: row.status,
282
+ receipt_status: row.receipt_status,
283
+ created_at: row.created_at,
284
+ updated_at: row.updated_at,
285
+ };
286
+ const ucp = opt(row.ucp_profile_url);
287
+ if (ucp !== undefined)
288
+ rel.ucp_profile_url = ucp;
289
+ const receiptExpires = opt(row.receipt_expires_at);
290
+ if (receiptExpires !== undefined)
291
+ rel.receipt_expires_at = receiptExpires;
292
+ const expires = opt(row.expires_at);
293
+ if (expires !== undefined)
294
+ rel.expires_at = expires;
295
+ return rel;
296
+ }
297
+ rowToState(row) {
298
+ const state = {
299
+ relationship_id: row.relationship_id,
300
+ source_type: row.source_type,
301
+ failure_count: row.failure_count,
302
+ unchanged_count: row.unchanged_count,
303
+ };
304
+ const assign = (key, column) => {
305
+ const value = opt(row[column]);
306
+ if (value !== undefined) {
307
+ state[key] = value;
308
+ }
309
+ };
310
+ assign("source_url_or_ref", "source_url_or_ref");
311
+ assign("etag", "etag");
312
+ assign("last_modified", "last_modified");
313
+ assign("source_revision", "source_revision");
314
+ assign("content_digest", "content_digest");
315
+ assign("last_checked_at", "last_checked_at");
316
+ assign("last_success_at", "last_success_at");
317
+ assign("next_check_at", "next_check_at");
318
+ assign("backoff_until", "backoff_until");
319
+ assign("last_verified_fingerprint", "last_verified_fingerprint");
320
+ const snapshot = opt(row.snapshot_json);
321
+ if (snapshot !== undefined) {
322
+ state.snapshot = JSON.parse(snapshot);
323
+ }
324
+ return state;
325
+ }
326
+ rowToObservation(row) {
327
+ const obs = {
328
+ observation_id: row.observation_id,
329
+ relationship_id: row.relationship_id,
330
+ kind: row.kind,
331
+ source_type: row.source_type,
332
+ payload: JSON.parse(row.payload_json),
333
+ content_digest: row.content_digest,
334
+ observed_at: row.observed_at,
335
+ verified: row.verified === 1,
336
+ };
337
+ const freshUntil = opt(row.fresh_until);
338
+ if (freshUntil !== undefined)
339
+ obs.fresh_until = freshUntil;
340
+ return obs;
341
+ }
342
+ }
343
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/agent/supplier/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AA2E/C,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAAyB;IACtC,YAAY,IAA4B,EAAE,OAAe;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAQD,MAAM,kBAAkB,GAAwC,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAClG,MAAM,qBAAqB,GAA0C;IACnE,QAAQ;IACR,QAAQ;IACR,iBAAiB;IACjB,SAAS;IACT,SAAS;CACV,CAAC;AAEF,SAAS,GAAG,CAAC,KAAoB;IAC/B,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AAC5C,CAAC;AAED,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GAAwB;YAC/B,cAAc,EAAE,GAAG,CAAC,cAAwB;YAC5C,eAAe,EAAE,GAAG,CAAC,eAAyB;YAC9C,IAAI,EAAE,GAAG,CAAC,IAA+B;YACzC,WAAW,EAAE,GAAG,CAAC,WAAiC;YAClD,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAsB,CAA4B;YAC1E,cAAc,EAAE,GAAG,CAAC,cAAwB;YAC5C,WAAW,EAAE,GAAG,CAAC,WAAqB;YACtC,QAAQ,EAAE,GAAG,CAAC,QAAQ,KAAK,CAAC;SAC7B,CAAC;QACF,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,WAA4B,CAAC,CAAC;QACzD,IAAI,UAAU,KAAK,SAAS;YAAE,GAAG,CAAC,WAAW,GAAG,UAAU,CAAC;QAC3D,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
package/dist/cli.d.ts CHANGED
@@ -56,6 +56,11 @@ interface ParsedArgs {
56
56
  check: boolean;
57
57
  caddyfile?: string;
58
58
  file?: string;
59
+ yes: boolean;
60
+ query?: string;
61
+ interval?: string;
62
+ scope?: string;
63
+ expires?: string;
59
64
  }
60
65
  /** 导出供测试(审查 P2-L:--a2a flag 解析回归锁定)。 */
61
66
  export declare function parseArgs(argv: string[]): ParsedArgs;