@bbigbang/core 0.1.0
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/config.js +380 -0
- package/dist/execution/executionDispatcher.js +3810 -0
- package/dist/main.js +90 -0
- package/dist/nodeEventHistory.js +206 -0
- package/dist/scheduler/dreamLogic.js +50 -0
- package/dist/scheduler/dreamScheduler.js +65 -0
- package/dist/services/agentFileAccessService.js +1913 -0
- package/dist/services/agentRuntimeCleanupBroker.js +62 -0
- package/dist/services/agentSkillsBroker.js +118 -0
- package/dist/services/agentSkillsService.js +83 -0
- package/dist/services/agentWorkspaceBroker.js +937 -0
- package/dist/services/agentWorkspaceService.js +70 -0
- package/dist/services/appVersion.js +14 -0
- package/dist/services/auth.js +586 -0
- package/dist/services/claudeControlBroker.js +154 -0
- package/dist/services/claudeTranscriptBroker.js +100 -0
- package/dist/services/claudeTranscriptService.js +359 -0
- package/dist/services/codexAppServerBroker.js +155 -0
- package/dist/services/codexTranscriptBroker.js +98 -0
- package/dist/services/codexTranscriptService.js +961 -0
- package/dist/services/droidMissionBroker.js +124 -0
- package/dist/services/droidMissionImporter.js +630 -0
- package/dist/services/droidModelOptions.js +165 -0
- package/dist/services/hubServerRegistrationService.js +268 -0
- package/dist/services/libraryManifest.js +43 -0
- package/dist/services/libraryScaffold.js +26 -0
- package/dist/services/libraryService.js +2263 -0
- package/dist/services/memoryService.js +386 -0
- package/dist/services/missionEvidence.js +377 -0
- package/dist/services/missionService.js +2361 -0
- package/dist/services/missionTrace.js +158 -0
- package/dist/services/nativeMissionBriefParser.js +120 -0
- package/dist/services/nativeMissionOrchestrator.js +2045 -0
- package/dist/services/nativeMissionReportGenerator.js +227 -0
- package/dist/services/nativeMissionValidationRunner.js +452 -0
- package/dist/services/nativeMissionWorkerBroker.js +190 -0
- package/dist/services/nodeRegistry.js +34 -0
- package/dist/services/nodeStateReconciler.js +97 -0
- package/dist/services/panelMediaScanner.js +119 -0
- package/dist/services/persistentRuntimeJsonlClient.js +153 -0
- package/dist/services/platformAgentPolicy.js +180 -0
- package/dist/services/platformAgentService.js +2041 -0
- package/dist/services/projectAccessResolver.js +93 -0
- package/dist/services/projectService.js +392 -0
- package/dist/services/resourceSpaceService.js +140 -0
- package/dist/services/scenarioRuntimeService.js +1130 -0
- package/dist/services/suggestedPlannerService.js +868 -0
- package/dist/services/workbenchGitBroker.js +161 -0
- package/dist/services/workbenchGitService.js +69 -0
- package/dist/services/workbenchInspectBroker.js +65 -0
- package/dist/services/workbenchNodePathService.js +79 -0
- package/dist/services/workbenchRegistryService.js +240 -0
- package/dist/services/workbenchRootService.js +181 -0
- package/dist/services/workbenchTerminalBroker.js +378 -0
- package/dist/services/workspaceRunOwnership.js +60 -0
- package/dist/services/workspaceScaffold.js +105 -0
- package/dist/services/workspaceSessionRuntimeService.js +576 -0
- package/dist/services/workspaceSessionService.js +245 -0
- package/dist/services/workspaceToolActionRunner.js +1582 -0
- package/dist/services/workspaceToolErrors.js +10 -0
- package/dist/services/workspaceToolExecutionUtils.js +895 -0
- package/dist/services/workspaceToolLatestStateProjector.js +91 -0
- package/dist/services/workspaceToolManifest.js +572 -0
- package/dist/services/workspaceToolMutationQueue.js +43 -0
- package/dist/services/workspaceToolPanelProjection.js +460 -0
- package/dist/services/workspaceToolPromotion.js +255 -0
- package/dist/services/workspaceToolPromotionState.js +224 -0
- package/dist/services/workspaceToolPublishDiagnostics.js +189 -0
- package/dist/services/workspaceToolPublishIdentityResolver.js +146 -0
- package/dist/services/workspaceToolReadModel.js +378 -0
- package/dist/services/workspaceToolRunLedger.js +239 -0
- package/dist/services/workspaceToolService.js +3067 -0
- package/dist/services/workspaceToolSnapshotPanelSync.js +293 -0
- package/dist/services/workspaceToolTerminalLifecycle.js +283 -0
- package/dist/services/workspaceToolTypes.js +1 -0
- package/dist/services/workspaceToolUploadMaterializer.js +228 -0
- package/dist/web/actionCardRoutes.js +129 -0
- package/dist/web/actionCards.js +469 -0
- package/dist/web/activationContext.js +684 -0
- package/dist/web/agentChannelGuards.js +48 -0
- package/dist/web/agentMentionCooldowns.js +32 -0
- package/dist/web/agentReminders.js +1668 -0
- package/dist/web/agentRuntimePresence.js +197 -0
- package/dist/web/agentSelfState.js +494 -0
- package/dist/web/agentTaskLinks.js +26 -0
- package/dist/web/agentVisibility.js +79 -0
- package/dist/web/assets.js +95 -0
- package/dist/web/channelActivationPrompt.js +395 -0
- package/dist/web/channelMemoryNotes.js +127 -0
- package/dist/web/channelMentions.js +10 -0
- package/dist/web/channelMessageSequences.js +19 -0
- package/dist/web/channelSubscriptions.js +26 -0
- package/dist/web/clearedTaskRoots.js +10 -0
- package/dist/web/collaborationPromptGuidance.js +36 -0
- package/dist/web/collaborationSurfaceState.js +140 -0
- package/dist/web/contextBundleRanking.js +154 -0
- package/dist/web/contextBundleResolver.js +488 -0
- package/dist/web/conversationBuiltinSkillRoots.js +50 -0
- package/dist/web/conversationControls.js +232 -0
- package/dist/web/conversationHandoffs.js +612 -0
- package/dist/web/conversationManager.js +2511 -0
- package/dist/web/conversationSummaries.js +876 -0
- package/dist/web/conversationSurfaceKinds.js +17 -0
- package/dist/web/conversationTargets.js +173 -0
- package/dist/web/directActivationPrompt.js +122 -0
- package/dist/web/directReplyTargets.js +69 -0
- package/dist/web/directThreadResolver.js +129 -0
- package/dist/web/dmTaskHandoffPrompt.js +120 -0
- package/dist/web/dmTaskThreadStatusProjection.js +229 -0
- package/dist/web/ftsQuery.js +33 -0
- package/dist/web/internalAgentRouter.js +11341 -0
- package/dist/web/libraryCuratorScheduler.js +58 -0
- package/dist/web/libraryDocumentPromptGuidance.js +8 -0
- package/dist/web/messageCheckpoints.js +19 -0
- package/dist/web/nodeWsHandler.js +2495 -0
- package/dist/web/notificationRounds.js +1061 -0
- package/dist/web/panelActionMessages.js +108 -0
- package/dist/web/panelActivationPrompt.js +18 -0
- package/dist/web/panelAudit.js +273 -0
- package/dist/web/panelLifecycle.js +222 -0
- package/dist/web/panelMediaPolicy.js +43 -0
- package/dist/web/panelPathPolicy.js +63 -0
- package/dist/web/panelPreviews.js +175 -0
- package/dist/web/panelQueryHandles.js +2749 -0
- package/dist/web/panelRoutes.js +2147 -0
- package/dist/web/panels.js +904 -0
- package/dist/web/peerInboxAggregates.js +1247 -0
- package/dist/web/planApprovalState.js +92 -0
- package/dist/web/platformAgentScheduler.js +66 -0
- package/dist/web/proactiveOpportunities.js +452 -0
- package/dist/web/promptContextSections.js +242 -0
- package/dist/web/promptHistorySanitizer.js +26 -0
- package/dist/web/promptSlashCommands.js +158 -0
- package/dist/web/rollingConversationSummary.js +453 -0
- package/dist/web/routeHelpers.js +11 -0
- package/dist/web/routes/handoff.js +288 -0
- package/dist/web/routes/history.js +345 -0
- package/dist/web/routes/memory.js +258 -0
- package/dist/web/routes/selfState.js +171 -0
- package/dist/web/routes/workspace.js +154 -0
- package/dist/web/runSurfaceWatermarks.js +431 -0
- package/dist/web/runtimeCapabilities.js +48 -0
- package/dist/web/sameAgentHandoffs.js +494 -0
- package/dist/web/server.js +15567 -0
- package/dist/web/sharedCollaborationCapsules.js +163 -0
- package/dist/web/soloSessionRelay.js +42 -0
- package/dist/web/soloWsHandler.js +138 -0
- package/dist/web/suggestedPlannerScheduler.js +56 -0
- package/dist/web/surfaceActivationPolicy.js +108 -0
- package/dist/web/surfaceCollaborators.js +61 -0
- package/dist/web/surfaceSystemStatus.js +263 -0
- package/dist/web/targetParticipants.js +77 -0
- package/dist/web/taskEvents.js +49 -0
- package/dist/web/taskLifecycleMessages.js +165 -0
- package/dist/web/taskLoops.js +732 -0
- package/dist/web/taskMemoryNotes.js +224 -0
- package/dist/web/taskNumbers.js +16 -0
- package/dist/web/taskOwnerGuards.js +49 -0
- package/dist/web/taskParticipantResolver.js +42 -0
- package/dist/web/taskParticipants.js +97 -0
- package/dist/web/taskSourceDetails.js +20 -0
- package/dist/web/taskStateViews.js +210 -0
- package/dist/web/taskStatusTransitions.js +9 -0
- package/dist/web/taskThreadFollowups.js +599 -0
- package/dist/web/taskThreadRuntimeClosure.js +685 -0
- package/dist/web/taskUpdateDelivery.js +104 -0
- package/dist/web/threadReplyContentHeuristics.js +30 -0
- package/dist/web/threadRoots.js +61 -0
- package/dist/web/threadTaskBindings.js +365 -0
- package/dist/web/uiPanelPromptGuidance.js +27 -0
- package/dist/web/workspaceMemoryHints.js +143 -0
- package/dist/web/workspaceToolPromptGuidance.js +30 -0
- package/dist/web/wsHandler.js +397 -0
- package/dist/web/wsSink.js +116 -0
- package/package.json +54 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
export class CodexAppServerBroker {
|
|
3
|
+
pending = new Map();
|
|
4
|
+
nodeRegistry;
|
|
5
|
+
timeoutMs;
|
|
6
|
+
constructor(params) {
|
|
7
|
+
this.nodeRegistry = params.nodeRegistry;
|
|
8
|
+
this.timeoutMs = params.timeoutMs ?? 15_000;
|
|
9
|
+
}
|
|
10
|
+
listModels(nodeId, params) {
|
|
11
|
+
return this.sendRequest('models', nodeId, (requestId) => ({
|
|
12
|
+
type: 'codex.model.list.request',
|
|
13
|
+
requestId,
|
|
14
|
+
workspaceRoot: params?.workspaceRoot ?? null,
|
|
15
|
+
cursor: params?.cursor ?? null,
|
|
16
|
+
limit: params?.limit ?? null,
|
|
17
|
+
includeHidden: params?.includeHidden ?? null,
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
listSkills(nodeId, params) {
|
|
21
|
+
return this.sendRequest('skills', nodeId, (requestId) => ({
|
|
22
|
+
type: 'codex.skills.list.request',
|
|
23
|
+
requestId,
|
|
24
|
+
workspaceRoot: params.workspaceRoot,
|
|
25
|
+
skillRoots: params.skillRoots ?? [],
|
|
26
|
+
forceReload: params.forceReload,
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
listThreads(nodeId, params) {
|
|
30
|
+
return this.sendRequest('thread-list', nodeId, (requestId) => ({
|
|
31
|
+
type: 'codex.thread.list.request',
|
|
32
|
+
requestId,
|
|
33
|
+
workspaceRoot: params.workspaceRoot,
|
|
34
|
+
cursor: params.cursor ?? null,
|
|
35
|
+
limit: params.limit ?? null,
|
|
36
|
+
archived: params.archived ?? null,
|
|
37
|
+
searchTerm: params.searchTerm ?? null,
|
|
38
|
+
useStateDbOnly: params.useStateDbOnly,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
readThread(nodeId, params) {
|
|
42
|
+
return this.sendRequest('thread-read', nodeId, (requestId) => ({
|
|
43
|
+
type: 'codex.thread.read.request',
|
|
44
|
+
requestId,
|
|
45
|
+
workspaceRoot: params.workspaceRoot,
|
|
46
|
+
threadId: params.threadId,
|
|
47
|
+
includeTurns: params.includeTurns,
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
summarizeConversation(nodeId, params) {
|
|
51
|
+
return this.sendRequest('conversation-summary', nodeId, (requestId) => ({
|
|
52
|
+
type: 'codex.conversation.summary.request',
|
|
53
|
+
requestId,
|
|
54
|
+
prompt: params.prompt,
|
|
55
|
+
envVars: params.envVars,
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
handleModelListResponse(msg) {
|
|
59
|
+
const pending = this.takePending(msg.requestId, 'models');
|
|
60
|
+
if (!pending)
|
|
61
|
+
return;
|
|
62
|
+
if (msg.error || !msg.models) {
|
|
63
|
+
pending.reject(new Error(msg.error ?? 'Codex model list request failed.'));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
pending.resolve({
|
|
67
|
+
models: msg.models,
|
|
68
|
+
nextCursor: msg.nextCursor ?? null,
|
|
69
|
+
defaultModel: msg.defaultModel ?? null,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
handleSkillsListResponse(msg) {
|
|
73
|
+
const pending = this.takePending(msg.requestId, 'skills');
|
|
74
|
+
if (!pending)
|
|
75
|
+
return;
|
|
76
|
+
if (msg.error || !msg.data) {
|
|
77
|
+
pending.reject(new Error(msg.error ?? 'Codex skills list request failed.'));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
pending.resolve({ data: msg.data });
|
|
81
|
+
}
|
|
82
|
+
handleThreadListResponse(msg) {
|
|
83
|
+
const pending = this.takePending(msg.requestId, 'thread-list');
|
|
84
|
+
if (!pending)
|
|
85
|
+
return;
|
|
86
|
+
if (msg.error || !msg.threads) {
|
|
87
|
+
pending.reject(new Error(msg.error ?? 'Codex thread list request failed.'));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
pending.resolve({
|
|
91
|
+
threads: msg.threads,
|
|
92
|
+
nextCursor: msg.nextCursor ?? null,
|
|
93
|
+
backwardsCursor: msg.backwardsCursor ?? null,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
handleThreadReadResponse(msg) {
|
|
97
|
+
const pending = this.takePending(msg.requestId, 'thread-read');
|
|
98
|
+
if (!pending)
|
|
99
|
+
return;
|
|
100
|
+
if (msg.error || !msg.thread) {
|
|
101
|
+
pending.reject(new Error(msg.error ?? 'Codex thread read request failed.'));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
pending.resolve({ thread: msg.thread });
|
|
105
|
+
}
|
|
106
|
+
handleConversationSummaryResponse(msg) {
|
|
107
|
+
const pending = this.takePending(msg.requestId, 'conversation-summary');
|
|
108
|
+
if (!pending)
|
|
109
|
+
return;
|
|
110
|
+
if (msg.error || typeof msg.content !== 'string') {
|
|
111
|
+
pending.reject(new Error(msg.error ?? 'Codex conversation summary request failed.'));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
pending.resolve(msg.content);
|
|
115
|
+
}
|
|
116
|
+
rejectPendingForNode(nodeId) {
|
|
117
|
+
for (const [requestId, pending] of this.pending.entries()) {
|
|
118
|
+
if (pending.nodeId !== nodeId)
|
|
119
|
+
continue;
|
|
120
|
+
clearTimeout(pending.timer);
|
|
121
|
+
pending.reject(new Error(`Agent node disconnected: ${nodeId}`));
|
|
122
|
+
this.pending.delete(requestId);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
sendRequest(kind, nodeId, buildMessage) {
|
|
126
|
+
const requestId = randomUUID();
|
|
127
|
+
return new Promise((resolve, reject) => {
|
|
128
|
+
const timer = setTimeout(() => {
|
|
129
|
+
this.pending.delete(requestId);
|
|
130
|
+
reject(new Error('Codex app-server request timed out.'));
|
|
131
|
+
}, this.timeoutMs);
|
|
132
|
+
this.pending.set(requestId, {
|
|
133
|
+
kind,
|
|
134
|
+
nodeId,
|
|
135
|
+
resolve,
|
|
136
|
+
reject,
|
|
137
|
+
timer,
|
|
138
|
+
});
|
|
139
|
+
const sent = this.nodeRegistry.send(nodeId, buildMessage(requestId));
|
|
140
|
+
if (!sent) {
|
|
141
|
+
clearTimeout(timer);
|
|
142
|
+
this.pending.delete(requestId);
|
|
143
|
+
reject(new Error('Agent node is offline.'));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
takePending(requestId, kind) {
|
|
148
|
+
const pending = this.pending.get(requestId);
|
|
149
|
+
if (!pending || pending.kind !== kind)
|
|
150
|
+
return null;
|
|
151
|
+
this.pending.delete(requestId);
|
|
152
|
+
clearTimeout(pending.timer);
|
|
153
|
+
return pending;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
export class CodexTranscriptBroker {
|
|
3
|
+
pending = new Map();
|
|
4
|
+
nodeRegistry;
|
|
5
|
+
timeoutMs;
|
|
6
|
+
constructor(params) {
|
|
7
|
+
this.nodeRegistry = params.nodeRegistry;
|
|
8
|
+
this.timeoutMs = params.timeoutMs ?? 15_000;
|
|
9
|
+
}
|
|
10
|
+
listFiles(nodeId, maxFiles = 1000) {
|
|
11
|
+
const requestId = randomUUID();
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const timer = setTimeout(() => {
|
|
14
|
+
this.pending.delete(requestId);
|
|
15
|
+
reject(new Error('Codex transcript request timed out.'));
|
|
16
|
+
}, this.timeoutMs);
|
|
17
|
+
this.pending.set(requestId, { nodeId, kind: 'list', resolve, reject, timer });
|
|
18
|
+
const sent = this.nodeRegistry.send(nodeId, {
|
|
19
|
+
type: 'codex.transcript.list.request',
|
|
20
|
+
requestId,
|
|
21
|
+
maxFiles,
|
|
22
|
+
});
|
|
23
|
+
if (!sent) {
|
|
24
|
+
clearTimeout(timer);
|
|
25
|
+
this.pending.delete(requestId);
|
|
26
|
+
reject(new Error('Agent node is offline.'));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
readFile(nodeId, transcriptPath) {
|
|
31
|
+
const requestId = randomUUID();
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const timer = setTimeout(() => {
|
|
34
|
+
this.pending.delete(requestId);
|
|
35
|
+
reject(new Error('Codex transcript request timed out.'));
|
|
36
|
+
}, this.timeoutMs);
|
|
37
|
+
this.pending.set(requestId, { nodeId, kind: 'read', resolve, reject, timer });
|
|
38
|
+
const sent = this.nodeRegistry.send(nodeId, {
|
|
39
|
+
type: 'codex.transcript.read.request',
|
|
40
|
+
requestId,
|
|
41
|
+
path: transcriptPath,
|
|
42
|
+
});
|
|
43
|
+
if (!sent) {
|
|
44
|
+
clearTimeout(timer);
|
|
45
|
+
this.pending.delete(requestId);
|
|
46
|
+
reject(new Error('Agent node is offline.'));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
handleListResponse(msg) {
|
|
51
|
+
const pending = this.pending.get(msg.requestId);
|
|
52
|
+
if (!pending || pending.kind !== 'list')
|
|
53
|
+
return;
|
|
54
|
+
this.pending.delete(msg.requestId);
|
|
55
|
+
clearTimeout(pending.timer);
|
|
56
|
+
if (msg.error || !msg.rootPath || !msg.files) {
|
|
57
|
+
pending.reject(new Error(formatErrorMessage(msg.errorCode, msg.error)));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
pending.resolve({
|
|
61
|
+
rootPath: msg.rootPath,
|
|
62
|
+
files: msg.files,
|
|
63
|
+
truncated: Boolean(msg.truncated),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
handleReadResponse(msg) {
|
|
67
|
+
const pending = this.pending.get(msg.requestId);
|
|
68
|
+
if (!pending || pending.kind !== 'read')
|
|
69
|
+
return;
|
|
70
|
+
this.pending.delete(msg.requestId);
|
|
71
|
+
clearTimeout(pending.timer);
|
|
72
|
+
if (msg.error || !msg.rootPath || msg.content === undefined || msg.size === undefined) {
|
|
73
|
+
pending.reject(new Error(formatErrorMessage(msg.errorCode, msg.error)));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
pending.resolve({
|
|
77
|
+
rootPath: msg.rootPath,
|
|
78
|
+
path: msg.path,
|
|
79
|
+
content: msg.content,
|
|
80
|
+
size: msg.size,
|
|
81
|
+
modifiedAt: msg.modifiedAt ?? null,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
rejectPendingForNode(nodeId) {
|
|
85
|
+
for (const [requestId, pending] of this.pending.entries()) {
|
|
86
|
+
if (pending.nodeId !== nodeId)
|
|
87
|
+
continue;
|
|
88
|
+
clearTimeout(pending.timer);
|
|
89
|
+
pending.reject(new Error(`Agent node disconnected: ${nodeId}`));
|
|
90
|
+
this.pending.delete(requestId);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function formatErrorMessage(errorCode, error) {
|
|
95
|
+
if (errorCode)
|
|
96
|
+
return `${errorCode}:${error ?? 'codex transcript request failed'}`;
|
|
97
|
+
return error ?? 'codex transcript request failed';
|
|
98
|
+
}
|