@a5c-ai/babysitter-sdk 0.0.187 → 0.0.188-staging.06ee31ad
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/api/breakpoints.d.ts +94 -0
- package/dist/api/breakpoints.d.ts.map +1 -0
- package/dist/api/breakpoints.js +340 -0
- package/dist/api/effects.d.ts +87 -0
- package/dist/api/effects.d.ts.map +1 -0
- package/dist/api/effects.js +309 -0
- package/dist/api/eventStream.d.ts +34 -0
- package/dist/api/eventStream.d.ts.map +1 -0
- package/dist/api/eventStream.js +126 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +27 -0
- package/dist/api/runs.d.ts +86 -0
- package/dist/api/runs.d.ts.map +1 -0
- package/dist/api/runs.js +253 -0
- package/dist/api/utils.d.ts +28 -0
- package/dist/api/utils.d.ts.map +1 -0
- package/dist/api/utils.js +74 -0
- package/dist/breakpoints/delegation.d.ts +40 -0
- package/dist/breakpoints/delegation.d.ts.map +1 -0
- package/dist/breakpoints/delegation.js +197 -0
- package/dist/breakpoints/delegationTypes.d.ts +44 -0
- package/dist/breakpoints/delegationTypes.d.ts.map +1 -0
- package/dist/breakpoints/delegationTypes.js +8 -0
- package/dist/breakpoints/evaluator.d.ts +33 -0
- package/dist/breakpoints/evaluator.d.ts.map +1 -0
- package/dist/breakpoints/evaluator.js +128 -0
- package/dist/breakpoints/index.d.ts +11 -0
- package/dist/breakpoints/index.d.ts.map +1 -0
- package/dist/breakpoints/index.js +30 -0
- package/dist/breakpoints/patterns.d.ts +24 -0
- package/dist/breakpoints/patterns.d.ts.map +1 -0
- package/dist/breakpoints/patterns.js +88 -0
- package/dist/breakpoints/postures.d.ts +26 -0
- package/dist/breakpoints/postures.d.ts.map +1 -0
- package/dist/breakpoints/postures.js +98 -0
- package/dist/breakpoints/rules.d.ts +26 -0
- package/dist/breakpoints/rules.d.ts.map +1 -0
- package/dist/breakpoints/rules.js +110 -0
- package/dist/breakpoints/types.d.ts +78 -0
- package/dist/breakpoints/types.d.ts.map +1 -0
- package/dist/breakpoints/types.js +7 -0
- package/dist/cli/commandRegistry.d.ts +27 -0
- package/dist/cli/commandRegistry.d.ts.map +1 -0
- package/dist/cli/commandRegistry.js +126 -0
- package/dist/cli/commands/breakpointRules.d.ts +26 -0
- package/dist/cli/commands/breakpointRules.d.ts.map +1 -0
- package/dist/cli/commands/breakpointRules.js +219 -0
- package/dist/cli/commands/costStats.d.ts +13 -0
- package/dist/cli/commands/costStats.d.ts.map +1 -0
- package/dist/cli/commands/costStats.js +319 -0
- package/dist/cli/commands/daemon.d.ts +31 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -0
- package/dist/cli/commands/daemon.js +148 -0
- package/dist/cli/commands/harnessCreateRun.d.ts.map +1 -1
- package/dist/cli/commands/harnessCreateRun.js +13 -9
- package/dist/cli/commands/harnessPhase1.d.ts +1 -0
- package/dist/cli/commands/harnessPhase1.d.ts.map +1 -1
- package/dist/cli/commands/harnessPhase1.js +12 -12
- package/dist/cli/commands/harnessPhase2.d.ts +10 -0
- package/dist/cli/commands/harnessPhase2.d.ts.map +1 -1
- package/dist/cli/commands/harnessPhase2.js +410 -81
- package/dist/cli/commands/harnessPrompts.d.ts +1 -0
- package/dist/cli/commands/harnessPrompts.d.ts.map +1 -1
- package/dist/cli/commands/harnessPrompts.js +13 -0
- package/dist/cli/commands/harnessResumeRun.d.ts +1 -0
- package/dist/cli/commands/harnessResumeRun.d.ts.map +1 -1
- package/dist/cli/commands/harnessResumeRun.js +13 -11
- package/dist/cli/commands/harnessUtils.d.ts +28 -5
- package/dist/cli/commands/harnessUtils.d.ts.map +1 -1
- package/dist/cli/commands/harnessUtils.js +83 -9
- package/dist/cli/commands/hookLog.d.ts.map +1 -1
- package/dist/cli/commands/hookLog.js +7 -0
- package/dist/cli/commands/instructions.d.ts +1 -0
- package/dist/cli/commands/instructions.d.ts.map +1 -1
- package/dist/cli/commands/instructions.js +38 -5
- package/dist/cli/commands/jsonlInteractive.d.ts +35 -0
- package/dist/cli/commands/jsonlInteractive.d.ts.map +1 -0
- package/dist/cli/commands/jsonlInteractive.js +302 -0
- package/dist/cli/commands/mcpConnect.d.ts +33 -0
- package/dist/cli/commands/mcpConnect.d.ts.map +1 -0
- package/dist/cli/commands/mcpConnect.js +182 -0
- package/dist/cli/commands/mcpServe.d.ts +10 -1
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +38 -10
- package/dist/cli/commands/runIterate.d.ts +13 -0
- package/dist/cli/commands/runIterate.d.ts.map +1 -1
- package/dist/cli/commands/runIterate.js +21 -0
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +2 -0
- package/dist/cli/commands/sessionHistory.d.ts +14 -0
- package/dist/cli/commands/sessionHistory.d.ts.map +1 -0
- package/dist/cli/commands/sessionHistory.js +82 -0
- package/dist/cli/commands/tui.d.ts +25 -0
- package/dist/cli/commands/tui.d.ts.map +1 -0
- package/dist/cli/commands/tui.js +195 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +336 -13
- package/dist/compression/compaction.d.ts +80 -0
- package/dist/compression/compaction.d.ts.map +1 -0
- package/dist/compression/compaction.js +308 -0
- package/dist/config/defaults.d.ts +10 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +19 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/cost/claudeCodeParser.d.ts +81 -0
- package/dist/cost/claudeCodeParser.d.ts.map +1 -0
- package/dist/cost/claudeCodeParser.js +232 -0
- package/dist/cost/collector.d.ts +42 -0
- package/dist/cost/collector.d.ts.map +1 -0
- package/dist/cost/collector.js +105 -0
- package/dist/cost/effectCost.d.ts +21 -0
- package/dist/cost/effectCost.d.ts.map +1 -0
- package/dist/cost/effectCost.js +26 -0
- package/dist/cost/index.d.ts +19 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +39 -0
- package/dist/cost/journal.d.ts +40 -0
- package/dist/cost/journal.d.ts.map +1 -0
- package/dist/cost/journal.js +137 -0
- package/dist/cost/types.d.ts +164 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +231 -0
- package/dist/daemon/config.d.ts +8 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +122 -0
- package/dist/daemon/daemonLog.d.ts +13 -0
- package/dist/daemon/daemonLog.d.ts.map +1 -0
- package/dist/daemon/daemonLog.js +64 -0
- package/dist/daemon/fileWatcher.d.ts +9 -0
- package/dist/daemon/fileWatcher.d.ts.map +1 -0
- package/dist/daemon/fileWatcher.js +140 -0
- package/dist/daemon/index.d.ts +12 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +22 -0
- package/dist/daemon/lifecycle.d.ts +12 -0
- package/dist/daemon/lifecycle.d.ts.map +1 -0
- package/dist/daemon/lifecycle.js +257 -0
- package/dist/daemon/loop.d.ts +21 -0
- package/dist/daemon/loop.d.ts.map +1 -0
- package/dist/daemon/loop.js +181 -0
- package/dist/daemon/timerScheduler.d.ts +17 -0
- package/dist/daemon/timerScheduler.d.ts.map +1 -0
- package/dist/daemon/timerScheduler.js +122 -0
- package/dist/daemon/types.d.ts +78 -0
- package/dist/daemon/types.d.ts.map +1 -0
- package/dist/daemon/types.js +5 -0
- package/dist/daemon/webhookListener.d.ts +6 -0
- package/dist/daemon/webhookListener.d.ts.map +1 -0
- package/dist/daemon/webhookListener.js +108 -0
- package/dist/dashboard/colors.d.ts +26 -0
- package/dist/dashboard/colors.d.ts.map +1 -0
- package/dist/dashboard/colors.js +38 -0
- package/dist/dashboard/components/BreakpointApproval.d.ts +25 -0
- package/dist/dashboard/components/BreakpointApproval.d.ts.map +1 -0
- package/dist/dashboard/components/BreakpointApproval.js +77 -0
- package/dist/dashboard/components/EffectTree.d.ts +17 -0
- package/dist/dashboard/components/EffectTree.d.ts.map +1 -0
- package/dist/dashboard/components/EffectTree.js +53 -0
- package/dist/dashboard/components/KeyValue.d.ts +7 -0
- package/dist/dashboard/components/KeyValue.d.ts.map +1 -0
- package/dist/dashboard/components/KeyValue.js +19 -0
- package/dist/dashboard/components/ProgressBar.d.ts +7 -0
- package/dist/dashboard/components/ProgressBar.d.ts.map +1 -0
- package/dist/dashboard/components/ProgressBar.js +34 -0
- package/dist/dashboard/components/StatusBadge.d.ts +4 -0
- package/dist/dashboard/components/StatusBadge.d.ts.map +1 -0
- package/dist/dashboard/components/StatusBadge.js +28 -0
- package/dist/dashboard/components/StatusLine.d.ts +13 -0
- package/dist/dashboard/components/StatusLine.d.ts.map +1 -0
- package/dist/dashboard/components/StatusLine.js +70 -0
- package/dist/dashboard/components/StructuredDiff.d.ts +6 -0
- package/dist/dashboard/components/StructuredDiff.d.ts.map +1 -0
- package/dist/dashboard/components/StructuredDiff.js +47 -0
- package/dist/dashboard/components/Table.d.ts +5 -0
- package/dist/dashboard/components/Table.d.ts.map +1 -0
- package/dist/dashboard/components/Table.js +25 -0
- package/dist/dashboard/components/index.d.ts +11 -0
- package/dist/dashboard/components/index.d.ts.map +1 -0
- package/dist/dashboard/components/index.js +25 -0
- package/dist/dashboard/components/messages/EffectRequestedMessage.d.ts +3 -0
- package/dist/dashboard/components/messages/EffectRequestedMessage.d.ts.map +1 -0
- package/dist/dashboard/components/messages/EffectRequestedMessage.js +21 -0
- package/dist/dashboard/components/messages/EffectResolvedMessage.d.ts +3 -0
- package/dist/dashboard/components/messages/EffectResolvedMessage.d.ts.map +1 -0
- package/dist/dashboard/components/messages/EffectResolvedMessage.js +20 -0
- package/dist/dashboard/components/messages/EventMessage.d.ts +3 -0
- package/dist/dashboard/components/messages/EventMessage.d.ts.map +1 -0
- package/dist/dashboard/components/messages/EventMessage.js +27 -0
- package/dist/dashboard/components/messages/RunCompletedMessage.d.ts +3 -0
- package/dist/dashboard/components/messages/RunCompletedMessage.d.ts.map +1 -0
- package/dist/dashboard/components/messages/RunCompletedMessage.js +17 -0
- package/dist/dashboard/components/messages/RunCreatedMessage.d.ts +3 -0
- package/dist/dashboard/components/messages/RunCreatedMessage.d.ts.map +1 -0
- package/dist/dashboard/components/messages/RunCreatedMessage.js +18 -0
- package/dist/dashboard/components/messages/RunFailedMessage.d.ts +3 -0
- package/dist/dashboard/components/messages/RunFailedMessage.d.ts.map +1 -0
- package/dist/dashboard/components/messages/RunFailedMessage.js +23 -0
- package/dist/dashboard/components/messages/index.d.ts +8 -0
- package/dist/dashboard/components/messages/index.d.ts.map +1 -0
- package/dist/dashboard/components/messages/index.js +15 -0
- package/dist/dashboard/components/messages/types.d.ts +9 -0
- package/dist/dashboard/components/messages/types.d.ts.map +1 -0
- package/dist/dashboard/components/messages/types.js +5 -0
- package/dist/dashboard/diffParser.d.ts +20 -0
- package/dist/dashboard/diffParser.d.ts.map +1 -0
- package/dist/dashboard/diffParser.js +58 -0
- package/dist/dashboard/index.d.ts +13 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +34 -0
- package/dist/dashboard/ink/App.d.ts +27 -0
- package/dist/dashboard/ink/App.d.ts.map +1 -0
- package/dist/dashboard/ink/App.js +78 -0
- package/dist/dashboard/ink/components/ActionMenu.d.ts +27 -0
- package/dist/dashboard/ink/components/ActionMenu.d.ts.map +1 -0
- package/dist/dashboard/ink/components/ActionMenu.js +97 -0
- package/dist/dashboard/ink/components/BreakpointPanel.d.ts +23 -0
- package/dist/dashboard/ink/components/BreakpointPanel.d.ts.map +1 -0
- package/dist/dashboard/ink/components/BreakpointPanel.js +94 -0
- package/dist/dashboard/ink/components/EffectsPanel.d.ts +24 -0
- package/dist/dashboard/ink/components/EffectsPanel.d.ts.map +1 -0
- package/dist/dashboard/ink/components/EffectsPanel.js +69 -0
- package/dist/dashboard/ink/components/Message.d.ts +25 -0
- package/dist/dashboard/ink/components/Message.d.ts.map +1 -0
- package/dist/dashboard/ink/components/Message.js +198 -0
- package/dist/dashboard/ink/components/MessagePane.d.ts +25 -0
- package/dist/dashboard/ink/components/MessagePane.d.ts.map +1 -0
- package/dist/dashboard/ink/components/MessagePane.js +161 -0
- package/dist/dashboard/ink/components/PromptBar.d.ts +38 -0
- package/dist/dashboard/ink/components/PromptBar.d.ts.map +1 -0
- package/dist/dashboard/ink/components/PromptBar.js +247 -0
- package/dist/dashboard/ink/components/RunListTable.d.ts +28 -0
- package/dist/dashboard/ink/components/RunListTable.d.ts.map +1 -0
- package/dist/dashboard/ink/components/RunListTable.js +118 -0
- package/dist/dashboard/ink/components/RunningIndicator.d.ts +25 -0
- package/dist/dashboard/ink/components/RunningIndicator.d.ts.map +1 -0
- package/dist/dashboard/ink/components/RunningIndicator.js +38 -0
- package/dist/dashboard/ink/components/SearchBar.d.ts +33 -0
- package/dist/dashboard/ink/components/SearchBar.d.ts.map +1 -0
- package/dist/dashboard/ink/components/SearchBar.js +147 -0
- package/dist/dashboard/ink/components/StatusBar.d.ts +37 -0
- package/dist/dashboard/ink/components/StatusBar.d.ts.map +1 -0
- package/dist/dashboard/ink/components/StatusBar.js +118 -0
- package/dist/dashboard/ink/components/StatusLine.d.ts +30 -0
- package/dist/dashboard/ink/components/StatusLine.d.ts.map +1 -0
- package/dist/dashboard/ink/components/StatusLine.js +122 -0
- package/dist/dashboard/ink/components/index.d.ts +24 -0
- package/dist/dashboard/ink/components/index.d.ts.map +1 -0
- package/dist/dashboard/ink/components/index.js +41 -0
- package/dist/dashboard/ink/components/primitives/BorderBox.d.ts +47 -0
- package/dist/dashboard/ink/components/primitives/BorderBox.d.ts.map +1 -0
- package/dist/dashboard/ink/components/primitives/BorderBox.js +107 -0
- package/dist/dashboard/ink/components/primitives/ProgressBar.d.ts +25 -0
- package/dist/dashboard/ink/components/primitives/ProgressBar.d.ts.map +1 -0
- package/dist/dashboard/ink/components/primitives/ProgressBar.js +55 -0
- package/dist/dashboard/ink/components/primitives/Tree.d.ts +27 -0
- package/dist/dashboard/ink/components/primitives/Tree.d.ts.map +1 -0
- package/dist/dashboard/ink/components/primitives/Tree.js +73 -0
- package/dist/dashboard/ink/components/primitives/index.d.ts +10 -0
- package/dist/dashboard/ink/components/primitives/index.d.ts.map +1 -0
- package/dist/dashboard/ink/components/primitives/index.js +16 -0
- package/dist/dashboard/ink/contexts/ChatContext.d.ts +58 -0
- package/dist/dashboard/ink/contexts/ChatContext.d.ts.map +1 -0
- package/dist/dashboard/ink/contexts/ChatContext.js +160 -0
- package/dist/dashboard/ink/contexts/ClockContext.d.ts +26 -0
- package/dist/dashboard/ink/contexts/ClockContext.d.ts.map +1 -0
- package/dist/dashboard/ink/contexts/ClockContext.js +43 -0
- package/dist/dashboard/ink/contexts/EffectsContext.d.ts +30 -0
- package/dist/dashboard/ink/contexts/EffectsContext.d.ts.map +1 -0
- package/dist/dashboard/ink/contexts/EffectsContext.js +88 -0
- package/dist/dashboard/ink/contexts/InkContext.d.ts +58 -0
- package/dist/dashboard/ink/contexts/InkContext.d.ts.map +1 -0
- package/dist/dashboard/ink/contexts/InkContext.js +77 -0
- package/dist/dashboard/ink/contexts/NavigationContext.d.ts +44 -0
- package/dist/dashboard/ink/contexts/NavigationContext.d.ts.map +1 -0
- package/dist/dashboard/ink/contexts/NavigationContext.js +91 -0
- package/dist/dashboard/ink/contexts/SessionContext.d.ts +73 -0
- package/dist/dashboard/ink/contexts/SessionContext.d.ts.map +1 -0
- package/dist/dashboard/ink/contexts/SessionContext.js +106 -0
- package/dist/dashboard/ink/contexts/ThemeContext.d.ts +17 -0
- package/dist/dashboard/ink/contexts/ThemeContext.d.ts.map +1 -0
- package/dist/dashboard/ink/contexts/ThemeContext.js +46 -0
- package/dist/dashboard/ink/data/runScanner.d.ts +44 -0
- package/dist/dashboard/ink/data/runScanner.d.ts.map +1 -0
- package/dist/dashboard/ink/data/runScanner.js +147 -0
- package/dist/dashboard/ink/helpers.d.ts +471 -0
- package/dist/dashboard/ink/helpers.d.ts.map +1 -0
- package/dist/dashboard/ink/helpers.js +1547 -0
- package/dist/dashboard/ink/hooks/useChat.d.ts +6 -0
- package/dist/dashboard/ink/hooks/useChat.d.ts.map +1 -0
- package/dist/dashboard/ink/hooks/useChat.js +8 -0
- package/dist/dashboard/ink/hooks/useClock.d.ts +14 -0
- package/dist/dashboard/ink/hooks/useClock.d.ts.map +1 -0
- package/dist/dashboard/ink/hooks/useClock.js +13 -0
- package/dist/dashboard/ink/hooks/useNavigation.d.ts +7 -0
- package/dist/dashboard/ink/hooks/useNavigation.d.ts.map +1 -0
- package/dist/dashboard/ink/hooks/useNavigation.js +10 -0
- package/dist/dashboard/ink/hooks/useRunDetail.d.ts +17 -0
- package/dist/dashboard/ink/hooks/useRunDetail.d.ts.map +1 -0
- package/dist/dashboard/ink/hooks/useRunDetail.js +65 -0
- package/dist/dashboard/ink/hooks/useRunScanner.d.ts +15 -0
- package/dist/dashboard/ink/hooks/useRunScanner.d.ts.map +1 -0
- package/dist/dashboard/ink/hooks/useRunScanner.js +57 -0
- package/dist/dashboard/ink/hooks/useSession.d.ts +14 -0
- package/dist/dashboard/ink/hooks/useSession.d.ts.map +1 -0
- package/dist/dashboard/ink/hooks/useSession.js +13 -0
- package/dist/dashboard/ink/hooks/useTheme.d.ts +8 -0
- package/dist/dashboard/ink/hooks/useTheme.d.ts.map +1 -0
- package/dist/dashboard/ink/hooks/useTheme.js +12 -0
- package/dist/dashboard/ink/index.d.ts +62 -0
- package/dist/dashboard/ink/index.d.ts.map +1 -0
- package/dist/dashboard/ink/index.js +167 -0
- package/dist/dashboard/ink/render.d.ts +31 -0
- package/dist/dashboard/ink/render.d.ts.map +1 -0
- package/dist/dashboard/ink/render.js +97 -0
- package/dist/dashboard/ink/types.d.ts +177 -0
- package/dist/dashboard/ink/types.d.ts.map +1 -0
- package/dist/dashboard/ink/types.js +8 -0
- package/dist/dashboard/ink/views/DashboardView.d.ts +23 -0
- package/dist/dashboard/ink/views/DashboardView.d.ts.map +1 -0
- package/dist/dashboard/ink/views/DashboardView.js +135 -0
- package/dist/dashboard/ink/views/RunDetailView.d.ts +17 -0
- package/dist/dashboard/ink/views/RunDetailView.d.ts.map +1 -0
- package/dist/dashboard/ink/views/RunDetailView.js +179 -0
- package/dist/dashboard/ink/views/SessionView.d.ts +16 -0
- package/dist/dashboard/ink/views/SessionView.d.ts.map +1 -0
- package/dist/dashboard/ink/views/SessionView.js +601 -0
- package/dist/dashboard/ink/views/index.d.ts +6 -0
- package/dist/dashboard/ink/views/index.d.ts.map +1 -0
- package/dist/dashboard/ink/views/index.js +10 -0
- package/dist/dashboard/render.d.ts +20 -0
- package/dist/dashboard/render.d.ts.map +1 -0
- package/dist/dashboard/render.js +30 -0
- package/dist/governance/bridge.d.ts +17 -0
- package/dist/governance/bridge.d.ts.map +1 -0
- package/dist/governance/bridge.js +46 -0
- package/dist/governance/builtins.d.ts +25 -0
- package/dist/governance/builtins.d.ts.map +1 -0
- package/dist/governance/builtins.js +67 -0
- package/dist/governance/engine.d.ts +20 -0
- package/dist/governance/engine.d.ts.map +1 -0
- package/dist/governance/engine.js +124 -0
- package/dist/governance/index.d.ts +11 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +25 -0
- package/dist/governance/logging.d.ts +18 -0
- package/dist/governance/logging.d.ts.map +1 -0
- package/dist/governance/logging.js +83 -0
- package/dist/governance/types.d.ts +106 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +13 -0
- package/dist/harness/agenticTools.d.ts +26 -1
- package/dist/harness/agenticTools.d.ts.map +1 -1
- package/dist/harness/agenticTools.js +726 -17
- package/dist/harness/backgroundProcessRegistry.d.ts +63 -0
- package/dist/harness/backgroundProcessRegistry.d.ts.map +1 -0
- package/dist/harness/backgroundProcessRegistry.js +199 -0
- package/dist/harness/backgroundTracker.d.ts +64 -0
- package/dist/harness/backgroundTracker.d.ts.map +1 -0
- package/dist/harness/backgroundTracker.js +107 -0
- package/dist/harness/claudeCode.d.ts +1 -1
- package/dist/harness/claudeCode.d.ts.map +1 -1
- package/dist/harness/claudeCode.js +134 -35
- package/dist/harness/codex.d.ts.map +1 -1
- package/dist/harness/codex.js +1 -0
- package/dist/harness/commandDiscovery.d.ts +37 -0
- package/dist/harness/commandDiscovery.d.ts.map +1 -0
- package/dist/harness/commandDiscovery.js +171 -0
- package/dist/harness/cursor.d.ts.map +1 -1
- package/dist/harness/cursor.js +3 -1
- package/dist/harness/deferredToolRegistry.d.ts +76 -0
- package/dist/harness/deferredToolRegistry.d.ts.map +1 -0
- package/dist/harness/deferredToolRegistry.js +150 -0
- package/dist/harness/discovery.d.ts.map +1 -1
- package/dist/harness/discovery.js +8 -1
- package/dist/harness/geminiCli.d.ts.map +1 -1
- package/dist/harness/geminiCli.js +3 -1
- package/dist/harness/githubCopilot.d.ts.map +1 -1
- package/dist/harness/githubCopilot.js +3 -1
- package/dist/harness/index.d.ts +11 -3
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +47 -1
- package/dist/harness/internal.d.ts.map +1 -1
- package/dist/harness/internal.js +10 -2
- package/dist/harness/invoker.d.ts +16 -0
- package/dist/harness/invoker.d.ts.map +1 -1
- package/dist/harness/invoker.js +220 -0
- package/dist/harness/modeSelector.d.ts +50 -0
- package/dist/harness/modeSelector.d.ts.map +1 -0
- package/dist/harness/modeSelector.js +124 -0
- package/dist/harness/ohMyPi.d.ts.map +1 -1
- package/dist/harness/ohMyPi.js +1 -0
- package/dist/harness/openclaw.d.ts +20 -0
- package/dist/harness/openclaw.d.ts.map +1 -0
- package/dist/harness/openclaw.js +340 -0
- package/dist/harness/opencode.d.ts.map +1 -1
- package/dist/harness/opencode.js +77 -5
- package/dist/harness/operatorCommands.d.ts +38 -0
- package/dist/harness/operatorCommands.d.ts.map +1 -0
- package/dist/harness/operatorCommands.js +118 -0
- package/dist/harness/pi.d.ts.map +1 -1
- package/dist/harness/pi.js +1 -0
- package/dist/harness/planMode.d.ts +68 -0
- package/dist/harness/planMode.d.ts.map +1 -0
- package/dist/harness/planMode.js +145 -0
- package/dist/harness/registry.d.ts.map +1 -1
- package/dist/harness/registry.js +2 -0
- package/dist/harness/streamingCapture.d.ts +44 -0
- package/dist/harness/streamingCapture.d.ts.map +1 -0
- package/dist/harness/streamingCapture.js +278 -0
- package/dist/harness/types.d.ts +28 -1
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js +6 -0
- package/dist/hooks/dispatcher.d.ts +9 -0
- package/dist/hooks/dispatcher.d.ts.map +1 -1
- package/dist/hooks/dispatcher.js +94 -0
- package/dist/hooks/index.d.ts +3 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/types.d.ts +17 -2
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/interaction/index.d.ts +2 -0
- package/dist/interaction/index.d.ts.map +1 -1
- package/dist/interaction/index.js +3 -0
- package/dist/interaction/interactionRouter.d.ts +25 -0
- package/dist/interaction/interactionRouter.d.ts.map +1 -0
- package/dist/interaction/interactionRouter.js +55 -0
- package/dist/logging/runLogger.js +2 -2
- package/dist/mcp/channels/allowlist.d.ts +19 -0
- package/dist/mcp/channels/allowlist.d.ts.map +1 -0
- package/dist/mcp/channels/allowlist.js +140 -0
- package/dist/mcp/channels/channelManager.d.ts +64 -0
- package/dist/mcp/channels/channelManager.d.ts.map +1 -0
- package/dist/mcp/channels/channelManager.js +137 -0
- package/dist/mcp/channels/inboundQueue.d.ts +47 -0
- package/dist/mcp/channels/inboundQueue.d.ts.map +1 -0
- package/dist/mcp/channels/inboundQueue.js +96 -0
- package/dist/mcp/channels/index.d.ts +11 -0
- package/dist/mcp/channels/index.d.ts.map +1 -0
- package/dist/mcp/channels/index.js +33 -0
- package/dist/mcp/channels/outbound.d.ts +33 -0
- package/dist/mcp/channels/outbound.d.ts.map +1 -0
- package/dist/mcp/channels/outbound.js +94 -0
- package/dist/mcp/channels/permissionRelay.d.ts +62 -0
- package/dist/mcp/channels/permissionRelay.d.ts.map +1 -0
- package/dist/mcp/channels/permissionRelay.js +159 -0
- package/dist/mcp/channels/types.d.ts +135 -0
- package/dist/mcp/channels/types.d.ts.map +1 -0
- package/dist/mcp/channels/types.js +16 -0
- package/dist/mcp/client/config.d.ts +26 -0
- package/dist/mcp/client/config.d.ts.map +1 -0
- package/dist/mcp/client/config.js +140 -0
- package/dist/mcp/client/executor.d.ts +28 -0
- package/dist/mcp/client/executor.d.ts.map +1 -0
- package/dist/mcp/client/executor.js +58 -0
- package/dist/mcp/client/index.d.ts +10 -0
- package/dist/mcp/client/index.d.ts.map +1 -0
- package/dist/mcp/client/index.js +25 -0
- package/dist/mcp/client/manager.d.ts +72 -0
- package/dist/mcp/client/manager.d.ts.map +1 -0
- package/dist/mcp/client/manager.js +212 -0
- package/dist/mcp/client/toolRegistry.d.ts +48 -0
- package/dist/mcp/client/toolRegistry.d.ts.map +1 -0
- package/dist/mcp/client/toolRegistry.js +116 -0
- package/dist/mcp/client/types.d.ts +94 -0
- package/dist/mcp/client/types.d.ts.map +1 -0
- package/dist/mcp/client/types.js +13 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +11 -3
- package/dist/mcp/tools/runs.d.ts.map +1 -1
- package/dist/mcp/tools/runs.js +59 -94
- package/dist/mcp/tools/sessions.d.ts.map +1 -1
- package/dist/mcp/tools/sessions.js +2 -0
- package/dist/mcp/transport/index.d.ts +5 -0
- package/dist/mcp/transport/index.d.ts.map +1 -0
- package/dist/mcp/transport/index.js +9 -0
- package/dist/mcp/transport/session.d.ts +16 -0
- package/dist/mcp/transport/session.d.ts.map +1 -0
- package/dist/mcp/transport/session.js +76 -0
- package/dist/mcp/transport/types.d.ts +17 -0
- package/dist/mcp/transport/types.d.ts.map +1 -0
- package/dist/mcp/transport/types.js +5 -0
- package/dist/mcp/transport/websocket.d.ts +39 -0
- package/dist/mcp/transport/websocket.d.ts.map +1 -0
- package/dist/mcp/transport/websocket.js +269 -0
- package/dist/observability/index.d.ts +3 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +6 -0
- package/dist/observability/timeline.d.ts +11 -0
- package/dist/observability/timeline.d.ts.map +1 -0
- package/dist/observability/timeline.js +176 -0
- package/dist/observability/types.d.ts +31 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/observability/types.js +5 -0
- package/dist/processLibrary/active.js +1 -1
- package/dist/profiles/types.d.ts +11 -0
- package/dist/profiles/types.d.ts.map +1 -1
- package/dist/prompts/babysitterMdDiscovery.d.ts +38 -0
- package/dist/prompts/babysitterMdDiscovery.d.ts.map +1 -0
- package/dist/prompts/babysitterMdDiscovery.js +150 -0
- package/dist/prompts/capabilityCollector.d.ts +48 -0
- package/dist/prompts/capabilityCollector.d.ts.map +1 -0
- package/dist/prompts/capabilityCollector.js +117 -0
- package/dist/prompts/compose.d.ts.map +1 -1
- package/dist/prompts/compose.js +15 -0
- package/dist/prompts/context.d.ts +12 -0
- package/dist/prompts/context.d.ts.map +1 -1
- package/dist/prompts/context.js +88 -12
- package/dist/prompts/continuityOverlay.d.ts +35 -0
- package/dist/prompts/continuityOverlay.d.ts.map +1 -0
- package/dist/prompts/continuityOverlay.js +210 -0
- package/dist/prompts/index.d.ts +9 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +29 -1
- package/dist/prompts/parts/codingPhilosophy.d.ts +7 -0
- package/dist/prompts/parts/codingPhilosophy.d.ts.map +1 -0
- package/dist/prompts/parts/codingPhilosophy.js +11 -0
- package/dist/prompts/parts/continuityOverlay.d.ts +2 -0
- package/dist/prompts/parts/continuityOverlay.d.ts.map +1 -0
- package/dist/prompts/parts/continuityOverlay.js +5 -0
- package/dist/prompts/parts/gitSafety.d.ts +7 -0
- package/dist/prompts/parts/gitSafety.d.ts.map +1 -0
- package/dist/prompts/parts/gitSafety.js +11 -0
- package/dist/prompts/parts/index.d.ts +9 -0
- package/dist/prompts/parts/index.d.ts.map +1 -1
- package/dist/prompts/parts/index.js +19 -1
- package/dist/prompts/parts/outputEfficiency.d.ts +7 -0
- package/dist/prompts/parts/outputEfficiency.d.ts.map +1 -0
- package/dist/prompts/parts/outputEfficiency.js +11 -0
- package/dist/prompts/parts/parallelDispatch.d.ts +15 -0
- package/dist/prompts/parts/parallelDispatch.d.ts.map +1 -0
- package/dist/prompts/parts/parallelDispatch.js +46 -0
- package/dist/prompts/parts/parallelPhaseDetection.d.ts +6 -0
- package/dist/prompts/parts/parallelPhaseDetection.d.ts.map +1 -0
- package/dist/prompts/parts/parallelPhaseDetection.js +10 -0
- package/dist/prompts/parts/processCreation.d.ts.map +1 -1
- package/dist/prompts/parts/processCreation.js +1 -15
- package/dist/prompts/parts/projectInstructions.d.ts +8 -0
- package/dist/prompts/parts/projectInstructions.d.ts.map +1 -0
- package/dist/prompts/parts/projectInstructions.js +28 -0
- package/dist/prompts/parts/runOverlapDetection.d.ts +6 -0
- package/dist/prompts/parts/runOverlapDetection.d.ts.map +1 -0
- package/dist/prompts/parts/runOverlapDetection.js +10 -0
- package/dist/prompts/parts/toolPreferences.d.ts +7 -0
- package/dist/prompts/parts/toolPreferences.d.ts.map +1 -0
- package/dist/prompts/parts/toolPreferences.js +11 -0
- package/dist/prompts/runtimeContext.d.ts +30 -0
- package/dist/prompts/runtimeContext.d.ts.map +1 -0
- package/dist/prompts/runtimeContext.js +49 -0
- package/dist/prompts/strata.d.ts +60 -0
- package/dist/prompts/strata.d.ts.map +1 -0
- package/dist/prompts/strata.js +241 -0
- package/dist/prompts/templates/breakpoint-handling.md +37 -1
- package/dist/prompts/templates/coding-philosophy.md +9 -0
- package/dist/prompts/templates/commands/doctor.md +9 -9
- package/dist/prompts/templates/git-safety.md +9 -0
- package/dist/prompts/templates/intent-fidelity-checks.md +3 -1
- package/dist/prompts/templates/output-efficiency.md +12 -0
- package/dist/prompts/templates/parallel-phase-detection.md +59 -0
- package/dist/prompts/templates/process-creation.md +14 -7
- package/dist/prompts/templates/process-guidelines.md +6 -3
- package/dist/prompts/templates/run-overlap-detection.md +63 -0
- package/dist/prompts/templates/task-examples.md +47 -0
- package/dist/prompts/templates/task-kinds.md +45 -3
- package/dist/prompts/templates/tool-preferences.md +6 -0
- package/dist/prompts/types.d.ts +84 -0
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/runtime/asyncEffects.d.ts +22 -0
- package/dist/runtime/asyncEffects.d.ts.map +1 -0
- package/dist/runtime/asyncEffects.js +86 -0
- package/dist/runtime/commitEffectResult.d.ts +9 -0
- package/dist/runtime/commitEffectResult.d.ts.map +1 -1
- package/dist/runtime/commitEffectResult.js +59 -0
- package/dist/runtime/createRun.d.ts.map +1 -1
- package/dist/runtime/createRun.js +12 -1
- package/dist/runtime/effectGroupRegistry.d.ts +57 -0
- package/dist/runtime/effectGroupRegistry.d.ts.map +1 -0
- package/dist/runtime/effectGroupRegistry.js +107 -0
- package/dist/runtime/exceptions.d.ts +5 -0
- package/dist/runtime/exceptions.d.ts.map +1 -1
- package/dist/runtime/exceptions.js +13 -1
- package/dist/runtime/index.d.ts +2 -2
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +3 -1
- package/dist/runtime/intrinsics/breakpoint.d.ts +5 -0
- package/dist/runtime/intrinsics/breakpoint.d.ts.map +1 -1
- package/dist/runtime/intrinsics/breakpoint.js +50 -8
- package/dist/runtime/intrinsics/parallel.d.ts +5 -1
- package/dist/runtime/intrinsics/parallel.d.ts.map +1 -1
- package/dist/runtime/intrinsics/parallel.js +124 -18
- package/dist/runtime/intrinsics/parallelGroup.d.ts +16 -0
- package/dist/runtime/intrinsics/parallelGroup.d.ts.map +1 -0
- package/dist/runtime/intrinsics/parallelGroup.js +105 -0
- package/dist/runtime/intrinsics/task.d.ts +4 -0
- package/dist/runtime/intrinsics/task.d.ts.map +1 -1
- package/dist/runtime/intrinsics/task.js +73 -1
- package/dist/runtime/orchestrateIteration.d.ts +6 -0
- package/dist/runtime/orchestrateIteration.d.ts.map +1 -1
- package/dist/runtime/orchestrateIteration.js +150 -0
- package/dist/runtime/replay/effectIndex.d.ts +3 -0
- package/dist/runtime/replay/effectIndex.d.ts.map +1 -1
- package/dist/runtime/replay/effectIndex.js +74 -0
- package/dist/runtime/replay/stateCache.js +1 -1
- package/dist/runtime/schemaValidator.d.ts +16 -0
- package/dist/runtime/schemaValidator.d.ts.map +1 -0
- package/dist/runtime/schemaValidator.js +92 -0
- package/dist/runtime/types.d.ts +34 -1
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/session/context.d.ts +22 -0
- package/dist/session/context.d.ts.map +1 -0
- package/dist/session/context.js +108 -0
- package/dist/session/cost.d.ts +63 -0
- package/dist/session/cost.d.ts.map +1 -0
- package/dist/session/cost.js +194 -0
- package/dist/session/history.d.ts +30 -0
- package/dist/session/history.d.ts.map +1 -0
- package/dist/session/history.js +143 -0
- package/dist/session/index.d.ts +8 -2
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +31 -1
- package/dist/session/parse.d.ts.map +1 -1
- package/dist/session/parse.js +7 -0
- package/dist/session/persistence.d.ts +46 -0
- package/dist/session/persistence.d.ts.map +1 -0
- package/dist/session/persistence.js +180 -0
- package/dist/session/types.d.ts +64 -1
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/write.d.ts +20 -0
- package/dist/session/write.d.ts.map +1 -1
- package/dist/session/write.js +44 -0
- package/dist/storage/createRunDir.d.ts.map +1 -1
- package/dist/storage/createRunDir.js +25 -1
- package/dist/storage/icloudWarning.d.ts +6 -0
- package/dist/storage/icloudWarning.d.ts.map +1 -0
- package/dist/storage/icloudWarning.js +84 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +3 -1
- package/dist/storage/journal.d.ts.map +1 -1
- package/dist/storage/journal.js +2 -0
- package/dist/storage/journalWatcher.d.ts +24 -0
- package/dist/storage/journalWatcher.d.ts.map +1 -0
- package/dist/storage/journalWatcher.js +183 -0
- package/dist/storage/types.d.ts +7 -2
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/tasks/batching.d.ts +6 -1
- package/dist/tasks/batching.d.ts.map +1 -1
- package/dist/tasks/batching.js +33 -8
- package/dist/tasks/effectGroup.d.ts +19 -0
- package/dist/tasks/effectGroup.d.ts.map +1 -0
- package/dist/tasks/effectGroup.js +58 -0
- package/dist/tasks/grouping.d.ts +19 -0
- package/dist/tasks/grouping.d.ts.map +1 -0
- package/dist/tasks/grouping.js +54 -0
- package/dist/tasks/index.d.ts +1 -0
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +1 -0
- package/dist/tasks/partitioning.d.ts +11 -0
- package/dist/tasks/partitioning.d.ts.map +1 -0
- package/dist/tasks/partitioning.js +20 -0
- package/dist/tasks/registry.d.ts +1 -1
- package/dist/tasks/registry.d.ts.map +1 -1
- package/dist/tasks/serializer.d.ts +3 -1
- package/dist/tasks/serializer.d.ts.map +1 -1
- package/dist/tasks/serializer.js +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-JSON-003: JSON Breakpoint Interaction API.
|
|
3
|
+
*
|
|
4
|
+
* Typed API wrappers for listing, showing, and responding to breakpoint effects,
|
|
5
|
+
* plus auto-approval rule management. All functions return ApiResult envelopes
|
|
6
|
+
* and never throw.
|
|
7
|
+
*/
|
|
8
|
+
import type { ApiResult } from "./runs";
|
|
9
|
+
import type { BreakpointRule, AutoApprovalResult } from "../breakpoints/types";
|
|
10
|
+
import type { BreakpointConfig } from "../profiles/types";
|
|
11
|
+
export interface ListBreakpointsOutput {
|
|
12
|
+
breakpoints: BreakpointSummary[];
|
|
13
|
+
}
|
|
14
|
+
export interface BreakpointSummary {
|
|
15
|
+
effectId: string;
|
|
16
|
+
breakpointId?: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
tags?: string[];
|
|
19
|
+
expert?: string | string[];
|
|
20
|
+
strategy?: string;
|
|
21
|
+
autoApproval?: unknown;
|
|
22
|
+
requestedAt?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ShowBreakpointOutput {
|
|
25
|
+
effectId: string;
|
|
26
|
+
status: string;
|
|
27
|
+
breakpointId?: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
tags?: string[];
|
|
31
|
+
expert?: string | string[];
|
|
32
|
+
strategy?: string;
|
|
33
|
+
previousFeedback?: string;
|
|
34
|
+
attempt?: number;
|
|
35
|
+
options?: unknown;
|
|
36
|
+
autoApproval?: unknown;
|
|
37
|
+
result?: unknown;
|
|
38
|
+
requestedAt?: string;
|
|
39
|
+
resolvedAt?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface RespondToBreakpointInput {
|
|
42
|
+
runDir: string;
|
|
43
|
+
effectId: string;
|
|
44
|
+
approved: boolean;
|
|
45
|
+
response?: string;
|
|
46
|
+
feedback?: string;
|
|
47
|
+
option?: string;
|
|
48
|
+
respondedBy?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface AddAutoApprovalRuleInput {
|
|
51
|
+
pattern: string;
|
|
52
|
+
action: "auto-approve" | "never-auto-approve";
|
|
53
|
+
createdBy: string;
|
|
54
|
+
id?: string;
|
|
55
|
+
source?: string;
|
|
56
|
+
note?: string;
|
|
57
|
+
rulesPath?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface EvaluateAutoApprovalInput {
|
|
60
|
+
breakpointId: string;
|
|
61
|
+
tags?: string[];
|
|
62
|
+
expert?: string;
|
|
63
|
+
rulesPath?: string;
|
|
64
|
+
autoApproveAfterN?: number;
|
|
65
|
+
consecutiveApprovals?: number;
|
|
66
|
+
profileConfig?: BreakpointConfig;
|
|
67
|
+
}
|
|
68
|
+
export declare function apiListBreakpoints(input: {
|
|
69
|
+
runDir: string;
|
|
70
|
+
}): Promise<ApiResult<ListBreakpointsOutput>>;
|
|
71
|
+
export declare function apiShowBreakpoint(input: {
|
|
72
|
+
runDir: string;
|
|
73
|
+
effectId: string;
|
|
74
|
+
}): Promise<ApiResult<ShowBreakpointOutput>>;
|
|
75
|
+
export declare function apiRespondToBreakpoint(input: RespondToBreakpointInput): Promise<ApiResult<{
|
|
76
|
+
resultRef: string;
|
|
77
|
+
}>>;
|
|
78
|
+
export declare function apiListAutoApprovalRules(input?: {
|
|
79
|
+
rulesPath?: string;
|
|
80
|
+
}): Promise<ApiResult<{
|
|
81
|
+
rules: BreakpointRule[];
|
|
82
|
+
}>>;
|
|
83
|
+
export declare function apiAddAutoApprovalRule(input: AddAutoApprovalRuleInput): Promise<ApiResult<{
|
|
84
|
+
rule: BreakpointRule;
|
|
85
|
+
rules: BreakpointRule[];
|
|
86
|
+
}>>;
|
|
87
|
+
export declare function apiRemoveAutoApprovalRule(input: {
|
|
88
|
+
ruleId: string;
|
|
89
|
+
rulesPath?: string;
|
|
90
|
+
}): Promise<ApiResult<{
|
|
91
|
+
rules: BreakpointRule[];
|
|
92
|
+
}>>;
|
|
93
|
+
export declare function apiEvaluateAutoApproval(input: EvaluateAutoApprovalInput): Promise<ApiResult<AutoApprovalResult>>;
|
|
94
|
+
//# sourceMappingURL=breakpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoints.d.ts","sourceRoot":"","sources":["../../src/api/breakpoints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAA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CAAC,CAAC,CA6BvE;AAED,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,OAAO,CAAC,SAAS,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,CAAC,CAmBjD;AAED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAuBxC"}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GAP-JSON-003: JSON Breakpoint Interaction API.
|
|
4
|
+
*
|
|
5
|
+
* Typed API wrappers for listing, showing, and responding to breakpoint effects,
|
|
6
|
+
* plus auto-approval rule management. All functions return ApiResult envelopes
|
|
7
|
+
* and never throw.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.apiListBreakpoints = apiListBreakpoints;
|
|
44
|
+
exports.apiShowBreakpoint = apiShowBreakpoint;
|
|
45
|
+
exports.apiRespondToBreakpoint = apiRespondToBreakpoint;
|
|
46
|
+
exports.apiListAutoApprovalRules = apiListAutoApprovalRules;
|
|
47
|
+
exports.apiAddAutoApprovalRule = apiAddAutoApprovalRule;
|
|
48
|
+
exports.apiRemoveAutoApprovalRule = apiRemoveAutoApprovalRule;
|
|
49
|
+
exports.apiEvaluateAutoApproval = apiEvaluateAutoApproval;
|
|
50
|
+
const crypto = __importStar(require("node:crypto"));
|
|
51
|
+
const journal_1 = require("../storage/journal");
|
|
52
|
+
const tasks_1 = require("../storage/tasks");
|
|
53
|
+
const lock_1 = require("../storage/lock");
|
|
54
|
+
const serializer_1 = require("../tasks/serializer");
|
|
55
|
+
const rules_1 = require("../breakpoints/rules");
|
|
56
|
+
const evaluator_1 = require("../breakpoints/evaluator");
|
|
57
|
+
const dispatcher_1 = require("../hooks/dispatcher");
|
|
58
|
+
const utils_1 = require("./utils");
|
|
59
|
+
// ── Internal helpers ───────────────────────────────────────────────────────
|
|
60
|
+
function isBreakpointEffect(info) {
|
|
61
|
+
return info.kind === "breakpoint" || info.taskId === "__sdk.breakpoint";
|
|
62
|
+
}
|
|
63
|
+
// ── API functions ──────────────────────────────────────────────────────────
|
|
64
|
+
async function apiListBreakpoints(input) {
|
|
65
|
+
try {
|
|
66
|
+
if (!input.runDir) {
|
|
67
|
+
return (0, utils_1.fail)("INVALID_INPUT", "runDir must be a non-empty string");
|
|
68
|
+
}
|
|
69
|
+
if (!(await (0, utils_1.pathExists)(input.runDir))) {
|
|
70
|
+
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
71
|
+
}
|
|
72
|
+
const events = await (0, journal_1.loadJournal)(input.runDir);
|
|
73
|
+
const effectMap = (0, utils_1.buildBaseEffectMap)(events);
|
|
74
|
+
const breakpoints = [];
|
|
75
|
+
for (const info of effectMap.values()) {
|
|
76
|
+
if (!isBreakpointEffect(info))
|
|
77
|
+
continue;
|
|
78
|
+
if (info.lifecycle !== "requested")
|
|
79
|
+
continue;
|
|
80
|
+
// Read task definition to extract breakpoint-specific fields
|
|
81
|
+
let taskDef;
|
|
82
|
+
try {
|
|
83
|
+
taskDef = await (0, tasks_1.readTaskDefinition)(input.runDir, info.effectId);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// task.json may not exist
|
|
87
|
+
}
|
|
88
|
+
const td = taskDef;
|
|
89
|
+
breakpoints.push({
|
|
90
|
+
effectId: info.effectId,
|
|
91
|
+
breakpointId: td?.breakpointId,
|
|
92
|
+
title: td?.title,
|
|
93
|
+
tags: Array.isArray(td?.tags) ? td.tags : undefined,
|
|
94
|
+
expert: td?.expert,
|
|
95
|
+
strategy: td?.strategy,
|
|
96
|
+
autoApproval: td?.autoApproval,
|
|
97
|
+
requestedAt: info.requestedAt,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return (0, utils_1.ok)({ breakpoints });
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
104
|
+
return (0, utils_1.fail)("INTERNAL_ERROR", msg);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function apiShowBreakpoint(input) {
|
|
108
|
+
try {
|
|
109
|
+
if (!input.runDir) {
|
|
110
|
+
return (0, utils_1.fail)("INVALID_INPUT", "runDir must be a non-empty string");
|
|
111
|
+
}
|
|
112
|
+
if (!input.effectId) {
|
|
113
|
+
return (0, utils_1.fail)("INVALID_INPUT", "effectId must be a non-empty string");
|
|
114
|
+
}
|
|
115
|
+
if (!(await (0, utils_1.pathExists)(input.runDir))) {
|
|
116
|
+
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
117
|
+
}
|
|
118
|
+
const events = await (0, journal_1.loadJournal)(input.runDir);
|
|
119
|
+
const effectMap = (0, utils_1.buildBaseEffectMap)(events);
|
|
120
|
+
const info = effectMap.get(input.effectId);
|
|
121
|
+
if (!info) {
|
|
122
|
+
return (0, utils_1.fail)("EFFECT_NOT_FOUND", `Effect not found: ${input.effectId}`);
|
|
123
|
+
}
|
|
124
|
+
if (!isBreakpointEffect(info)) {
|
|
125
|
+
return (0, utils_1.fail)("EFFECT_NOT_BREAKPOINT", `Effect ${input.effectId} is not a breakpoint (kind=${info.kind})`);
|
|
126
|
+
}
|
|
127
|
+
// Read task definition
|
|
128
|
+
let taskDef;
|
|
129
|
+
try {
|
|
130
|
+
taskDef = await (0, tasks_1.readTaskDefinition)(input.runDir, input.effectId);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
// task.json may not exist
|
|
134
|
+
}
|
|
135
|
+
// Read result if resolved
|
|
136
|
+
let resultData = undefined;
|
|
137
|
+
if (info.lifecycle === "resolved") {
|
|
138
|
+
try {
|
|
139
|
+
const storedResult = await (0, tasks_1.readTaskResult)(input.runDir, input.effectId);
|
|
140
|
+
resultData = storedResult ?? undefined;
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// result.json may be missing/corrupt
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const td = taskDef;
|
|
147
|
+
const output = {
|
|
148
|
+
effectId: info.effectId,
|
|
149
|
+
status: info.lifecycle,
|
|
150
|
+
breakpointId: td?.breakpointId,
|
|
151
|
+
title: td?.title,
|
|
152
|
+
description: td?.description,
|
|
153
|
+
tags: Array.isArray(td?.tags) ? td.tags : undefined,
|
|
154
|
+
expert: td?.expert,
|
|
155
|
+
strategy: td?.strategy,
|
|
156
|
+
previousFeedback: td?.previousFeedback,
|
|
157
|
+
attempt: typeof td?.attempt === "number" ? td.attempt : undefined,
|
|
158
|
+
options: td?.options,
|
|
159
|
+
autoApproval: td?.autoApproval,
|
|
160
|
+
result: resultData,
|
|
161
|
+
requestedAt: info.requestedAt,
|
|
162
|
+
resolvedAt: info.resolvedAt,
|
|
163
|
+
};
|
|
164
|
+
return (0, utils_1.ok)(output);
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
168
|
+
return (0, utils_1.fail)("INTERNAL_ERROR", msg);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
async function apiRespondToBreakpoint(input) {
|
|
172
|
+
try {
|
|
173
|
+
// Validate input
|
|
174
|
+
if (!input.runDir) {
|
|
175
|
+
return (0, utils_1.fail)("INVALID_INPUT", "runDir must be a non-empty string");
|
|
176
|
+
}
|
|
177
|
+
if (!input.effectId) {
|
|
178
|
+
return (0, utils_1.fail)("INVALID_INPUT", "effectId must be a non-empty string");
|
|
179
|
+
}
|
|
180
|
+
if (input.approved === false && (!input.feedback || input.feedback.trim() === "")) {
|
|
181
|
+
return (0, utils_1.fail)("INVALID_INPUT", "feedback is required when rejecting a breakpoint (approved=false)");
|
|
182
|
+
}
|
|
183
|
+
if (!(await (0, utils_1.pathExists)(input.runDir))) {
|
|
184
|
+
return (0, utils_1.fail)("RUN_NOT_FOUND", `Run directory not found: ${input.runDir}`);
|
|
185
|
+
}
|
|
186
|
+
return await (0, lock_1.withRunLock)(input.runDir, "api:respondToBreakpoint", async () => {
|
|
187
|
+
const events = await (0, journal_1.loadJournal)(input.runDir);
|
|
188
|
+
const effectMap = (0, utils_1.buildBaseEffectMap)(events);
|
|
189
|
+
const info = effectMap.get(input.effectId);
|
|
190
|
+
if (!info) {
|
|
191
|
+
return (0, utils_1.fail)("EFFECT_NOT_FOUND", `Effect not found: ${input.effectId}`);
|
|
192
|
+
}
|
|
193
|
+
if (!isBreakpointEffect(info)) {
|
|
194
|
+
return (0, utils_1.fail)("EFFECT_NOT_BREAKPOINT", `Effect ${input.effectId} is not a breakpoint (kind=${info.kind})`);
|
|
195
|
+
}
|
|
196
|
+
if (info.lifecycle !== "requested") {
|
|
197
|
+
return (0, utils_1.fail)("EFFECT_NOT_PENDING", `Breakpoint ${input.effectId} is not pending (status=${info.lifecycle})`);
|
|
198
|
+
}
|
|
199
|
+
const taskId = info.taskId ?? `task-${input.effectId}`;
|
|
200
|
+
const invocationKey = info.invocationKey ?? `key-${input.effectId}`;
|
|
201
|
+
// Build breakpoint result value
|
|
202
|
+
const breakpointResult = {
|
|
203
|
+
approved: input.approved,
|
|
204
|
+
};
|
|
205
|
+
if (input.response !== undefined)
|
|
206
|
+
breakpointResult.response = input.response;
|
|
207
|
+
if (input.feedback !== undefined)
|
|
208
|
+
breakpointResult.feedback = input.feedback;
|
|
209
|
+
if (input.option !== undefined)
|
|
210
|
+
breakpointResult.option = input.option;
|
|
211
|
+
if (input.respondedBy !== undefined)
|
|
212
|
+
breakpointResult.respondedBy = input.respondedBy;
|
|
213
|
+
const { resultRef } = await (0, serializer_1.serializeAndWriteTaskResult)({
|
|
214
|
+
runDir: input.runDir,
|
|
215
|
+
effectId: input.effectId,
|
|
216
|
+
taskId,
|
|
217
|
+
invocationKey,
|
|
218
|
+
payload: {
|
|
219
|
+
status: "ok",
|
|
220
|
+
result: breakpointResult,
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
await (0, journal_1.appendEvent)({
|
|
224
|
+
runDir: input.runDir,
|
|
225
|
+
eventType: "EFFECT_RESOLVED",
|
|
226
|
+
event: {
|
|
227
|
+
effectId: input.effectId,
|
|
228
|
+
status: "ok",
|
|
229
|
+
resultRef,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
// GAP-SEC-003: Fire on-permission-denied hook when breakpoint is denied
|
|
233
|
+
if (!input.approved) {
|
|
234
|
+
const td = await (0, tasks_1.readTaskDefinition)(input.runDir, input.effectId).catch(() => undefined);
|
|
235
|
+
const bpId = td?.breakpointId;
|
|
236
|
+
const kind = td?.kind;
|
|
237
|
+
(0, dispatcher_1.callHook)({
|
|
238
|
+
hookType: "on-permission-denied",
|
|
239
|
+
payload: {
|
|
240
|
+
hookType: "on-permission-denied",
|
|
241
|
+
breakpointId: bpId ?? input.effectId,
|
|
242
|
+
title: td?.title,
|
|
243
|
+
kind: kind ?? "breakpoint",
|
|
244
|
+
runId: input.runDir.split("/").pop(),
|
|
245
|
+
effectId: input.effectId,
|
|
246
|
+
respondedBy: input.respondedBy,
|
|
247
|
+
feedback: input.feedback,
|
|
248
|
+
timestamp: new Date().toISOString(),
|
|
249
|
+
},
|
|
250
|
+
cwd: input.runDir,
|
|
251
|
+
}).catch(() => { });
|
|
252
|
+
}
|
|
253
|
+
return (0, utils_1.ok)({ resultRef });
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
258
|
+
return (0, utils_1.fail)("INTERNAL_ERROR", msg);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
async function apiListAutoApprovalRules(input) {
|
|
262
|
+
try {
|
|
263
|
+
const rules = await (0, rules_1.readRules)(input?.rulesPath);
|
|
264
|
+
return (0, utils_1.ok)({ rules });
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
268
|
+
return (0, utils_1.fail)("INTERNAL_ERROR", msg);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
async function apiAddAutoApprovalRule(input) {
|
|
272
|
+
try {
|
|
273
|
+
if (!input.pattern) {
|
|
274
|
+
return (0, utils_1.fail)("INVALID_INPUT", "pattern must be a non-empty string");
|
|
275
|
+
}
|
|
276
|
+
const validActions = ["auto-approve", "never-auto-approve"];
|
|
277
|
+
if (!validActions.includes(input.action)) {
|
|
278
|
+
return (0, utils_1.fail)("INVALID_INPUT", `action must be one of: ${validActions.join(", ")}`);
|
|
279
|
+
}
|
|
280
|
+
if (!input.createdBy) {
|
|
281
|
+
return (0, utils_1.fail)("INVALID_INPUT", "createdBy must be a non-empty string");
|
|
282
|
+
}
|
|
283
|
+
const rule = {
|
|
284
|
+
id: input.id ?? crypto.randomUUID(),
|
|
285
|
+
pattern: input.pattern,
|
|
286
|
+
action: input.action,
|
|
287
|
+
createdAt: new Date().toISOString(),
|
|
288
|
+
createdBy: input.createdBy,
|
|
289
|
+
source: input.source,
|
|
290
|
+
note: input.note,
|
|
291
|
+
};
|
|
292
|
+
const rules = await (0, rules_1.addRule)(rule, input.rulesPath);
|
|
293
|
+
return (0, utils_1.ok)({ rule, rules });
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
297
|
+
return (0, utils_1.fail)("INTERNAL_ERROR", msg);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
async function apiRemoveAutoApprovalRule(input) {
|
|
301
|
+
try {
|
|
302
|
+
if (!input.ruleId) {
|
|
303
|
+
return (0, utils_1.fail)("INVALID_INPUT", "ruleId must be a non-empty string");
|
|
304
|
+
}
|
|
305
|
+
// Check if rule exists before removing
|
|
306
|
+
const existingRules = await (0, rules_1.readRules)(input.rulesPath);
|
|
307
|
+
const ruleExists = existingRules.some((r) => r.id === input.ruleId);
|
|
308
|
+
if (!ruleExists) {
|
|
309
|
+
return (0, utils_1.fail)("RULE_NOT_FOUND", `Rule not found: ${input.ruleId}`);
|
|
310
|
+
}
|
|
311
|
+
const rules = await (0, rules_1.removeRule)(input.ruleId, input.rulesPath);
|
|
312
|
+
return (0, utils_1.ok)({ rules });
|
|
313
|
+
}
|
|
314
|
+
catch (error) {
|
|
315
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
316
|
+
return (0, utils_1.fail)("INTERNAL_ERROR", msg);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
async function apiEvaluateAutoApproval(input) {
|
|
320
|
+
try {
|
|
321
|
+
if (!input.breakpointId) {
|
|
322
|
+
return (0, utils_1.fail)("INVALID_INPUT", "breakpointId must be a non-empty string");
|
|
323
|
+
}
|
|
324
|
+
const rules = await (0, rules_1.readRules)(input.rulesPath);
|
|
325
|
+
const result = (0, evaluator_1.evaluateAutoApproval)({
|
|
326
|
+
breakpointId: input.breakpointId,
|
|
327
|
+
tags: input.tags,
|
|
328
|
+
expert: input.expert,
|
|
329
|
+
rules,
|
|
330
|
+
profileConfig: input.profileConfig,
|
|
331
|
+
consecutiveApprovals: input.consecutiveApprovals,
|
|
332
|
+
autoApproveAfterN: input.autoApproveAfterN,
|
|
333
|
+
});
|
|
334
|
+
return (0, utils_1.ok)(result);
|
|
335
|
+
}
|
|
336
|
+
catch (error) {
|
|
337
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
338
|
+
return (0, utils_1.fail)("INTERNAL_ERROR", msg);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GAP-JSON-002: Effect Dispatch and Response Protocol.
|
|
3
|
+
*
|
|
4
|
+
* Typed API wrappers for listing, showing, cancelling, and batch-committing
|
|
5
|
+
* effects. All functions return ApiResult envelopes and never throw.
|
|
6
|
+
*/
|
|
7
|
+
import type { ApiResult } from "./runs";
|
|
8
|
+
import type { JsonRecord } from "../storage/types";
|
|
9
|
+
type EffectStatusFilter = "requested" | "resolved" | "cancelled";
|
|
10
|
+
type EffectStatusOutput = "requested" | "resolved_ok" | "resolved_error" | "cancelled";
|
|
11
|
+
export interface ListEffectsInput {
|
|
12
|
+
runDir: string;
|
|
13
|
+
filter?: {
|
|
14
|
+
kind?: string | string[];
|
|
15
|
+
status?: EffectStatusFilter;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface EffectSummary {
|
|
19
|
+
effectId: string;
|
|
20
|
+
kind?: string;
|
|
21
|
+
status: EffectStatusOutput;
|
|
22
|
+
taskId?: string;
|
|
23
|
+
labels?: string[];
|
|
24
|
+
requestedAt?: string;
|
|
25
|
+
resolvedAt?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ListEffectsOutput {
|
|
28
|
+
effects: EffectSummary[];
|
|
29
|
+
}
|
|
30
|
+
export interface ShowEffectInput {
|
|
31
|
+
runDir: string;
|
|
32
|
+
effectId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ShowEffectOutput {
|
|
35
|
+
effectId: string;
|
|
36
|
+
kind?: string;
|
|
37
|
+
status: EffectStatusOutput;
|
|
38
|
+
taskId?: string;
|
|
39
|
+
labels?: string[];
|
|
40
|
+
requestedAt?: string;
|
|
41
|
+
resolvedAt?: string;
|
|
42
|
+
taskDefinition?: JsonRecord;
|
|
43
|
+
result?: unknown;
|
|
44
|
+
autoApproval?: unknown;
|
|
45
|
+
}
|
|
46
|
+
export interface CancelEffectInput {
|
|
47
|
+
runDir: string;
|
|
48
|
+
effectId: string;
|
|
49
|
+
reason?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface CancelEffectOutput {
|
|
52
|
+
resultRef: string;
|
|
53
|
+
}
|
|
54
|
+
export interface BatchCommitEffectEntry {
|
|
55
|
+
effectId: string;
|
|
56
|
+
result: {
|
|
57
|
+
status: "ok" | "error";
|
|
58
|
+
value?: unknown;
|
|
59
|
+
error?: string;
|
|
60
|
+
stdout?: string;
|
|
61
|
+
stderr?: string;
|
|
62
|
+
stdoutRef?: string;
|
|
63
|
+
stderrRef?: string;
|
|
64
|
+
startedAt?: string;
|
|
65
|
+
finishedAt?: string;
|
|
66
|
+
metadata?: JsonRecord;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface BatchCommitEffectsInput {
|
|
70
|
+
runDir: string;
|
|
71
|
+
effects: BatchCommitEffectEntry[];
|
|
72
|
+
}
|
|
73
|
+
export interface BatchCommitEffectResult {
|
|
74
|
+
effectId: string;
|
|
75
|
+
ok: boolean;
|
|
76
|
+
resultRef?: string;
|
|
77
|
+
error?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface BatchCommitEffectsOutput {
|
|
80
|
+
results: BatchCommitEffectResult[];
|
|
81
|
+
}
|
|
82
|
+
export declare function apiListEffects(input: ListEffectsInput): Promise<ApiResult<ListEffectsOutput>>;
|
|
83
|
+
export declare function apiShowEffect(input: ShowEffectInput): Promise<ApiResult<ShowEffectOutput>>;
|
|
84
|
+
export declare function apiCancelEffect(input: CancelEffectInput): Promise<ApiResult<CancelEffectOutput>>;
|
|
85
|
+
export declare function apiBatchCommitEffects(input: BatchCommitEffectsInput): Promise<ApiResult<BatchCommitEffectsOutput>>;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=effects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effects.d.ts","sourceRoot":"","sources":["../../src/api/effects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKjE,KAAK,kBAAkB,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AACjE,KAAK,kBAAkB,GAAG,WAAW,GAAG,aAAa,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAEvF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;Q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