@cat-factory/integrations 0.172.16 → 0.173.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/documents/DocumentPlannerService.d.ts +1 -1
- package/dist/modules/documents/DocumentPlannerService.d.ts.map +1 -1
- package/dist/modules/documents/DocumentPlannerService.js +10 -3
- package/dist/modules/documents/DocumentPlannerService.js.map +1 -1
- package/dist/modules/providers/PersonalSubscriptionService.d.ts +38 -17
- package/dist/modules/providers/PersonalSubscriptionService.d.ts.map +1 -1
- package/dist/modules/providers/PersonalSubscriptionService.js +45 -23
- package/dist/modules/providers/PersonalSubscriptionService.js.map +1 -1
- package/dist/modules/tasks/BugHuntService.d.ts +1 -1
- package/dist/modules/tasks/BugHuntService.d.ts.map +1 -1
- package/dist/modules/tasks/BugHuntService.js +17 -8
- package/dist/modules/tasks/BugHuntService.js.map +1 -1
- package/package.json +4 -4
|
@@ -27,6 +27,6 @@ export declare class DocumentPlannerService {
|
|
|
27
27
|
* caller is about to spawn into one frame and a whole architecture flattened into it is the
|
|
28
28
|
* discarding the target-aware path exists to prevent.
|
|
29
29
|
*/
|
|
30
|
-
plan(record: DocumentRecord, target?: PlanTarget): Promise<DocumentBoardPlan>;
|
|
30
|
+
plan(record: DocumentRecord, target?: PlanTarget, askedByUserId?: string): Promise<DocumentBoardPlan>;
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=DocumentPlannerService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentPlannerService.d.ts","sourceRoot":"","sources":["../../../src/modules/documents/DocumentPlannerService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA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ACnB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAiD5B;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { generateText } from 'ai';
|
|
2
|
-
import { catFactoryObservability, extractJson } from '@cat-factory/kernel';
|
|
2
|
+
import { catFactoryObservability, extractJson, resolveInlineScope } from '@cat-factory/kernel';
|
|
3
3
|
import { isDesignSource } from '@cat-factory/contracts';
|
|
4
4
|
import { coercePlan, coerceTargetedPlan, markdownToText, planFromHeadings, } from './documents.logic.js';
|
|
5
5
|
// DocumentPlannerService: turns an imported document into a proposed board
|
|
@@ -124,14 +124,21 @@ export class DocumentPlannerService {
|
|
|
124
124
|
* caller is about to spawn into one frame and a whole architecture flattened into it is the
|
|
125
125
|
* discarding the target-aware path exists to prevent.
|
|
126
126
|
*/
|
|
127
|
-
async plan(record, target) {
|
|
127
|
+
async plan(record, target, askedByUserId) {
|
|
128
128
|
const fallback = () => planFromHeadings(record.source, record.externalId, record.title, record.body, target);
|
|
129
129
|
if (!this.deps.modelRef || (!this.deps.modelProviderResolver && !this.deps.modelProvider)) {
|
|
130
130
|
return fallback();
|
|
131
131
|
}
|
|
132
132
|
try {
|
|
133
|
+
// The IMPORT arrives on a webhook or a sync sweep; this PLAN does not. It is a member
|
|
134
|
+
// pressing "preview"/"spawn" on a page, so there is a signed-in asker to name, and naming
|
|
135
|
+
// them is what puts their own API keys and local model endpoints in the pool. No run, ever:
|
|
136
|
+
// a plan is a preview, and nothing has been started for it to belong to. An unauthenticated
|
|
137
|
+
// deployment has no asker, which narrows the pool and is stated rather than defaulted.
|
|
133
138
|
const provider = this.deps.modelProviderResolver
|
|
134
|
-
? await this.deps.modelProviderResolver.forScope(
|
|
139
|
+
? await this.deps.modelProviderResolver.forScope(await resolveInlineScope(askedByUserId
|
|
140
|
+
? { kind: 'user', workspaceId: record.workspaceId, userId: askedByUserId }
|
|
141
|
+
: { kind: 'workspace', workspaceId: record.workspaceId }))
|
|
135
142
|
: this.deps.modelProvider;
|
|
136
143
|
const model = provider.resolve(this.deps.modelRef);
|
|
137
144
|
const { text } = await generateText({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentPlannerService.js","sourceRoot":"","sources":["../../../src/modules/documents/DocumentPlannerService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AAIjC,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"DocumentPlannerService.js","sourceRoot":"","sources":["../../../src/modules/documents/DocumentPlannerService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AAIjC,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GAEjB,MAAM,sBAAsB,CAAA;AAE7B,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,gFAAgF;AAChF,iFAAiF;AACjF,sCAAsC;AACtC,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,gGAAgG;AAChG,kGAAkG;AAClG,6FAA6F;AAC7F,kFAAkF;AAClF,qFAAqF;AACrF,+FAA+F;AAC/F,8FAA8F;AAC9F,4EAA4E;AAE5E,MAAM,cAAc,GAAG,IAAI,CAAA;AAc3B,MAAM,aAAa,GACjB,uFAAuF;IACvF,0FAA0F;IAC1F,uFAAuF,CAAA;AAEzF;;;;;GAKG;AACH,MAAM,sBAAsB,GAC1B,yFAAyF;IACzF,4FAA4F;IAC5F,2FAA2F;IAC3F,cAAc,CAAA;AAEhB;;;;;;;GAOG;AACH,MAAM,eAAe,GAAG;IACtB,8FAA8F;IAC9F,4FAA4F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,CAAC;YACP,2FAA2F;YAC3F,2FAA2F;YAC3F,gEAAgE;YAChE,OAAO,QAAQ,EAAE,CAAA;QACnB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Clock, IdGenerator, PersonalSecretCipher, PersonalSubscriptionRecord, PersonalSubscriptionRepository, SecretCipher, SubscriptionActivationRepository, SubscriptionVendor } from '@cat-factory/kernel';
|
|
1
|
+
import type { ActivationScopeId, Clock, IdGenerator, PersonalSecretCipher, PersonalSubscriptionRecord, PersonalSubscriptionRepository, SecretCipher, SubscriptionActivationRepository, SubscriptionVendor } from '@cat-factory/kernel';
|
|
2
2
|
import type { PersonalSubscriptionStatus, StorePersonalSubscriptionInput } from '@cat-factory/contracts';
|
|
3
3
|
/**
|
|
4
4
|
* Default per-run activation lifetime (~12h). This bounds the window in which the
|
|
@@ -73,7 +73,21 @@ export declare class PersonalSubscriptionService {
|
|
|
73
73
|
liveVendors(userId: string): Promise<Set<SubscriptionVendor>>;
|
|
74
74
|
/** Whether the user has a live personal credential for the vendor. */
|
|
75
75
|
has(userId: string, vendor: SubscriptionVendor): Promise<boolean>;
|
|
76
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Remove the user's personal credential for a vendor, and drop the USER-scope activations it
|
|
78
|
+
* could still be leased through.
|
|
79
|
+
*
|
|
80
|
+
* The activation is a separate copy of the same token, re-encrypted with the system key alone,
|
|
81
|
+
* so soft-deleting the subscription does not revoke it: without this, disconnecting a
|
|
82
|
+
* subscription would leave it usable from the run-less surfaces for the rest of the ~12h TTL,
|
|
83
|
+
* with nothing but the sweep to reclaim it.
|
|
84
|
+
*
|
|
85
|
+
* The whole user scope goes, not the vendor's row alone. A user's credentials share ONE
|
|
86
|
+
* password, so removing one is usually the first half of re-sealing them all, and a re-mint
|
|
87
|
+
* costs the next request that carries the password nothing but the derivation it would have
|
|
88
|
+
* paid anyway. RUN activations are deliberately left: consent there was given for a specific
|
|
89
|
+
* run whose dispatches are already in flight, and the run settling clears them itself.
|
|
90
|
+
*/
|
|
77
91
|
remove(userId: string, vendor: SubscriptionVendor): Promise<void>;
|
|
78
92
|
/**
|
|
79
93
|
* Decrypt the user's credential with their password, returning the raw token.
|
|
@@ -82,20 +96,27 @@ export declare class PersonalSubscriptionService {
|
|
|
82
96
|
*/
|
|
83
97
|
unlock(userId: string, vendor: SubscriptionVendor, password: string): Promise<string>;
|
|
84
98
|
/**
|
|
85
|
-
* Mint a
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
99
|
+
* Mint an activation for a SCOPE: unlock the credential with the password, re-encrypt the raw
|
|
100
|
+
* token with the system key only, and store it under `scopeId` with a TTL so work that outlives
|
|
101
|
+
* the request can use it without the password. Idempotent: replaces any prior activation for the
|
|
102
|
+
* scope+user+vendor.
|
|
103
|
+
*
|
|
104
|
+
* The scope decides who may lease it and when it goes away, never this method: a run's
|
|
105
|
+
* activation dies with the run, a user's on its TTL. See {@link ActivationScopeId}.
|
|
89
106
|
*/
|
|
90
|
-
|
|
107
|
+
activate(scopeId: ActivationScopeId, userId: string, vendor: SubscriptionVendor, password: string): Promise<void>;
|
|
91
108
|
/**
|
|
92
|
-
* Lease the
|
|
93
|
-
* (`password_required`) when the
|
|
94
|
-
*
|
|
109
|
+
* Lease the scope's activated token. Throws a {@link CredentialRequiredError}
|
|
110
|
+
* (`password_required`) when the scope has no live activation; every caller turns that into a
|
|
111
|
+
* clear, retriable failure the user answers by re-entering their password.
|
|
112
|
+
*
|
|
113
|
+
* The message names no scope KIND on purpose. The remedy is identical either way, and the two
|
|
114
|
+
* spellings ("this run has no credential" for a turn nobody started a run for) mislead in
|
|
115
|
+
* exactly the situation a person is already confused in.
|
|
95
116
|
*/
|
|
96
|
-
|
|
117
|
+
lease(scopeId: ActivationScopeId, userId: string, vendor: SubscriptionVendor): Promise<LeasedPersonalToken>;
|
|
97
118
|
/**
|
|
98
|
-
* Whether the
|
|
119
|
+
* Whether the scope has an activation for the user+vendor that is still live `minRemainingMs`
|
|
99
120
|
* from now (default: right now, i.e. plain liveness).
|
|
100
121
|
*
|
|
101
122
|
* The horizon is what makes this answerable as "may an interaction leave this alone?" rather
|
|
@@ -103,9 +124,9 @@ export declare class PersonalSubscriptionService {
|
|
|
103
124
|
* step the caller is about to dispatch, so treating it as good enough would push the failure into
|
|
104
125
|
* the run, which is the opposite of what the interaction gate exists for.
|
|
105
126
|
*/
|
|
106
|
-
hasActivation(
|
|
127
|
+
hasActivation(scopeId: ActivationScopeId, userId: string, vendor: SubscriptionVendor, minRemainingMs?: number): Promise<boolean>;
|
|
107
128
|
/**
|
|
108
|
-
* Whether the
|
|
129
|
+
* Whether the scope's activation for this vendor is FRESH ENOUGH that an interaction need not
|
|
109
130
|
* re-mint it — more than half its lifetime still to run.
|
|
110
131
|
*
|
|
111
132
|
* The rule lives here because only this service knows the TTL it mints against, and it exists
|
|
@@ -117,9 +138,9 @@ export declare class PersonalSubscriptionService {
|
|
|
117
138
|
* (the next dispatch has a comfortable credential) while making the cost proportional to the
|
|
118
139
|
* time the run has been tended rather than to the number of times it was poked.
|
|
119
140
|
*/
|
|
120
|
-
hasFreshActivation(
|
|
121
|
-
/** Delete every activation for a
|
|
122
|
-
|
|
141
|
+
hasFreshActivation(scopeId: ActivationScopeId, userId: string, vendor: SubscriptionVendor): Promise<boolean>;
|
|
142
|
+
/** Delete every activation for a settled scope (a removed credential; a run that terminated). */
|
|
143
|
+
clearScope(scopeId: ActivationScopeId): Promise<void>;
|
|
123
144
|
/** Delete activations whose TTL has passed. Returns the count (for the sweep log). */
|
|
124
145
|
sweepExpiredActivations(): Promise<number>;
|
|
125
146
|
/** Live subscriptions expiring within the renewal-warning horizon (for the nudge sweep). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalSubscriptionService.d.ts","sourceRoot":"","sources":["../../../src/modules/providers/PersonalSubscriptionService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,oBAAoB,EACpB,0BAA0B,EAC1B,8BAA8B,EAC9B,YAAY,EAEZ,gCAAgC,EAChC,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"PersonalSubscriptionService.d.ts","sourceRoot":"","sources":["../../../src/modules/providers/PersonalSubscriptionService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,oBAAoB,EACpB,0BAA0B,EAC1B,8BAA8B,EAC9B,YAAY,EAEZ,gCAAgC,EAChC,kBAAkB,EACnB,MAAM,qBAAqB,CAAA;AAO5B,OAAO,KAAK,EACV,0BAA0B,EAC1B,8BAA8B,EAC/B,MAAM,wBAAwB,CAAA;AAa/B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,QAAsB,CAAA;AAC5D,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,QAA0B,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,uCAAuC,CAAA;AAEtF,MAAM,WAAW,uCAAuC;IACtD,8BAA8B,EAAE,8BAA8B,CAAA;IAC9D,gCAAgC,EAAE,gCAAgC,CAAA;IAClE,gFAAgF;IAChF,YAAY,EAAE,YAAY,CAAA;IAC1B,uEAAuE;IACvE,cAAc,EAAE,oBAAoB,CAAA;IACpC,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,KAAK,CAAA;IACZ,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAjC,YAA6B,IAAI,EAAE,uCAAuC,EAAI;IAE9E,OAAO,KAAK,eAAe,GAE1B;IACD,OAAO,KAAK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O,CAAC,OAAO,CAAC,CASlB;IAED;;;;;;;;;;;;OAYG;IACG,kBAAkB,CACtB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,OAAO,CAAC,CAElB;IAED,iGAAiG;IAC3F,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;IAED,sFAAsF;IAChF,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAE/C;IAED,4FAA4F;IACtF,qBAAqB,IAAI,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAGnE;IAED,OAAO,CAAC,QAAQ;CAiBjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CredentialRequiredError, isIndividualVendor, ValidationError } from '@cat-factory/kernel';
|
|
1
|
+
import { CredentialRequiredError, isIndividualVendor, userActivationScope, ValidationError, } from '@cat-factory/kernel';
|
|
2
2
|
// PersonalSubscriptionService: owns each USER's individual-usage subscription
|
|
3
3
|
// credentials (Claude / GLM / Codex) — the per-user analogue of the per-workspace
|
|
4
4
|
// ProviderSubscriptionService pool. The credential is stored DOUBLE-encrypted
|
|
@@ -121,9 +121,24 @@ export class PersonalSubscriptionService {
|
|
|
121
121
|
const record = await this.deps.personalSubscriptionRepository.getByUserVendor(userId, vendor);
|
|
122
122
|
return (record !== null && (record.expiresAt === null || record.expiresAt > this.deps.clock.now()));
|
|
123
123
|
}
|
|
124
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Remove the user's personal credential for a vendor, and drop the USER-scope activations it
|
|
126
|
+
* could still be leased through.
|
|
127
|
+
*
|
|
128
|
+
* The activation is a separate copy of the same token, re-encrypted with the system key alone,
|
|
129
|
+
* so soft-deleting the subscription does not revoke it: without this, disconnecting a
|
|
130
|
+
* subscription would leave it usable from the run-less surfaces for the rest of the ~12h TTL,
|
|
131
|
+
* with nothing but the sweep to reclaim it.
|
|
132
|
+
*
|
|
133
|
+
* The whole user scope goes, not the vendor's row alone. A user's credentials share ONE
|
|
134
|
+
* password, so removing one is usually the first half of re-sealing them all, and a re-mint
|
|
135
|
+
* costs the next request that carries the password nothing but the derivation it would have
|
|
136
|
+
* paid anyway. RUN activations are deliberately left: consent there was given for a specific
|
|
137
|
+
* run whose dispatches are already in flight, and the run settling clears them itself.
|
|
138
|
+
*/
|
|
125
139
|
async remove(userId, vendor) {
|
|
126
140
|
await this.deps.personalSubscriptionRepository.softDelete(userId, vendor, this.deps.clock.now());
|
|
141
|
+
await this.clearScope(userActivationScope(userId));
|
|
127
142
|
}
|
|
128
143
|
/**
|
|
129
144
|
* Decrypt the user's credential with their password, returning the raw token.
|
|
@@ -157,18 +172,21 @@ export class PersonalSubscriptionService {
|
|
|
157
172
|
}
|
|
158
173
|
}
|
|
159
174
|
/**
|
|
160
|
-
* Mint a
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
175
|
+
* Mint an activation for a SCOPE: unlock the credential with the password, re-encrypt the raw
|
|
176
|
+
* token with the system key only, and store it under `scopeId` with a TTL so work that outlives
|
|
177
|
+
* the request can use it without the password. Idempotent: replaces any prior activation for the
|
|
178
|
+
* scope+user+vendor.
|
|
179
|
+
*
|
|
180
|
+
* The scope decides who may lease it and when it goes away, never this method: a run's
|
|
181
|
+
* activation dies with the run, a user's on its TTL. See {@link ActivationScopeId}.
|
|
164
182
|
*/
|
|
165
|
-
async
|
|
183
|
+
async activate(scopeId, userId, vendor, password) {
|
|
166
184
|
const token = await this.unlock(userId, vendor, password);
|
|
167
185
|
const now = this.deps.clock.now();
|
|
168
186
|
const tokenCipher = await this.deps.secretCipher.encrypt(token);
|
|
169
187
|
const record = {
|
|
170
188
|
id: this.deps.idGenerator.next('act'),
|
|
171
|
-
|
|
189
|
+
scopeId,
|
|
172
190
|
userId,
|
|
173
191
|
vendor,
|
|
174
192
|
tokenCipher,
|
|
@@ -179,21 +197,25 @@ export class PersonalSubscriptionService {
|
|
|
179
197
|
await this.deps.personalSubscriptionRepository.markUsed(userId, vendor, now);
|
|
180
198
|
}
|
|
181
199
|
/**
|
|
182
|
-
* Lease the
|
|
183
|
-
* (`password_required`) when the
|
|
184
|
-
*
|
|
200
|
+
* Lease the scope's activated token. Throws a {@link CredentialRequiredError}
|
|
201
|
+
* (`password_required`) when the scope has no live activation; every caller turns that into a
|
|
202
|
+
* clear, retriable failure the user answers by re-entering their password.
|
|
203
|
+
*
|
|
204
|
+
* The message names no scope KIND on purpose. The remedy is identical either way, and the two
|
|
205
|
+
* spellings ("this run has no credential" for a turn nobody started a run for) mislead in
|
|
206
|
+
* exactly the situation a person is already confused in.
|
|
185
207
|
*/
|
|
186
|
-
async
|
|
208
|
+
async lease(scopeId, userId, vendor) {
|
|
187
209
|
const now = this.deps.clock.now();
|
|
188
|
-
const activation = await this.deps.subscriptionActivationRepository.get(
|
|
210
|
+
const activation = await this.deps.subscriptionActivationRepository.get(scopeId, userId, vendor, now);
|
|
189
211
|
if (!activation) {
|
|
190
|
-
throw new CredentialRequiredError(`
|
|
212
|
+
throw new CredentialRequiredError(`No active ${vendor} credential; enter your personal password to continue.`, { vendor, reason: 'password_required' });
|
|
191
213
|
}
|
|
192
214
|
const secret = await this.deps.secretCipher.decrypt(activation.tokenCipher);
|
|
193
215
|
return { vendor, secret };
|
|
194
216
|
}
|
|
195
217
|
/**
|
|
196
|
-
* Whether the
|
|
218
|
+
* Whether the scope has an activation for the user+vendor that is still live `minRemainingMs`
|
|
197
219
|
* from now (default: right now, i.e. plain liveness).
|
|
198
220
|
*
|
|
199
221
|
* The horizon is what makes this answerable as "may an interaction leave this alone?" rather
|
|
@@ -201,11 +223,11 @@ export class PersonalSubscriptionService {
|
|
|
201
223
|
* step the caller is about to dispatch, so treating it as good enough would push the failure into
|
|
202
224
|
* the run, which is the opposite of what the interaction gate exists for.
|
|
203
225
|
*/
|
|
204
|
-
async hasActivation(
|
|
205
|
-
return ((await this.deps.subscriptionActivationRepository.get(
|
|
226
|
+
async hasActivation(scopeId, userId, vendor, minRemainingMs = 0) {
|
|
227
|
+
return ((await this.deps.subscriptionActivationRepository.get(scopeId, userId, vendor, this.deps.clock.now() + minRemainingMs)) !== null);
|
|
206
228
|
}
|
|
207
229
|
/**
|
|
208
|
-
* Whether the
|
|
230
|
+
* Whether the scope's activation for this vendor is FRESH ENOUGH that an interaction need not
|
|
209
231
|
* re-mint it — more than half its lifetime still to run.
|
|
210
232
|
*
|
|
211
233
|
* The rule lives here because only this service knows the TTL it mints against, and it exists
|
|
@@ -217,12 +239,12 @@ export class PersonalSubscriptionService {
|
|
|
217
239
|
* (the next dispatch has a comfortable credential) while making the cost proportional to the
|
|
218
240
|
* time the run has been tended rather than to the number of times it was poked.
|
|
219
241
|
*/
|
|
220
|
-
async hasFreshActivation(
|
|
221
|
-
return this.hasActivation(
|
|
242
|
+
async hasFreshActivation(scopeId, userId, vendor) {
|
|
243
|
+
return this.hasActivation(scopeId, userId, vendor, this.activationTtlMs / 2);
|
|
222
244
|
}
|
|
223
|
-
/** Delete every activation for a
|
|
224
|
-
async
|
|
225
|
-
await this.deps.subscriptionActivationRepository.
|
|
245
|
+
/** Delete every activation for a settled scope (a removed credential; a run that terminated). */
|
|
246
|
+
async clearScope(scopeId) {
|
|
247
|
+
await this.deps.subscriptionActivationRepository.deleteByScope(scopeId);
|
|
226
248
|
}
|
|
227
249
|
/** Delete activations whose TTL has passed. Returns the count (for the sweep log). */
|
|
228
250
|
async sweepExpiredActivations() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalSubscriptionService.js","sourceRoot":"","sources":["../../../src/modules/providers/PersonalSubscriptionService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PersonalSubscriptionService.js","sourceRoot":"","sources":["../../../src/modules/providers/PersonalSubscriptionService.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,GAChB,MAAM,q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AAS,EAAE,MAAM,CAAC,SAAS;YAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,aAAa;YACb,OAAO,EAAE,MAAM,CAAC,SAAS,KAAK,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,GAAG;YAC7D,SAAS,EAAE,MAAM,CAAC,SAAS,KAAK,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,GAAG,GAAG,IAAI,CAAC,cAAc;SACtF,CAAA;IACH,CAAC;CACF"}
|
|
@@ -99,7 +99,7 @@ export declare class BugHuntService {
|
|
|
99
99
|
* place under `analysisStatus: 'failed'`, because the list is independently useful and a
|
|
100
100
|
* model outage should not cost the user the scan.
|
|
101
101
|
*/
|
|
102
|
-
hunt(workspaceId: string, source: TaskSourceKind, input: BugHuntScan): Promise<BugHuntResult>;
|
|
102
|
+
hunt(workspaceId: string, source: TaskSourceKind, input: BugHuntScan, userId?: string): Promise<BugHuntResult>;
|
|
103
103
|
/**
|
|
104
104
|
* Adopt a confirmed candidate: import the issue into the projection and materialise it as a
|
|
105
105
|
* `bug` task inside `containerId`, with the issue linked for agent context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BugHuntService.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EACV,eAAe,EAIf,eAAe,EAEf,aAAa,EAEb,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACb,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"BugHuntService.d.ts","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM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ACb,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAjC,YAA6B,IAAI,EAAE,0BAA0B,EAAI;IAEjE;;;;;;;;;OASG;IACH,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,CAMxD;IAED;;;;OAIG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAyBrF;IAED;;;;;;;;OAQG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,WAAW,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,CAkDxB;IAED;;;;;;;;;;;;OAYG;IACG,KAAK,CAAC,KAAK,EAAE;QACjB,WAAW,EAAE,MAAM,CAAA;QACnB,MAAM,EAAE,cAAc,CAAA;QACtB,UAAU,EAAE,MAAM,CAAA;QAClB,WAAW,EAAE,MAAM,CAAA;QACnB,MAAM,EAAE,kBAAkB,CAAA;QAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;QACxB,UAAU,EAAE,MAAM,CAAA;KACnB,GAAG,OAAO,CAAC,aAAa,CAAC,CAezB;IAED;;;;OAIG;YACW,IAAI;IAyDlB,gGAAgG;YAClF,cAAc;CAO7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidationError, assertFound, parseBugHuntVerdicts, rankBugCandidates, redactSecrets, } from '@cat-factory/kernel';
|
|
1
|
+
import { CredentialRequiredError, ValidationError, assertFound, parseBugHuntVerdicts, rankBugCandidates, redactSecrets, } from '@cat-factory/kernel';
|
|
2
2
|
/**
|
|
3
3
|
* How many candidates one hunt scans. Bounded because the whole set goes into a single
|
|
4
4
|
* ranking prompt: past this the prompt cost grows without making the shortlist better, since
|
|
@@ -68,7 +68,7 @@ export class BugHuntService {
|
|
|
68
68
|
* place under `analysisStatus: 'failed'`, because the list is independently useful and a
|
|
69
69
|
* model outage should not cost the user the scan.
|
|
70
70
|
*/
|
|
71
|
-
async hunt(workspaceId, source, input) {
|
|
71
|
+
async hunt(workspaceId, source, input, userId) {
|
|
72
72
|
const provider = this.requireProvider(source);
|
|
73
73
|
// The container is settled BEFORE the vendor read and the ranking call, not left to the
|
|
74
74
|
// adoption that follows: a hunt is the platform's first billable model call that is not
|
|
@@ -101,7 +101,7 @@ export class BugHuntService {
|
|
|
101
101
|
const found = await provider.listBugCandidates(credentials, query, workspaceId);
|
|
102
102
|
const truncated = found.length > BUG_HUNT_SCAN_LIMIT;
|
|
103
103
|
const candidates = truncated ? found.slice(0, BUG_HUNT_SCAN_LIMIT) : found;
|
|
104
|
-
const { ranked, analysisStatus, model } = await this.rank(workspaceId, candidates);
|
|
104
|
+
const { ranked, analysisStatus, model } = await this.rank(workspaceId, candidates, userId);
|
|
105
105
|
return {
|
|
106
106
|
source,
|
|
107
107
|
board: input.board,
|
|
@@ -146,7 +146,7 @@ export class BugHuntService {
|
|
|
146
146
|
* verdicts are joined onto the provider's rows by `rankBugCandidates`, so a hallucinated
|
|
147
147
|
* issue is dropped and a skipped one surfaces as "not assessed" rather than as a zero.
|
|
148
148
|
*/
|
|
149
|
-
async rank(workspaceId, candidates) {
|
|
149
|
+
async rank(workspaceId, candidates, userId) {
|
|
150
150
|
const unranked = rankBugCandidates(candidates, new Map());
|
|
151
151
|
if (candidates.length === 0) {
|
|
152
152
|
return { ranked: unranked, analysisStatus: 'empty', model: null };
|
|
@@ -173,6 +173,7 @@ export class BugHuntService {
|
|
|
173
173
|
const { verdicts, model } = await assessor.assess({
|
|
174
174
|
workspaceId,
|
|
175
175
|
candidates: candidates.map(scrubCandidate),
|
|
176
|
+
...(userId ? { userId } : {}),
|
|
176
177
|
});
|
|
177
178
|
return {
|
|
178
179
|
ranked: rankBugCandidates(candidates, parseBugHuntVerdicts(verdicts)),
|
|
@@ -180,10 +181,18 @@ export class BugHuntService {
|
|
|
180
181
|
model,
|
|
181
182
|
};
|
|
182
183
|
}
|
|
183
|
-
catch {
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
184
|
+
catch (error) {
|
|
185
|
+
// The one failure that is NOT the assessor's to swallow: `credential_required` says the
|
|
186
|
+
// asker must enter their personal password, which is a thing they can do and the client
|
|
187
|
+
// knows how to ask for. Reported as a 200 with `analysisStatus: 'failed'` it becomes the
|
|
188
|
+
// shape this whole change exists to end: the hunt silently ranks on the board's own order,
|
|
189
|
+
// and the only signal is the bill for the call that never happened.
|
|
190
|
+
if (error instanceof CredentialRequiredError)
|
|
191
|
+
throw error;
|
|
192
|
+
// Everything else is deliberately swallowed: `analysisStatus: 'failed'` is what the user
|
|
193
|
+
// acts on, and the scan they paid for is still in the response. The assessor logs the
|
|
194
|
+
// underlying cause. A budget probe that threw lands here too: nothing was spent, and the
|
|
195
|
+
// scan survives.
|
|
187
196
|
return { ranked: unranked, analysisStatus: 'failed', model: null };
|
|
188
197
|
}
|
|
189
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BugHuntService.js","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAA;AAoD5B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAErC,0FAA0F;AAC1F,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAmChC,MAAM,OAAO,cAAc;IACI,IAAI;IAAjC,YAA6B,IAAgC;oBAAhC,IAAI;IAA+B,CAAC;IAEjE;;;;;;;;;OASG;IACH,eAAe,CAAC,MAAsB;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACzD,IAAI,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;YACjC,MAAM,IAAI,eAAe,CAAC,QAAQ,MAAM,qDAAqD,CAAC,CAAA;QAChG,CAAC;QACD,OAAO,QAA4B,CAAA;IACrC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,MAAsB;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACzD,IAAI,QAAQ,EAAE,SAAS,EAAE,CAAC;YACxB,gFAAgF;YAChF,0FAA0F;YAC1F,qFAAqF;YACrF,sFAAsF;YACtF,yFAAyF;YACzF,mEAAmE;YACnE,MAAM,IAAI,eAAe,CACvB,QAAQ,MAAM,uFAAuF,EACrG,EAAE,MAAM,EAAE,oBAAmD,EAAE,CAChE,CAAA;QACH,CAAC;QACD,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;YAC1B,sFAAsF;YACtF,uFAAuF;YACvF,yFAAyF;YACzF,oFAAoF;YACpF,MAAM,IAAI,eAAe,CAAC,QAAQ,MAAM,iDAAiD,EAAE;gBACzF,MAAM,EAAE,oBAAmD;aAC5D,CAAC,CAAA;QACJ,CAAC;QACD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;QAClE,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;IACtD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CACR,WAAmB,EACnB,MAAsB,EACtB,KAAkB;
|
|
1
|
+
{"version":3,"file":"BugHuntService.js","sourceRoot":"","sources":["../../../src/modules/tasks/BugHuntService.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAA;AAoD5B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA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AAuB;IAC7C,OAAO;QACL,GAAG,SAAS;QACZ,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE;QAC3C,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE;KACxD,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/integrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.173.1",
|
|
4
4
|
"description": "External-system integration domain logic for the Agent Architecture Board (GitHub, documents, tasks, environments, runners).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cat-factory/contracts": "0.
|
|
28
|
-
"@cat-factory/kernel": "0.
|
|
27
|
+
"@cat-factory/contracts": "0.353.0",
|
|
28
|
+
"@cat-factory/kernel": "0.346.1",
|
|
29
29
|
"ai": "^7.0.93",
|
|
30
30
|
"p-map": "^7.0.7",
|
|
31
31
|
"undici": "^8.10.2",
|
|
32
32
|
"yaml": "^2.9.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@cat-factory/caching": "0.20.
|
|
35
|
+
"@cat-factory/caching": "0.20.83",
|
|
36
36
|
"typescript": "7.0.2",
|
|
37
37
|
"valibot": "^1.4.2",
|
|
38
38
|
"vitest": "^4.1.11"
|