@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,158 @@
|
|
|
1
|
+
import { deriveMissionEvidence } from './missionEvidence.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build interpreted trace rows from the same raw mission evidence used by the
|
|
4
|
+
* evidence registry. Each trace row carries a role, operation, and confidence
|
|
5
|
+
* classification so consumers can reason about how the interpretation was
|
|
6
|
+
* produced.
|
|
7
|
+
*/
|
|
8
|
+
export function deriveMissionTrace(input) {
|
|
9
|
+
const evidence = deriveMissionEvidence(input);
|
|
10
|
+
return evidence.map((item) => evidenceToTrace(item));
|
|
11
|
+
}
|
|
12
|
+
export function filterMissionTrace(traces, filter) {
|
|
13
|
+
let result = traces;
|
|
14
|
+
if (filter.role) {
|
|
15
|
+
result = result.filter((trace) => trace.role === filter.role);
|
|
16
|
+
}
|
|
17
|
+
if (filter.operation) {
|
|
18
|
+
result = result.filter((trace) => trace.operation === filter.operation);
|
|
19
|
+
}
|
|
20
|
+
if (filter.confidence) {
|
|
21
|
+
result = result.filter((trace) => trace.confidence === filter.confidence);
|
|
22
|
+
}
|
|
23
|
+
if (typeof filter.after === 'number' && Number.isFinite(filter.after)) {
|
|
24
|
+
const after = filter.after;
|
|
25
|
+
result = result.filter((trace) => trace.time > after);
|
|
26
|
+
}
|
|
27
|
+
if (typeof filter.limit === 'number' && Number.isFinite(filter.limit) && filter.limit > 0) {
|
|
28
|
+
const limit = filter.limit;
|
|
29
|
+
result = result.slice(0, Math.min(limit, 1_000));
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
function evidenceToTrace(evidence) {
|
|
34
|
+
return {
|
|
35
|
+
traceId: `trace:${evidence.evidenceId}`,
|
|
36
|
+
missionId: evidence.missionId,
|
|
37
|
+
runtimeProvider: evidence.runtimeProvider,
|
|
38
|
+
time: evidence.eventTime,
|
|
39
|
+
role: evidence.roleHint,
|
|
40
|
+
operation: inferOperation(evidence),
|
|
41
|
+
confidence: inferConfidence(evidence),
|
|
42
|
+
summary: evidence.payloadPreview,
|
|
43
|
+
details: evidence.payloadJson,
|
|
44
|
+
evidenceIds: [evidence.evidenceId],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function inferOperation(evidence) {
|
|
48
|
+
switch (evidence.sourceType) {
|
|
49
|
+
case 'mission_event': {
|
|
50
|
+
const eventType = String(evidence.payloadJson.eventType ?? '').toLowerCase();
|
|
51
|
+
if (eventType === 'mission_features_parsed' || eventType === 'mission_planning_started' || eventType === 'mission_planning_completed') {
|
|
52
|
+
return 'mission_plan';
|
|
53
|
+
}
|
|
54
|
+
if (eventType === 'milestone_started' || eventType === 'milestone_completed') {
|
|
55
|
+
return 'milestone_start';
|
|
56
|
+
}
|
|
57
|
+
if (eventType === 'feature_queued')
|
|
58
|
+
return 'feature_queued';
|
|
59
|
+
if (eventType === 'feature_accepted')
|
|
60
|
+
return 'feature_started';
|
|
61
|
+
if (eventType.startsWith('feature_'))
|
|
62
|
+
return 'feature_lifecycle';
|
|
63
|
+
if (eventType === 'worker_prompt_built')
|
|
64
|
+
return 'worker_prompt_built';
|
|
65
|
+
if (eventType === 'worker_output_received')
|
|
66
|
+
return 'worker_output_received';
|
|
67
|
+
if (eventType === 'handoff_created')
|
|
68
|
+
return 'handoff_created';
|
|
69
|
+
if (eventType === 'handoff_items_dismissed')
|
|
70
|
+
return 'handoff_items_dismissed';
|
|
71
|
+
if (eventType === 'mission_worker_transcript')
|
|
72
|
+
return 'worker_tool_call';
|
|
73
|
+
if (eventType.includes('validation_started'))
|
|
74
|
+
return 'validation_started';
|
|
75
|
+
if (eventType.includes('validation'))
|
|
76
|
+
return 'validation_result';
|
|
77
|
+
if (eventType === 'retry_scheduled')
|
|
78
|
+
return 'retry_scheduled';
|
|
79
|
+
if (eventType === 'mission_interaction_queued'
|
|
80
|
+
|| eventType === 'mission_interaction_accepted'
|
|
81
|
+
|| eventType === 'mission_interaction_delivered') {
|
|
82
|
+
return 'interaction_queued';
|
|
83
|
+
}
|
|
84
|
+
if (eventType === 'mission_interaction_observed')
|
|
85
|
+
return 'interaction_observed';
|
|
86
|
+
if (eventType === 'mission_interaction_applied')
|
|
87
|
+
return 'interaction_applied';
|
|
88
|
+
if (eventType === 'report_generated')
|
|
89
|
+
return 'report_generated';
|
|
90
|
+
if (eventType === 'artifact_written')
|
|
91
|
+
return 'artifact_written';
|
|
92
|
+
if (eventType === 'mission_pause_requested')
|
|
93
|
+
return 'pause_requested';
|
|
94
|
+
if (eventType === 'mission_pause_effective')
|
|
95
|
+
return 'pause_effective';
|
|
96
|
+
if (eventType === 'mission_resume_requested')
|
|
97
|
+
return 'resume_requested';
|
|
98
|
+
if (eventType === 'mission_resume_effective')
|
|
99
|
+
return 'resume_effective';
|
|
100
|
+
if (eventType === 'mission_cancellation_requested')
|
|
101
|
+
return 'cancellation_requested';
|
|
102
|
+
if (eventType === 'mission_cancellation_effective')
|
|
103
|
+
return 'cancellation_effective';
|
|
104
|
+
if (eventType.startsWith('mission_'))
|
|
105
|
+
return 'mission_lifecycle';
|
|
106
|
+
return 'mission_event';
|
|
107
|
+
}
|
|
108
|
+
case 'mission_attempt':
|
|
109
|
+
return 'worker_dispatch';
|
|
110
|
+
case 'mission_snapshot': {
|
|
111
|
+
const section = String(evidence.payloadJson.section ?? '');
|
|
112
|
+
switch (section) {
|
|
113
|
+
case 'overview':
|
|
114
|
+
return 'artifact_written';
|
|
115
|
+
case 'feature':
|
|
116
|
+
return 'feature_lifecycle';
|
|
117
|
+
case 'handoff':
|
|
118
|
+
return 'handoff_created';
|
|
119
|
+
case 'assertion':
|
|
120
|
+
return 'validation_result';
|
|
121
|
+
case 'report':
|
|
122
|
+
return 'report_generated';
|
|
123
|
+
default:
|
|
124
|
+
return 'artifact_written';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
case 'mission_feature':
|
|
128
|
+
return 'feature_lifecycle';
|
|
129
|
+
case 'mission_assertion': {
|
|
130
|
+
const status = String(evidence.payloadJson.status ?? '').toLowerCase();
|
|
131
|
+
return status === 'pending' ? 'validation_assertion' : 'validation_result';
|
|
132
|
+
}
|
|
133
|
+
case 'mission_interaction':
|
|
134
|
+
return 'interaction_queued';
|
|
135
|
+
default:
|
|
136
|
+
return 'mission_event';
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function inferConfidence(evidence) {
|
|
140
|
+
switch (evidence.sourceType) {
|
|
141
|
+
case 'mission_event':
|
|
142
|
+
case 'mission_attempt':
|
|
143
|
+
case 'mission_interaction':
|
|
144
|
+
return 'observed';
|
|
145
|
+
case 'mission_snapshot':
|
|
146
|
+
return 'derived';
|
|
147
|
+
case 'mission_feature': {
|
|
148
|
+
const status = String(evidence.payloadJson.status ?? '').toLowerCase();
|
|
149
|
+
return status === 'pending' ? 'inferred' : 'derived';
|
|
150
|
+
}
|
|
151
|
+
case 'mission_assertion': {
|
|
152
|
+
const status = String(evidence.payloadJson.status ?? '').toLowerCase();
|
|
153
|
+
return status === 'pending' ? 'inferred' : 'derived';
|
|
154
|
+
}
|
|
155
|
+
default:
|
|
156
|
+
return 'unknown';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* Parse a mission description into an ordered list of features grouped by milestone.
|
|
4
|
+
*
|
|
5
|
+
* Supports a lightweight markdown convention:
|
|
6
|
+
* - `## Milestone <name>` starts a milestone. All features after it belong to this
|
|
7
|
+
* milestone until another milestone header appears.
|
|
8
|
+
* - `### Feature <name>` starts a feature. The text until the next header or list
|
|
9
|
+
* section is the feature description.
|
|
10
|
+
* - `**Preconditions:**` followed by a `-` bullet list defines preconditions.
|
|
11
|
+
* - `**Expected behavior:**` or `**Expected Behavior:**` followed by a `-` bullet
|
|
12
|
+
* list defines expected behavior assertions.
|
|
13
|
+
*
|
|
14
|
+
* If the description is empty or contains only whitespace, an empty array is returned.
|
|
15
|
+
* If the description has no milestone/feature headers, the whole text becomes a single
|
|
16
|
+
* feature in a `default` milestone.
|
|
17
|
+
*/
|
|
18
|
+
export function parseMissionBrief(description) {
|
|
19
|
+
const text = (description ?? '').trim();
|
|
20
|
+
if (!text)
|
|
21
|
+
return [];
|
|
22
|
+
const lines = text.split('\n');
|
|
23
|
+
const hasStructure = lines.some((line) => /^(#{2,3})\s+/.test(line.trim()));
|
|
24
|
+
if (!hasStructure) {
|
|
25
|
+
return [createFeature('default', 0, text)];
|
|
26
|
+
}
|
|
27
|
+
const features = [];
|
|
28
|
+
let currentMilestone = 'default';
|
|
29
|
+
let currentFeature = null;
|
|
30
|
+
let ordering = 0;
|
|
31
|
+
function flushFeature() {
|
|
32
|
+
if (!currentFeature)
|
|
33
|
+
return;
|
|
34
|
+
features.push(createFeature(currentMilestone, ordering++, currentFeature.title, currentFeature.bodyLines, currentFeature.preconditions, currentFeature.expectedBehavior));
|
|
35
|
+
currentFeature = null;
|
|
36
|
+
}
|
|
37
|
+
for (let index = 0; index < lines.length; index++) {
|
|
38
|
+
const rawLine = lines[index];
|
|
39
|
+
const line = rawLine.trimEnd();
|
|
40
|
+
const trimmed = line.trim();
|
|
41
|
+
const milestoneMatch = trimmed.match(/^##\s+(.+)$/);
|
|
42
|
+
if (milestoneMatch) {
|
|
43
|
+
flushFeature();
|
|
44
|
+
currentMilestone = milestoneMatch[1].trim() || 'default';
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const featureMatch = trimmed.match(/^###\s+(.+)$/);
|
|
48
|
+
if (featureMatch) {
|
|
49
|
+
flushFeature();
|
|
50
|
+
currentFeature = {
|
|
51
|
+
title: featureMatch[1].trim() || 'Untitled feature',
|
|
52
|
+
bodyLines: [],
|
|
53
|
+
preconditions: [],
|
|
54
|
+
expectedBehavior: [],
|
|
55
|
+
listContext: null,
|
|
56
|
+
};
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (!currentFeature)
|
|
60
|
+
continue;
|
|
61
|
+
const lower = trimmed.toLowerCase();
|
|
62
|
+
if (lower === '**preconditions:**'
|
|
63
|
+
|| lower === 'preconditions:'
|
|
64
|
+
|| lower === '**preconditions**') {
|
|
65
|
+
currentFeature.listContext = 'preconditions';
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (lower === '**expected behavior:**'
|
|
69
|
+
|| lower === 'expected behavior:'
|
|
70
|
+
|| lower === '**expected behavior**'
|
|
71
|
+
|| lower === '**expectedbehaviour:**'
|
|
72
|
+
|| lower === 'expected behaviour:') {
|
|
73
|
+
currentFeature.listContext = 'expectedBehavior';
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const bulletMatch = trimmed.match(/^[-*]\s+(.*)$/);
|
|
77
|
+
if (bulletMatch) {
|
|
78
|
+
const item = bulletMatch[1].trim();
|
|
79
|
+
if (currentFeature.listContext === 'preconditions') {
|
|
80
|
+
currentFeature.preconditions.push(item);
|
|
81
|
+
}
|
|
82
|
+
else if (currentFeature.listContext === 'expectedBehavior') {
|
|
83
|
+
currentFeature.expectedBehavior.push(item);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
currentFeature.bodyLines.push(rawLine);
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
// Non-bullet, non-header line resets list context and contributes to the body.
|
|
91
|
+
if (trimmed.length > 0) {
|
|
92
|
+
currentFeature.listContext = null;
|
|
93
|
+
currentFeature.bodyLines.push(rawLine);
|
|
94
|
+
}
|
|
95
|
+
else if (currentFeature.listContext == null) {
|
|
96
|
+
// Preserve blank lines as paragraph breaks in the body.
|
|
97
|
+
currentFeature.bodyLines.push('');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
flushFeature();
|
|
101
|
+
return features;
|
|
102
|
+
}
|
|
103
|
+
function createFeature(milestone, ordering, title, bodyLines = [], preconditions = [], expectedBehavior = []) {
|
|
104
|
+
const description = bodyLines
|
|
105
|
+
.map((line) => line.trimEnd())
|
|
106
|
+
.join('\n')
|
|
107
|
+
.replace(/\n{2,}/g, '\n\n')
|
|
108
|
+
.trim();
|
|
109
|
+
return {
|
|
110
|
+
featureId: randomUUID(),
|
|
111
|
+
milestone: milestone.trim() || 'default',
|
|
112
|
+
description: description || title,
|
|
113
|
+
skillName: null,
|
|
114
|
+
status: 'pending',
|
|
115
|
+
ordering,
|
|
116
|
+
preconditions,
|
|
117
|
+
expectedBehavior,
|
|
118
|
+
retryCount: 0,
|
|
119
|
+
};
|
|
120
|
+
}
|