@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,58 @@
|
|
|
1
|
+
import { getLibraryCuratorTerminalError } from '../services/libraryService.js';
|
|
2
|
+
export const LIBRARY_CURATOR_POLL_INTERVAL_MS = 60_000;
|
|
3
|
+
export function startLibraryCuratorScheduler(params) {
|
|
4
|
+
const intervalMs = Math.max(5_000, params.intervalMs ?? LIBRARY_CURATOR_POLL_INTERVAL_MS);
|
|
5
|
+
let closed = false;
|
|
6
|
+
let running = false;
|
|
7
|
+
let timer = null;
|
|
8
|
+
const tick = async () => {
|
|
9
|
+
if (closed || running)
|
|
10
|
+
return;
|
|
11
|
+
running = true;
|
|
12
|
+
try {
|
|
13
|
+
const now = Date.now();
|
|
14
|
+
const dueConfigs = params.libraryService.listDueConfigs(now);
|
|
15
|
+
for (const config of dueConfigs) {
|
|
16
|
+
const username = params.libraryService.getUsernameForUserId(config.userId);
|
|
17
|
+
if (!username)
|
|
18
|
+
continue;
|
|
19
|
+
const runningOrganize = params.db.prepare(`SELECT run_id as runId FROM library_curator_runs
|
|
20
|
+
WHERE user_id = ? AND status = 'running' LIMIT 1`).get(config.userId);
|
|
21
|
+
if (runningOrganize)
|
|
22
|
+
continue;
|
|
23
|
+
await params.libraryService.dispatchOrganizeRun({
|
|
24
|
+
userId: config.userId,
|
|
25
|
+
username,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
running = false;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
timer = setInterval(() => {
|
|
34
|
+
void tick();
|
|
35
|
+
}, intervalMs);
|
|
36
|
+
timer.unref?.();
|
|
37
|
+
return {
|
|
38
|
+
tick,
|
|
39
|
+
stop: () => {
|
|
40
|
+
closed = true;
|
|
41
|
+
if (!timer)
|
|
42
|
+
return;
|
|
43
|
+
clearInterval(timer);
|
|
44
|
+
timer = null;
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export async function handleLibraryCuratorRunFinished(params) {
|
|
49
|
+
const row = params.db.prepare(`SELECT user_id as userId FROM library_curator_runs WHERE run_id = ? AND status = 'running'`).get(params.runId);
|
|
50
|
+
if (!row)
|
|
51
|
+
return;
|
|
52
|
+
const terminalError = getLibraryCuratorTerminalError(params.stopReason, params.error);
|
|
53
|
+
await params.libraryService.finalizeOrganizeRun({
|
|
54
|
+
runId: params.runId,
|
|
55
|
+
userId: row.userId,
|
|
56
|
+
error: terminalError,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function buildLibraryDocumentGuidancePromptSection() {
|
|
2
|
+
return [
|
|
3
|
+
'[Library document guidance]',
|
|
4
|
+
'Document-library mode is enabled for this primary DM conversation.',
|
|
5
|
+
'Use the built-in library-documents skill for document-library workflow, reading boundaries, and update rules.',
|
|
6
|
+
'Prefer reading the skill files and `.library` mirror when you need document details instead of relying on prompt-injected document inventories.',
|
|
7
|
+
].join('\n');
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function checkpointThreadKey(threadRootId) {
|
|
2
|
+
return threadRootId ?? '';
|
|
3
|
+
}
|
|
4
|
+
export function getAgentMessageCheckpoint(db, agentId, channelId, threadRootId) {
|
|
5
|
+
const row = db.prepare(`SELECT last_seq as lastSeq FROM agent_message_checkpoints
|
|
6
|
+
WHERE agent_id = ? AND channel_id = ? AND thread_root_id = ?`).get(agentId, channelId, checkpointThreadKey(threadRootId));
|
|
7
|
+
return row?.lastSeq ?? 0;
|
|
8
|
+
}
|
|
9
|
+
export function setAgentMessageCheckpoint(db, agentId, channelId, lastSeq, threadRootId) {
|
|
10
|
+
db.prepare(`INSERT INTO agent_message_checkpoints(agent_id, channel_id, thread_root_id, last_seq)
|
|
11
|
+
VALUES(?, ?, ?, ?)
|
|
12
|
+
ON CONFLICT(agent_id, channel_id, thread_root_id) DO UPDATE SET last_seq = excluded.last_seq`).run(agentId, channelId, checkpointThreadKey(threadRootId), lastSeq);
|
|
13
|
+
}
|
|
14
|
+
export function bumpAgentMessageCheckpoint(db, agentId, channelId, lastSeq, threadRootId) {
|
|
15
|
+
db.prepare(`INSERT INTO agent_message_checkpoints(agent_id, channel_id, thread_root_id, last_seq)
|
|
16
|
+
VALUES(?, ?, ?, ?)
|
|
17
|
+
ON CONFLICT(agent_id, channel_id, thread_root_id) DO UPDATE
|
|
18
|
+
SET last_seq = MAX(agent_message_checkpoints.last_seq, excluded.last_seq)`).run(agentId, channelId, checkpointThreadKey(threadRootId), lastSeq);
|
|
19
|
+
}
|