@feltdb/core 0.6.10 → 0.6.11
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/cli/application-lifecycle.js +112 -0
- package/dist/cli/application.js +10 -0
- package/dist/cli/commands.js +234 -64
- package/dist/cli/development-session.js +54 -0
- package/dist/cli/index.js +1 -1
- package/dist/cli/workspace-integration.js +146 -20
- package/dist/create/cli.js +4 -2
- package/dist/create/create.js +42 -6
- package/dist/create/frameworks.js +18 -0
- package/dist/create/package-versions.js +1 -1
- package/dist/create/workspace-initialization.js +4 -5
- package/dist/db.d.ts +4 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +56 -7
- package/dist/development-runtime-bridge.d.ts +60 -0
- package/dist/development-runtime-bridge.d.ts.map +1 -0
- package/dist/development-runtime-bridge.js +171 -0
- package/dist/index-core.d.ts +2 -0
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +2 -0
- package/dist/studio/app.d.ts +2 -1
- package/dist/studio/app.d.ts.map +1 -1
- package/dist/studio/components/StateExplorer.d.ts +2 -1
- package/dist/studio/components/StateExplorer.d.ts.map +1 -1
- package/dist/studio/components/index.js +1 -1
- package/dist/studio/{components-9kDSWiGL.js → components-C5p2TfIU.js} +25 -14
- package/dist/studio/index.js +234 -160
- package/dist/studio-app/assets/index-DospFFYE.js +28 -0
- package/dist/studio-app/index.html +1 -1
- package/dist/workspace/browser.d.ts +2 -2
- package/dist/workspace/browser.d.ts.map +1 -1
- package/dist/workspace/browser.js +1 -1
- package/dist/workspace/development-node.d.ts +16 -0
- package/dist/workspace/development-node.d.ts.map +1 -1
- package/dist/workspace/development-node.js +85 -1
- package/dist/workspace/index.d.ts +2 -2
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/investigation-lifecycle-manager.d.ts +2 -0
- package/dist/workspace/investigation-lifecycle-manager.d.ts.map +1 -1
- package/dist/workspace/investigation-lifecycle-manager.js +33 -3
- package/dist/workspace/investigation-supervisor.d.ts.map +1 -1
- package/dist/workspace/investigation-supervisor.js +3 -1
- package/dist/workspace/runtime-investigation.d.ts +4 -0
- package/dist/workspace/runtime-investigation.d.ts.map +1 -1
- package/dist/workspace/runtime-investigation.js +4 -0
- package/dist/workspace/runtime-observation.d.ts +4 -1
- package/dist/workspace/runtime-observation.d.ts.map +1 -1
- package/dist/workspace/runtime-observation.js +20 -2
- package/dist/workspace/runtime-observer.d.ts +6 -0
- package/dist/workspace/runtime-observer.d.ts.map +1 -1
- package/dist/workspace/runtime-observer.js +4 -0
- package/dist/workspace/workspace-identity.d.ts +1 -1
- package/dist/workspace/workspace-identity.d.ts.map +1 -1
- package/dist/workspace/workspace-identity.js +4 -4
- package/dist/workspace/workspace-types.d.ts +95 -0
- package/dist/workspace/workspace-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/studio-app/assets/index-D3rT0SJi.js +0 -28
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#17211b"/><title>FeltDB Studio</title> <script type="module" crossorigin src="/assets/index-
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#17211b"/><title>FeltDB Studio</title> <script type="module" crossorigin src="/assets/index-DospFFYE.js"></script>
|
|
2
2
|
<link rel="stylesheet" crossorigin href="/assets/index-C1GWyazR.css">
|
|
3
3
|
</head><body><div id="root"></div></body></html>
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
* What remains here is everything a browser genuinely uses: the runtime
|
|
10
10
|
* observer, the observation contract, and the workspace connection.
|
|
11
11
|
*/
|
|
12
|
-
export type { DevelopmentWorkspace, ClientType, WorkspaceEventPayload, DevelopmentTask, CodeChange, VerificationResult, SourceLocation, WorkspaceClient, WorkspaceDiscovery, InvestigationState, RemediationState, VerificationState, RuntimeRequestObservation, VerificationCriterion, RemediationContract, RuntimeInvestigation, WorkspaceActivity, VerificationAttempt, CorrelatedRuntimeEvent, InvestigationEvidence, InvestigationFinding, RepositoryIdentity, RemediationTracking, } from './workspace-types.js';
|
|
12
|
+
export type { DevelopmentWorkspace, ClientType, WorkspaceEventPayload, DevelopmentTask, CodeChange, VerificationResult, SourceLocation, WorkspaceClient, WorkspaceDiscovery, InvestigationState, RemediationState, VerificationState, RuntimeRequestObservation, VerificationCriterion, RemediationContract, RuntimeInvestigation, WorkspaceActivity, VerificationAttempt, CorrelatedRuntimeEvent, RuntimeObservationCorrelation, InvestigationEvidence, InvestigationFinding, RepositoryIdentity, RemediationTracking, } from './workspace-types.js';
|
|
13
13
|
export { RUNTIME_OBSERVATION_COLLECTION, REDACTED_PARAMETER_PATTERNS, REDACTION_PLACEHOLDER, redactUrl, redactMessage, describeBrowser, isActionableRuntimeDefect, describeDefect, createRuntimeObservation, createObservationId, createCorrelationId, } from './runtime-observation.js';
|
|
14
14
|
export type { RuntimeObservationInput } from './runtime-observation.js';
|
|
15
15
|
export { startRuntimeObservation } from './runtime-observer.js';
|
|
16
16
|
export type { RuntimeObservationOptions, RuntimeObservationHandle } from './runtime-observer.js';
|
|
17
17
|
export { collectEvidence, deriveFinding, candidateSourcePaths, recommendChanges, resolveRelevantSource, verificationContractFor, summarizeDefect, } from './investigation-analysis.js';
|
|
18
|
-
export { transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
18
|
+
export { RUNTIME_INVESTIGATION_COLLECTION, LEGACY_RUNTIME_INVESTIGATION_COLLECTION, transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
19
19
|
export type { WorkspaceConnectionOptions, WorkspaceMetadata, PairingTokenData, BrowserPairingResolution, PairingDiscoveryOptions, ClientInfo, } from './workspace-connection.js';
|
|
20
20
|
export { connectDevelopmentWorkspace, discoverDevelopmentWorkspace, resolvePairingCode, DevelopmentWorkspaceConnection, } from './workspace-connection.js';
|
|
21
21
|
export { createWorkspaceId, isValidWorkspaceId, createDevelopmentWorkspace, updateWorkspaceTimestamp, discoverWorkspace, persistWorkspaceDiscovery, } from './workspace-identity.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/workspace/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACV,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,UAAU,GACX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/workspace/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY,EACV,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,gCAAgC,EAChC,uCAAuC,EACvC,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,UAAU,GACX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC"}
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
export { RUNTIME_OBSERVATION_COLLECTION, REDACTED_PARAMETER_PATTERNS, REDACTION_PLACEHOLDER, redactUrl, redactMessage, describeBrowser, isActionableRuntimeDefect, describeDefect, createRuntimeObservation, createObservationId, createCorrelationId, } from './runtime-observation.js';
|
|
13
13
|
export { startRuntimeObservation } from './runtime-observer.js';
|
|
14
14
|
export { collectEvidence, deriveFinding, candidateSourcePaths, recommendChanges, resolveRelevantSource, verificationContractFor, summarizeDefect, } from './investigation-analysis.js';
|
|
15
|
-
export { transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
15
|
+
export { RUNTIME_INVESTIGATION_COLLECTION, LEGACY_RUNTIME_INVESTIGATION_COLLECTION, transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
16
16
|
export { connectDevelopmentWorkspace, discoverDevelopmentWorkspace, resolvePairingCode, DevelopmentWorkspaceConnection, } from './workspace-connection.js';
|
|
17
17
|
export { createWorkspaceId, isValidWorkspaceId, createDevelopmentWorkspace, updateWorkspaceTimestamp, discoverWorkspace, persistWorkspaceDiscovery, } from './workspace-identity.js';
|
|
@@ -14,6 +14,7 @@ export declare class DevelopmentNode {
|
|
|
14
14
|
private tasks;
|
|
15
15
|
private codeChanges;
|
|
16
16
|
private verificationResults;
|
|
17
|
+
private runtimeObservations;
|
|
17
18
|
private investigations;
|
|
18
19
|
private remediationContracts;
|
|
19
20
|
private workspaceActivities;
|
|
@@ -35,8 +36,22 @@ export declare class DevelopmentNode {
|
|
|
35
36
|
publishVerificationResult(result: Omit<VerificationResult, 'id' | 'createdAt'>): Promise<VerificationResult>;
|
|
36
37
|
getVerificationResult(resultId: string): Promise<VerificationResult | null>;
|
|
37
38
|
listVerificationResults(taskId: string): Promise<VerificationResult[]>;
|
|
39
|
+
/** Persist an immutable canonical runtime observation. */
|
|
40
|
+
recordRuntimeObservation(observation: RuntimeRequestObservation): Promise<RuntimeRequestObservation>;
|
|
41
|
+
getRuntimeObservation(observationId: string): Promise<RuntimeRequestObservation | null>;
|
|
38
42
|
createRuntimeInvestigation(workspaceId: string, contract: RemediationContract): Promise<RuntimeInvestigation>;
|
|
39
43
|
getRuntimeInvestigation(id: string): Promise<RuntimeInvestigation | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Link another immutable observation to an investigation. One investigation
|
|
46
|
+
* may aggregate many observations; one observation belongs to at most one.
|
|
47
|
+
*/
|
|
48
|
+
linkRuntimeObservationToInvestigation(observationId: string, investigationId: string): Promise<RuntimeInvestigation>;
|
|
49
|
+
getRuntimeInvestigationForObservation(observationId: string): Promise<RuntimeInvestigation | null>;
|
|
50
|
+
/** Associate existing development change/verification records without mutating observations. */
|
|
51
|
+
linkRuntimeInvestigation(investigationId: string, links: {
|
|
52
|
+
changeId?: string;
|
|
53
|
+
verificationId?: string;
|
|
54
|
+
}): Promise<RuntimeInvestigation>;
|
|
40
55
|
getRemediationContract(id: string): Promise<RemediationContract | null>;
|
|
41
56
|
advanceInvestigation(id: string, next: RuntimeInvestigation['investigationState']): Promise<RuntimeInvestigation>;
|
|
42
57
|
advanceRemediation(id: string, next: RuntimeInvestigation['remediationState']): Promise<RuntimeInvestigation>;
|
|
@@ -47,6 +62,7 @@ export declare class DevelopmentNode {
|
|
|
47
62
|
listWorkspaceActivities(investigationId: string): Promise<WorkspaceActivity[]>;
|
|
48
63
|
listVerificationAttempts(investigationId: string): Promise<VerificationAttempt[]>;
|
|
49
64
|
private requireInvestigation;
|
|
65
|
+
private investigationObservationIds;
|
|
50
66
|
private validateWorkspaceExists;
|
|
51
67
|
private ensureRunning;
|
|
52
68
|
private generateId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"development-node.d.ts","sourceRoot":"","sources":["../../src/workspace/development-node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,oBAAoB,EAEpB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAc9B,MAAM,WAAW,qBAAqB;IACpC,OAAO,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AAE,WAAW,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAoB7G,uBAAuB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAK9E,wBAAwB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAKvF,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,uBAAuB;IAM/B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,UAAU;YAIJ,SAAS;YAkDT,SAAS;CA4BxB;AAID,wBAAsB,kBAAkB,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAOjG;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAK7D"}
|
|
@@ -12,6 +12,7 @@ export class DevelopmentNode {
|
|
|
12
12
|
this.tasks = new Map();
|
|
13
13
|
this.codeChanges = new Map();
|
|
14
14
|
this.verificationResults = new Map();
|
|
15
|
+
this.runtimeObservations = new Map();
|
|
15
16
|
this.investigations = new Map();
|
|
16
17
|
this.remediationContracts = new Map();
|
|
17
18
|
this.workspaceActivities = new Map();
|
|
@@ -135,6 +136,26 @@ export class DevelopmentNode {
|
|
|
135
136
|
this.ensureRunning();
|
|
136
137
|
return Array.from(this.verificationResults.values()).filter((r) => r.taskId === taskId);
|
|
137
138
|
}
|
|
139
|
+
/** Persist an immutable canonical runtime observation. */
|
|
140
|
+
async recordRuntimeObservation(observation) {
|
|
141
|
+
this.ensureRunning();
|
|
142
|
+
if (!observation.observationId)
|
|
143
|
+
throw new Error('Runtime observation requires observationId');
|
|
144
|
+
if (this.runtimeObservations.has(observation.observationId)) {
|
|
145
|
+
throw new Error(`Runtime observation already exists: ${observation.observationId}`);
|
|
146
|
+
}
|
|
147
|
+
if (observation.workspaceId)
|
|
148
|
+
this.validateWorkspaceExists(observation.workspaceId);
|
|
149
|
+
const stored = JSON.parse(JSON.stringify(observation));
|
|
150
|
+
this.runtimeObservations.set(stored.observationId, stored);
|
|
151
|
+
await this.saveState();
|
|
152
|
+
return JSON.parse(JSON.stringify(stored));
|
|
153
|
+
}
|
|
154
|
+
async getRuntimeObservation(observationId) {
|
|
155
|
+
this.ensureRunning();
|
|
156
|
+
const observation = this.runtimeObservations.get(observationId);
|
|
157
|
+
return observation ? JSON.parse(JSON.stringify(observation)) : null;
|
|
158
|
+
}
|
|
138
159
|
async createRuntimeInvestigation(workspaceId, contract) {
|
|
139
160
|
this.ensureRunning();
|
|
140
161
|
this.validateWorkspaceExists(workspaceId);
|
|
@@ -145,6 +166,9 @@ export class DevelopmentNode {
|
|
|
145
166
|
id: contract.investigationId,
|
|
146
167
|
workspaceId,
|
|
147
168
|
observationId: contract.observationId,
|
|
169
|
+
observationIds: [contract.observationId],
|
|
170
|
+
runtimeInstanceId: contract.originalObservation.runtimeInstanceId,
|
|
171
|
+
sessionId: contract.originalObservation.sessionId,
|
|
148
172
|
remediationContractId: contract.id,
|
|
149
173
|
investigationState: 'OBSERVED', remediationState: 'NOT_STARTED', verificationState: 'NOT_READY',
|
|
150
174
|
createdAt: now, updatedAt: now,
|
|
@@ -158,6 +182,52 @@ export class DevelopmentNode {
|
|
|
158
182
|
this.ensureRunning();
|
|
159
183
|
return this.investigations.get(id) || null;
|
|
160
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Link another immutable observation to an investigation. One investigation
|
|
187
|
+
* may aggregate many observations; one observation belongs to at most one.
|
|
188
|
+
*/
|
|
189
|
+
async linkRuntimeObservationToInvestigation(observationId, investigationId) {
|
|
190
|
+
this.ensureRunning();
|
|
191
|
+
const observation = this.runtimeObservations.get(observationId);
|
|
192
|
+
if (!observation)
|
|
193
|
+
throw new Error(`Runtime observation not found: ${observationId}`);
|
|
194
|
+
const investigation = this.requireInvestigation(investigationId);
|
|
195
|
+
if (observation.workspaceId && observation.workspaceId !== investigation.workspaceId) {
|
|
196
|
+
throw new Error('Runtime observation and investigation must belong to the same workspace');
|
|
197
|
+
}
|
|
198
|
+
const owner = [...this.investigations.values()].find(value => value.id !== investigationId && this.investigationObservationIds(value).includes(observationId));
|
|
199
|
+
if (owner)
|
|
200
|
+
throw new Error(`Runtime observation ${observationId} is already linked to ${owner.id}`);
|
|
201
|
+
const observationIds = this.investigationObservationIds(investigation);
|
|
202
|
+
if (!observationIds.includes(observationId))
|
|
203
|
+
observationIds.push(observationId);
|
|
204
|
+
const updated = { ...investigation, observationIds, updatedAt: Date.now() };
|
|
205
|
+
this.investigations.set(investigationId, updated);
|
|
206
|
+
await this.saveState();
|
|
207
|
+
return updated;
|
|
208
|
+
}
|
|
209
|
+
async getRuntimeInvestigationForObservation(observationId) {
|
|
210
|
+
this.ensureRunning();
|
|
211
|
+
return [...this.investigations.values()].find(value => this.investigationObservationIds(value).includes(observationId)) || null;
|
|
212
|
+
}
|
|
213
|
+
/** Associate existing development change/verification records without mutating observations. */
|
|
214
|
+
async linkRuntimeInvestigation(investigationId, links) {
|
|
215
|
+
const investigation = this.requireInvestigation(investigationId);
|
|
216
|
+
if (links.changeId) {
|
|
217
|
+
const change = this.codeChanges.get(links.changeId);
|
|
218
|
+
if (!change || change.workspaceId !== investigation.workspaceId)
|
|
219
|
+
throw new Error(`Code change not found in workspace: ${links.changeId}`);
|
|
220
|
+
}
|
|
221
|
+
if (links.verificationId) {
|
|
222
|
+
const verification = this.verificationResults.get(links.verificationId);
|
|
223
|
+
if (!verification || verification.workspaceId !== investigation.workspaceId)
|
|
224
|
+
throw new Error(`Verification result not found in workspace: ${links.verificationId}`);
|
|
225
|
+
}
|
|
226
|
+
const updated = { ...investigation, ...links, updatedAt: Date.now() };
|
|
227
|
+
this.investigations.set(investigationId, updated);
|
|
228
|
+
await this.saveState();
|
|
229
|
+
return updated;
|
|
230
|
+
}
|
|
161
231
|
async getRemediationContract(id) {
|
|
162
232
|
this.ensureRunning();
|
|
163
233
|
return this.remediationContracts.get(id) || null;
|
|
@@ -209,7 +279,15 @@ export class DevelopmentNode {
|
|
|
209
279
|
throw new Error(`Remediation contract not found: ${current.remediationContractId}`);
|
|
210
280
|
const attempt = evaluateVerification(contract, observation);
|
|
211
281
|
this.verificationAttempts.set(attempt.id, attempt);
|
|
212
|
-
|
|
282
|
+
const updated = transitionVerification(current, attempt.result);
|
|
283
|
+
updated.verificationId = attempt.verificationId;
|
|
284
|
+
if (observation) {
|
|
285
|
+
updated.observationIds = [...new Set([
|
|
286
|
+
...this.investigationObservationIds(updated),
|
|
287
|
+
observation.observationId,
|
|
288
|
+
])];
|
|
289
|
+
}
|
|
290
|
+
this.investigations.set(id, updated);
|
|
213
291
|
await this.saveState();
|
|
214
292
|
return attempt;
|
|
215
293
|
}
|
|
@@ -228,6 +306,9 @@ export class DevelopmentNode {
|
|
|
228
306
|
throw new Error(`Investigation not found: ${id}`);
|
|
229
307
|
return investigation;
|
|
230
308
|
}
|
|
309
|
+
investigationObservationIds(investigation) {
|
|
310
|
+
return [...new Set([investigation.observationId, ...(investigation.observationIds || [])].filter(Boolean))];
|
|
311
|
+
}
|
|
231
312
|
validateWorkspaceExists(workspaceId) {
|
|
232
313
|
if (!this.workspaces.has(workspaceId)) {
|
|
233
314
|
throw new Error(`Workspace not found: ${workspaceId}`);
|
|
@@ -256,6 +337,7 @@ export class DevelopmentNode {
|
|
|
256
337
|
this.tasks = new Map(Object.entries(state.tasks || {}));
|
|
257
338
|
this.codeChanges = new Map(Object.entries(state.codeChanges || {}));
|
|
258
339
|
this.verificationResults = new Map(Object.entries(state.verificationResults || {}));
|
|
340
|
+
this.runtimeObservations = new Map(Object.entries(state.runtimeObservations || {}));
|
|
259
341
|
this.investigations = new Map(Object.entries(state.investigations || {}));
|
|
260
342
|
this.remediationContracts = new Map(Object.entries(state.remediationContracts || {}));
|
|
261
343
|
this.workspaceActivities = new Map(Object.entries(state.workspaceActivities || {}));
|
|
@@ -266,6 +348,7 @@ export class DevelopmentNode {
|
|
|
266
348
|
this.tasks.clear();
|
|
267
349
|
this.codeChanges.clear();
|
|
268
350
|
this.verificationResults.clear();
|
|
351
|
+
this.runtimeObservations.clear();
|
|
269
352
|
this.investigations.clear();
|
|
270
353
|
this.remediationContracts.clear();
|
|
271
354
|
this.workspaceActivities.clear();
|
|
@@ -289,6 +372,7 @@ export class DevelopmentNode {
|
|
|
289
372
|
tasks: Object.fromEntries(this.tasks),
|
|
290
373
|
codeChanges: Object.fromEntries(this.codeChanges),
|
|
291
374
|
verificationResults: Object.fromEntries(this.verificationResults),
|
|
375
|
+
runtimeObservations: Object.fromEntries(this.runtimeObservations),
|
|
292
376
|
investigations: Object.fromEntries(this.investigations),
|
|
293
377
|
remediationContracts: Object.fromEntries(this.remediationContracts),
|
|
294
378
|
workspaceActivities: Object.fromEntries(this.workspaceActivities),
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* These enable any client (browser, IDE, agent) to discover and connect
|
|
12
12
|
* to the same shared development workspace.
|
|
13
13
|
*/
|
|
14
|
-
export type { DevelopmentWorkspace, ClientType, WorkspaceEventPayload, DevelopmentTask, CodeChange, VerificationResult, SourceLocation, WorkspaceClient, WorkspaceDiscovery, InvestigationState, RemediationState, VerificationState, RuntimeRequestObservation, VerificationCriterion, RemediationContract, RuntimeInvestigation, WorkspaceActivity, VerificationAttempt, CorrelatedRuntimeEvent, InvestigationEvidence, InvestigationFinding, RepositoryIdentity, RemediationTracking, } from './workspace-types.js';
|
|
14
|
+
export type { DevelopmentWorkspace, ClientType, WorkspaceEventPayload, DevelopmentTask, CodeChange, VerificationResult, SourceLocation, WorkspaceClient, WorkspaceDiscovery, WorkspaceSources, WorkspaceDefinition, WorkspaceRuntimeState, WorkspaceModel, ApplicationLifecycle, DevelopmentSessionState, DevelopmentSession, InvestigationState, RemediationState, VerificationState, RuntimeRequestObservation, VerificationCriterion, RemediationContract, RuntimeInvestigation, WorkspaceActivity, VerificationAttempt, CorrelatedRuntimeEvent, RuntimeObservationCorrelation, InvestigationEvidence, InvestigationFinding, RepositoryIdentity, RemediationTracking, } from './workspace-types.js';
|
|
15
15
|
export { RUNTIME_OBSERVATION_COLLECTION, REDACTED_PARAMETER_PATTERNS, REDACTION_PLACEHOLDER, redactUrl, redactMessage, describeBrowser, isActionableRuntimeDefect, describeDefect, createRuntimeObservation, createObservationId, createCorrelationId, } from './runtime-observation.js';
|
|
16
16
|
export type { RuntimeObservationInput } from './runtime-observation.js';
|
|
17
17
|
export { startRuntimeObservation } from './runtime-observer.js';
|
|
@@ -20,7 +20,7 @@ export { collectEvidence, deriveFinding, candidateSourcePaths, recommendChanges,
|
|
|
20
20
|
export { captureRepositoryIdentity, changedPaths, repositoryChanged, trackRemediation, } from './git-identity.js';
|
|
21
21
|
export { RuntimeInvestigationSupervisor } from './investigation-supervisor.js';
|
|
22
22
|
export type { SupervisorOptions, AgentHandoffArtifact } from './investigation-supervisor.js';
|
|
23
|
-
export { transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
23
|
+
export { RUNTIME_INVESTIGATION_COLLECTION, LEGACY_RUNTIME_INVESTIGATION_COLLECTION, transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
24
24
|
export type { WorkspaceConnectionOptions, WorkspaceMetadata, PairingTokenData, BrowserPairingResolution, PairingDiscoveryOptions, ClientInfo, } from './workspace-connection.js';
|
|
25
25
|
export { connectDevelopmentWorkspace, discoverDevelopmentWorkspace, resolvePairingCode, DevelopmentWorkspaceConnection, } from './workspace-connection.js';
|
|
26
26
|
export { createWorkspaceId, isValidWorkspaceId, createDevelopmentWorkspace, updateWorkspaceTimestamp, discoverWorkspace, persistWorkspaceDiscovery, } from './workspace-identity.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,EACV,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE7F,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,UAAU,GACX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,yBAAyB,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAEpH,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,YAAY,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,EACV,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB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C,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,yBAAyB,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAEpH,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,YAAY,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC"}
|
package/dist/workspace/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export { startRuntimeObservation } from './runtime-observer.js';
|
|
|
16
16
|
export { collectEvidence, deriveFinding, candidateSourcePaths, recommendChanges, resolveRelevantSource, verificationContractFor, summarizeDefect, } from './investigation-analysis.js';
|
|
17
17
|
export { captureRepositoryIdentity, changedPaths, repositoryChanged, trackRemediation, } from './git-identity.js';
|
|
18
18
|
export { RuntimeInvestigationSupervisor } from './investigation-supervisor.js';
|
|
19
|
-
export { transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
19
|
+
export { RUNTIME_INVESTIGATION_COLLECTION, LEGACY_RUNTIME_INVESTIGATION_COLLECTION, transitionInvestigation, transitionRemediation, transitionVerification, createRemediationContract, classifyWorkspaceActivity, evaluateVerification, agentRemediationHandoff, RUNTIME_INVESTIGATION_INSTRUCTIONS, FELTDB_OBSERVATION_BOUNDARY, } from './runtime-investigation.js';
|
|
20
20
|
export { connectDevelopmentWorkspace, discoverDevelopmentWorkspace, resolvePairingCode, DevelopmentWorkspaceConnection, } from './workspace-connection.js';
|
|
21
21
|
export { createWorkspaceId, isValidWorkspaceId, createDevelopmentWorkspace, updateWorkspaceTimestamp, discoverWorkspace, persistWorkspaceDiscovery, } from './workspace-identity.js';
|
|
22
22
|
export { DevelopmentNode, getDevelopmentNode, shutdownDevelopmentNode, } from './development-node.js';
|
|
@@ -33,6 +33,8 @@ export declare class InvestigationLifecycleManager {
|
|
|
33
33
|
listInvestigations(): RuntimeInvestigation[];
|
|
34
34
|
/** Find the investigation opened for a given observation, if any. */
|
|
35
35
|
findByObservationId(observationId: string): RuntimeInvestigation | null;
|
|
36
|
+
/** Add an observation reference without changing the factual observation. */
|
|
37
|
+
linkRuntimeObservationToInvestigation(observationId: string, investigationId: string): RuntimeInvestigation;
|
|
36
38
|
private require;
|
|
37
39
|
/** OBSERVED -> INVESTIGATING, attaching the runtime evidence. */
|
|
38
40
|
transitionToInvestigating(id: string, evidence?: InvestigationEvidence[]): RuntimeInvestigation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"investigation-lifecycle-manager.d.ts","sourceRoot":"","sources":["../../src/workspace/investigation-lifecycle-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EAEnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EAE1B,MAAM,sBAAsB,CAAC;AAU9B,6DAA6D;AAC7D,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;gBAE/B,YAAY,EAAE,MAAM;IAKhC,OAAO,CAAC,iBAAiB;IAMzB,uDAAuD;IACvD,mBAAmB,CAAC,WAAW,EAAE,yBAAyB,EAAE,WAAW,SAAK,GAAG,oBAAoB;
|
|
1
|
+
{"version":3,"file":"investigation-lifecycle-manager.d.ts","sourceRoot":"","sources":["../../src/workspace/investigation-lifecycle-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EAEnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EAE1B,MAAM,sBAAsB,CAAC;AAU9B,6DAA6D;AAC7D,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;gBAE/B,YAAY,EAAE,MAAM;IAKhC,OAAO,CAAC,iBAAiB;IAMzB,uDAAuD;IACvD,mBAAmB,CAAC,WAAW,EAAE,yBAAyB,EAAE,WAAW,SAAK,GAAG,oBAAoB;IAwBnG,oBAAoB,CAAC,aAAa,EAAE,oBAAoB,GAAG,IAAI;IAS/D,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;IAM1D,kBAAkB,IAAI,oBAAoB,EAAE;IAe5C,qEAAqE;IACrE,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;IAKvE,6EAA6E;IAC7E,qCAAqC,CAAC,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,oBAAoB;IAgB3G,OAAO,CAAC,OAAO;IAQf,iEAAiE;IACjE,yBAAyB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,GAAE,qBAAqB,EAAO,GAAG,oBAAoB;IAOnG;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,MAAM,GAAG,oBAAoB;IAmB7F;;;;;OAKG;IACH,WAAW,CACT,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,EACvF,SAAS,CAAC,EAAE,kBAAkB,GAC7B,oBAAoB;IAiBvB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB;IAMlD;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,oBAAoB;IAgB5E;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB;IASxD;;;;;OAKG;IACH,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,CAAC,EAAE,yBAAyB,GACtC,oBAAoB;IAuBvB;;;;;OAKG;IACH,OAAO,IAAI,yBAAyB;CA0BrC"}
|
|
@@ -34,6 +34,9 @@ export class InvestigationLifecycleManager {
|
|
|
34
34
|
id,
|
|
35
35
|
workspaceId: observation.workspaceId || workspaceId,
|
|
36
36
|
observationId: observation.observationId || `obs_${now}`,
|
|
37
|
+
observationIds: [observation.observationId || `obs_${now}`],
|
|
38
|
+
runtimeInstanceId: observation.runtimeInstanceId,
|
|
39
|
+
sessionId: observation.sessionId,
|
|
37
40
|
remediationContractId: '',
|
|
38
41
|
investigationState: 'OBSERVED',
|
|
39
42
|
remediationState: 'NOT_STARTED',
|
|
@@ -76,7 +79,23 @@ export class InvestigationLifecycleManager {
|
|
|
76
79
|
}
|
|
77
80
|
/** Find the investigation opened for a given observation, if any. */
|
|
78
81
|
findByObservationId(observationId) {
|
|
79
|
-
return this.listInvestigations().find(item => item.observationId === observationId) || null;
|
|
82
|
+
return this.listInvestigations().find(item => item.observationId === observationId || item.observationIds?.includes(observationId)) || null;
|
|
83
|
+
}
|
|
84
|
+
/** Add an observation reference without changing the factual observation. */
|
|
85
|
+
linkRuntimeObservationToInvestigation(observationId, investigationId) {
|
|
86
|
+
const investigation = this.require(investigationId);
|
|
87
|
+
const existing = this.findByObservationId(observationId);
|
|
88
|
+
if (existing && existing.id !== investigationId) {
|
|
89
|
+
throw new Error(`Runtime observation ${observationId} is already linked to ${existing.id}`);
|
|
90
|
+
}
|
|
91
|
+
investigation.observationIds = [...new Set([
|
|
92
|
+
investigation.observationId,
|
|
93
|
+
...(investigation.observationIds || []),
|
|
94
|
+
observationId,
|
|
95
|
+
])];
|
|
96
|
+
investigation.updatedAt = Date.now();
|
|
97
|
+
this.persistInvestigation(investigation);
|
|
98
|
+
return investigation;
|
|
80
99
|
}
|
|
81
100
|
require(id) {
|
|
82
101
|
const investigation = this.loadInvestigation(id);
|
|
@@ -194,9 +213,16 @@ export class InvestigationLifecycleManager {
|
|
|
194
213
|
current = transitionVerification(current, 'VERIFYING');
|
|
195
214
|
const attempt = evaluateVerification(contract, observation);
|
|
196
215
|
const settled = transitionVerification(current, attempt.result);
|
|
216
|
+
settled.verificationId = attempt.verificationId;
|
|
197
217
|
settled.verificationAttempt = attempt;
|
|
198
|
-
if (observation)
|
|
218
|
+
if (observation) {
|
|
199
219
|
settled.verificationObservation = observation;
|
|
220
|
+
settled.observationIds = [...new Set([
|
|
221
|
+
settled.observationId,
|
|
222
|
+
...(settled.observationIds || []),
|
|
223
|
+
observation.observationId,
|
|
224
|
+
])];
|
|
225
|
+
}
|
|
200
226
|
this.persistInvestigation(settled);
|
|
201
227
|
return settled;
|
|
202
228
|
}
|
|
@@ -219,7 +245,11 @@ export class InvestigationLifecycleManager {
|
|
|
219
245
|
}
|
|
220
246
|
return {
|
|
221
247
|
investigations: investigations.length,
|
|
222
|
-
observations: investigations.reduce((total, item) => total +
|
|
248
|
+
observations: investigations.reduce((total, item) => total + new Set([
|
|
249
|
+
item.observationId,
|
|
250
|
+
...(item.observationIds || []),
|
|
251
|
+
item.verificationObservation?.observationId,
|
|
252
|
+
].filter(Boolean)).size, 0),
|
|
223
253
|
evidenceRecords: investigations.reduce((total, item) => total + (item.evidence?.length || 0), 0),
|
|
224
254
|
verifiedInvestigations: investigations.filter(item => item.verificationState === 'VERIFIED').length,
|
|
225
255
|
serializedBytes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"investigation-supervisor.d.ts","sourceRoot":"","sources":["../../src/workspace/investigation-supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAKrF,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,8BAA8B;IACzC,QAAQ,CAAC,cAAc,EAAE,6BAA6B,CAAC;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,UAAU,CAA+C;IACjE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;gBAE1C,OAAO,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"investigation-supervisor.d.ts","sourceRoot":"","sources":["../../src/workspace/investigation-supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAKrF,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+CAA+C;AAC/C,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,8BAA8B;IACzC,QAAQ,CAAC,cAAc,EAAE,6BAA6B,CAAC;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,UAAU,CAA+C;IACjE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;gBAE1C,OAAO,EAAE,iBAAiB;IAYhC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IASxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC,OAAO,CAAC,OAAO;IAKf,6DAA6D;IACvD,YAAY,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAK1D;;;;;OAKG;IACG,gBAAgB,CACpB,SAAS,EAAE,qBAAqB,EAChC,OAAO,GAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAiB,GACjF,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAcjD;;;;;OAKG;IACG,kBAAkB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAW3D;;;;;OAKG;IACH,iBAAiB,CAAC,WAAW,EAAE,yBAAyB,GAAG,oBAAoB;IAmB/E,0DAA0D;IAC1D,kBAAkB,IAAI,kBAAkB;IAIxC,8EAA8E;IAC9E,OAAO,CAAC,cAAc;IAMtB;;;;;;OAMG;IACH,iBAAiB,CAAC,eAAe,EAAE,MAAM,GAAG,oBAAoB;IA8DhE,qEAAqE;IACrE,sBAAsB,CAAC,eAAe,EAAE,MAAM,GAAG,oBAAoB;IAWrE;;;;;OAKG;IACG,MAAM,CACV,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAiB,GAC5D,OAAO,CAAC,oBAAoB,CAAC;IAUhC,2DAA2D;IAC3D,QAAQ,CAAC,aAAa,EAAE,oBAAoB,GAAG,MAAM;CAGtD"}
|
|
@@ -29,7 +29,9 @@ export class RuntimeInvestigationSupervisor {
|
|
|
29
29
|
// Observations already turned into investigations must not re-open on a
|
|
30
30
|
// restart, so the seen set is rebuilt from durable state.
|
|
31
31
|
for (const investigation of this.investigations.listInvestigations()) {
|
|
32
|
-
|
|
32
|
+
for (const observationId of investigation.observationIds || [investigation.observationId]) {
|
|
33
|
+
this.seenObservations.add(observationId);
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
async connect() {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { InvestigationState, RemediationContract, RemediationState, RuntimeInvestigation, RuntimeRequestObservation, VerificationAttempt, VerificationState, WorkspaceActivity } from './workspace-types.js';
|
|
2
|
+
/** Canonical FeltDB investigation collection. */
|
|
3
|
+
export declare const RUNTIME_INVESTIGATION_COLLECTION = "runtime_investigation";
|
|
4
|
+
/** External/legacy DevTools collection retained without migration. */
|
|
5
|
+
export declare const LEGACY_RUNTIME_INVESTIGATION_COLLECTION = "runtime_investigations";
|
|
2
6
|
export declare function transitionInvestigation(investigation: RuntimeInvestigation, next: InvestigationState): RuntimeInvestigation;
|
|
3
7
|
export declare function transitionRemediation(investigation: RuntimeInvestigation, next: RemediationState): RuntimeInvestigation;
|
|
4
8
|
export declare function transitionVerification(investigation: RuntimeInvestigation, next: VerificationState): RuntimeInvestigation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-investigation.d.ts","sourceRoot":"","sources":["../../src/workspace/runtime-investigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EAEnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-investigation.d.ts","sourceRoot":"","sources":["../../src/workspace/runtime-investigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EAEnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,iDAAiD;AACjD,eAAO,MAAM,gCAAgC,0BAA0B,CAAC;AACxE,sEAAsE;AACtE,eAAO,MAAM,uCAAuC,2BAA2B,CAAC;AAqBhF,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,oBAAoB,EAAE,IAAI,EAAE,kBAAkB,GAAG,oBAAoB,CAE3H;AACD,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,oBAAoB,EAAE,IAAI,EAAE,gBAAgB,GAAG,oBAAoB,CAEvH;AACD,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,oBAAoB,EAAE,IAAI,EAAE,iBAAiB,GAAG,oBAAoB,CAEzH;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,eAAe,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG,mBAAmB,CAKnJ;AAGD,wBAAgB,yBAAyB,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAOrG;AAiBD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,CAAC,EAAE,yBAAyB,EACvC,cAAc,SAA2B,GACxC,mBAAmB,CAgBrB;AAED,eAAO,MAAM,kCAAkC,o+DAyD2C,CAAC;AAE3F,eAAO,MAAM,2BAA2B,6ZAG4G,CAAC;AAErJ,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAU7E"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** Canonical FeltDB investigation collection. */
|
|
2
|
+
export const RUNTIME_INVESTIGATION_COLLECTION = 'runtime_investigation';
|
|
3
|
+
/** External/legacy DevTools collection retained without migration. */
|
|
4
|
+
export const LEGACY_RUNTIME_INVESTIGATION_COLLECTION = 'runtime_investigations';
|
|
1
5
|
const INVESTIGATION_TRANSITIONS = {
|
|
2
6
|
OBSERVED: ['INVESTIGATING'], INVESTIGATING: ['FINDING'], FINDING: ['PROPOSED'], PROPOSED: [],
|
|
3
7
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* This module is browser-safe: it must not import Node built-ins.
|
|
10
10
|
*/
|
|
11
|
-
import type { CorrelatedRuntimeEvent, RuntimeRequestObservation } from './workspace-types.js';
|
|
11
|
+
import type { CorrelatedRuntimeEvent, RuntimeObservationCorrelation, RuntimeRequestObservation } from './workspace-types.js';
|
|
12
12
|
/** Workspace collection holding durable runtime observations. */
|
|
13
13
|
export declare const RUNTIME_OBSERVATION_COLLECTION = "runtime_observation";
|
|
14
14
|
/**
|
|
@@ -61,6 +61,9 @@ export interface RuntimeObservationInput {
|
|
|
61
61
|
startedAt: number;
|
|
62
62
|
completedAt: number;
|
|
63
63
|
workspaceId?: string;
|
|
64
|
+
sessionId?: string;
|
|
65
|
+
runtimeInstanceId?: string;
|
|
66
|
+
correlation?: RuntimeObservationCorrelation;
|
|
64
67
|
page?: string;
|
|
65
68
|
userAgent?: string;
|
|
66
69
|
correlationId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-observation.d.ts","sourceRoot":"","sources":["../../src/workspace/runtime-observation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"runtime-observation.d.ts","sourceRoot":"","sources":["../../src/workspace/runtime-observation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,6BAA6B,EAC7B,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,iEAAiE;AACjE,eAAO,MAAM,8BAA8B,wBAAwB,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,UAGvC,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAOlD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgB7C;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,OAAO,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|
|
|
119
119
|
export function createCorrelationId() {
|
|
120
120
|
return `corr_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`;
|
|
121
121
|
}
|
|
122
|
+
const FORBIDDEN_CHARACTERISTIC = /(authorization|cookie|headers?|body|payload|data)/i;
|
|
123
|
+
/** Keep diagnostic metadata factual while excluding headers and body-shaped values. */
|
|
124
|
+
function redactCharacteristics(characteristics) {
|
|
125
|
+
if (!characteristics)
|
|
126
|
+
return undefined;
|
|
127
|
+
return Object.fromEntries(Object.entries(characteristics)
|
|
128
|
+
.filter(([name]) => !FORBIDDEN_CHARACTERISTIC.test(name))
|
|
129
|
+
.map(([name, value]) => [name, typeof value === 'string' ? redactMessage(value) : value]));
|
|
130
|
+
}
|
|
122
131
|
/**
|
|
123
132
|
* Build a redacted runtime observation.
|
|
124
133
|
*
|
|
@@ -130,6 +139,15 @@ export function createRuntimeObservation(input) {
|
|
|
130
139
|
return {
|
|
131
140
|
observationId: createObservationId(),
|
|
132
141
|
workspaceId: input.workspaceId,
|
|
142
|
+
sessionId: input.sessionId,
|
|
143
|
+
runtimeInstanceId: input.runtimeInstanceId,
|
|
144
|
+
correlation: input.correlation?.source ? {
|
|
145
|
+
source: {
|
|
146
|
+
product: input.correlation.source.product,
|
|
147
|
+
clientId: input.correlation.source.clientId,
|
|
148
|
+
investigationId: input.correlation.source.investigationId,
|
|
149
|
+
},
|
|
150
|
+
} : undefined,
|
|
133
151
|
method: input.method.toUpperCase(),
|
|
134
152
|
url: redactUrl(input.url),
|
|
135
153
|
status: input.status,
|
|
@@ -146,7 +164,7 @@ export function createRuntimeObservation(input) {
|
|
|
146
164
|
stack: event.stack ? redactMessage(event.stack) : undefined,
|
|
147
165
|
})),
|
|
148
166
|
networkFailure: input.networkFailure || undefined,
|
|
149
|
-
requestCharacteristics: input.requestCharacteristics,
|
|
150
|
-
responseCharacteristics: input.responseCharacteristics,
|
|
167
|
+
requestCharacteristics: redactCharacteristics(input.requestCharacteristics),
|
|
168
|
+
responseCharacteristics: redactCharacteristics(input.responseCharacteristics),
|
|
151
169
|
};
|
|
152
170
|
}
|
|
@@ -24,6 +24,10 @@ export interface RuntimeObservationOptions {
|
|
|
24
24
|
endpoint?: string;
|
|
25
25
|
/** Workspace id, when the workspace is already known. */
|
|
26
26
|
workspaceId?: string;
|
|
27
|
+
/** Canonical `feltdb dev` session identity supplied by the session handshake. */
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
/** Canonical runtime initialization identity supplied by the runtime bridge. */
|
|
30
|
+
runtimeInstanceId?: string;
|
|
27
31
|
/**
|
|
28
32
|
* How long a failing request is held so that console and runtime errors
|
|
29
33
|
* emitted immediately afterwards can be correlated to it.
|
|
@@ -34,6 +38,8 @@ export interface RuntimeObservationOptions {
|
|
|
34
38
|
}
|
|
35
39
|
export interface RuntimeObservationHandle {
|
|
36
40
|
workspaceId: string;
|
|
41
|
+
sessionId?: string;
|
|
42
|
+
runtimeInstanceId?: string;
|
|
37
43
|
/** Observations produced by this page, in order. */
|
|
38
44
|
observations(): RuntimeRequestObservation[];
|
|
39
45
|
/** Resolve once every pending observation has been persisted. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-observer.d.ts","sourceRoot":"","sources":["../../src/workspace/runtime-observer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAA0B,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAS9F,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAC;CAC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AA2E;IAC3E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAID;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CA8PnC"}
|
|
@@ -76,6 +76,8 @@ export async function startRuntimeObservation(options) {
|
|
|
76
76
|
startedAt: input.startedAt,
|
|
77
77
|
completedAt,
|
|
78
78
|
workspaceId: connection.workspaceId,
|
|
79
|
+
sessionId: options.sessionId,
|
|
80
|
+
runtimeInstanceId: options.runtimeInstanceId,
|
|
79
81
|
page: scope.location ? String(scope.location.href) : undefined,
|
|
80
82
|
userAgent: scope.navigator ? String(scope.navigator.userAgent) : undefined,
|
|
81
83
|
correlationId: input.correlationId,
|
|
@@ -243,6 +245,8 @@ export async function startRuntimeObservation(options) {
|
|
|
243
245
|
};
|
|
244
246
|
const handle = {
|
|
245
247
|
workspaceId: connection.workspaceId,
|
|
248
|
+
sessionId: options.sessionId,
|
|
249
|
+
runtimeInstanceId: options.runtimeInstanceId,
|
|
246
250
|
observations: () => [...emitted],
|
|
247
251
|
flush,
|
|
248
252
|
stop: async () => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Manages durable workspace identities and discovery.
|
|
5
5
|
*/
|
|
6
6
|
import type { DevelopmentWorkspace, WorkspaceDiscovery } from './workspace-types.js';
|
|
7
|
-
export declare function createWorkspaceId(
|
|
7
|
+
export declare function createWorkspaceId(_projectId: string): string;
|
|
8
8
|
export declare function isValidWorkspaceId(id: string): boolean;
|
|
9
9
|
export declare function createDevelopmentWorkspace(projectId: string, name: string): DevelopmentWorkspace;
|
|
10
10
|
export declare function updateWorkspaceTimestamp(workspace: DevelopmentWorkspace): DevelopmentWorkspace;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-identity.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace-identity.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAIrF,wBAAgB,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"workspace-identity.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace-identity.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAIrF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,oBAAoB,CAStB;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,oBAAoB,GAC9B,oBAAoB,CAKtB;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA0BpC;AAED,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Manages durable workspace identities and discovery.
|
|
5
5
|
*/
|
|
6
6
|
const WORKSPACE_ID_PREFIX = 'ws_';
|
|
7
|
-
export function createWorkspaceId(
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
return `${WORKSPACE_ID_PREFIX}${
|
|
7
|
+
export function createWorkspaceId(_projectId) {
|
|
8
|
+
const random = globalThis.crypto?.randomUUID?.().replace(/-/g, '')
|
|
9
|
+
?? `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}${Math.random().toString(36).slice(2)}`;
|
|
10
|
+
return `${WORKSPACE_ID_PREFIX}${random}`;
|
|
11
11
|
}
|
|
12
12
|
export function isValidWorkspaceId(id) {
|
|
13
13
|
return id.startsWith(WORKSPACE_ID_PREFIX);
|