@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,124 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
export class DroidMissionBroker {
|
|
3
|
+
pending = new Map();
|
|
4
|
+
pendingInspect = new Map();
|
|
5
|
+
active = new Map();
|
|
6
|
+
nodeRegistry;
|
|
7
|
+
timeoutMs;
|
|
8
|
+
constructor(params) {
|
|
9
|
+
this.nodeRegistry = params.nodeRegistry;
|
|
10
|
+
this.timeoutMs = params.timeoutMs ?? 15_000;
|
|
11
|
+
}
|
|
12
|
+
runMission(nodeId, mission, options = {}) {
|
|
13
|
+
const missionDir = mission.missionDir;
|
|
14
|
+
if (!missionDir) {
|
|
15
|
+
return Promise.reject(new Error('Mission has no missionDir configured.'));
|
|
16
|
+
}
|
|
17
|
+
const requestId = options.requestId ?? randomUUID();
|
|
18
|
+
options.onRequestCreated?.(requestId);
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
const timer = setTimeout(() => {
|
|
21
|
+
this.pending.delete(requestId);
|
|
22
|
+
reject(new Error('Droid mission start request timed out.'));
|
|
23
|
+
}, this.timeoutMs);
|
|
24
|
+
this.pending.set(requestId, { nodeId, missionId: mission.missionId, interaction: options.interaction === true, resolve, reject, timer });
|
|
25
|
+
const sent = this.nodeRegistry.send(nodeId, {
|
|
26
|
+
type: 'mission.run.request',
|
|
27
|
+
requestId,
|
|
28
|
+
missionId: mission.missionId,
|
|
29
|
+
title: mission.title,
|
|
30
|
+
prompt: options.promptOverride ?? (mission.description || mission.title),
|
|
31
|
+
continueSession: options.continueSession,
|
|
32
|
+
interaction: options.interaction,
|
|
33
|
+
workspaceRoot: mission.workspacePath,
|
|
34
|
+
missionDir,
|
|
35
|
+
modelMode: mission.modelMode,
|
|
36
|
+
orchestratorModel: mission.orchestratorModel,
|
|
37
|
+
workerModel: mission.workerModel,
|
|
38
|
+
validatorModel: mission.validatorModel,
|
|
39
|
+
});
|
|
40
|
+
if (!sent) {
|
|
41
|
+
clearTimeout(timer);
|
|
42
|
+
this.pending.delete(requestId);
|
|
43
|
+
reject(new Error('Agent node is offline.'));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
inspectContinuation(nodeId, mission) {
|
|
48
|
+
const missionDir = mission.missionDir;
|
|
49
|
+
if (!missionDir) {
|
|
50
|
+
return Promise.reject(new Error('Mission has no missionDir configured.'));
|
|
51
|
+
}
|
|
52
|
+
const requestId = randomUUID();
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
const timer = setTimeout(() => {
|
|
55
|
+
this.pendingInspect.delete(requestId);
|
|
56
|
+
reject(new Error('Droid continuation readiness request timed out.'));
|
|
57
|
+
}, this.timeoutMs);
|
|
58
|
+
this.pendingInspect.set(requestId, { nodeId, missionId: mission.missionId, resolve, reject, timer });
|
|
59
|
+
const sent = this.nodeRegistry.send(nodeId, {
|
|
60
|
+
type: 'mission.continuation.inspect.request',
|
|
61
|
+
requestId,
|
|
62
|
+
missionId: mission.missionId,
|
|
63
|
+
workspaceRoot: mission.workspacePath,
|
|
64
|
+
missionDir,
|
|
65
|
+
});
|
|
66
|
+
if (!sent) {
|
|
67
|
+
clearTimeout(timer);
|
|
68
|
+
this.pendingInspect.delete(requestId);
|
|
69
|
+
reject(new Error('Agent node is offline.'));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
hasActiveMission(missionId) {
|
|
74
|
+
for (const pending of this.pending.values()) {
|
|
75
|
+
if (pending.missionId === missionId)
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
for (const attempt of this.active.values()) {
|
|
79
|
+
if (attempt.missionId === missionId)
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
handleAccepted(msg, nodeId) {
|
|
85
|
+
const pending = this.pending.get(msg.requestId);
|
|
86
|
+
if (!pending || pending.nodeId !== nodeId || pending.missionId !== msg.missionId)
|
|
87
|
+
return null;
|
|
88
|
+
this.pending.delete(msg.requestId);
|
|
89
|
+
clearTimeout(pending.timer);
|
|
90
|
+
const attempt = { requestId: msg.requestId, nodeId, missionId: msg.missionId, interaction: pending.interaction };
|
|
91
|
+
this.active.set(msg.requestId, attempt);
|
|
92
|
+
pending.resolve(msg);
|
|
93
|
+
return attempt;
|
|
94
|
+
}
|
|
95
|
+
verifyEvent(msg, nodeId) {
|
|
96
|
+
const attempt = this.active.get(msg.requestId);
|
|
97
|
+
if (!attempt || attempt.nodeId !== nodeId || attempt.missionId !== msg.missionId)
|
|
98
|
+
return null;
|
|
99
|
+
return attempt;
|
|
100
|
+
}
|
|
101
|
+
handleEnd(msg, nodeId) {
|
|
102
|
+
const pending = this.pending.get(msg.requestId);
|
|
103
|
+
if (pending) {
|
|
104
|
+
this.pending.delete(msg.requestId);
|
|
105
|
+
clearTimeout(pending.timer);
|
|
106
|
+
pending.reject(new Error(msg.error ?? 'Droid mission did not start.'));
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const attempt = this.active.get(msg.requestId);
|
|
110
|
+
if (!attempt || attempt.nodeId !== nodeId || attempt.missionId !== msg.missionId)
|
|
111
|
+
return null;
|
|
112
|
+
this.active.delete(msg.requestId);
|
|
113
|
+
return attempt;
|
|
114
|
+
}
|
|
115
|
+
handleContinuationInspectResponse(msg, nodeId) {
|
|
116
|
+
const pending = this.pendingInspect.get(msg.requestId);
|
|
117
|
+
if (!pending || pending.nodeId !== nodeId || pending.missionId !== msg.missionId)
|
|
118
|
+
return false;
|
|
119
|
+
this.pendingInspect.delete(msg.requestId);
|
|
120
|
+
clearTimeout(pending.timer);
|
|
121
|
+
pending.resolve(msg);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
}
|