@bolt-foundry/gambit 0.8.6-rc.2 → 0.8.6-rc.3
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/CHANGELOG.md +43 -1
- package/README.md +1 -1
- package/esm/gambit/simulator-ui/dist/bundle.js +2537 -1204
- package/esm/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/entrypoint.d.ts +7 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/entrypoint.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/entrypoint.js +22 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/normalization_ast.d.ts +4 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/normalization_ast.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/normalization_ast.js +275 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/output_type.d.ts +3 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/output_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/output_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/param_type.d.ts +72 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/param_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/param_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/parameters_type.d.ts +6 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/parameters_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/parameters_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/query_text.d.ts +3 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/query_text.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/query_text.js +59 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/raw_response_type.d.ts +55 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/raw_response_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/raw_response_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/resolver_reader.d.ts +6 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/resolver_reader.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/resolver_reader.js +360 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/param_type.d.ts +63 -63
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/raw_response_type.d.ts +63 -63
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/param_type.d.ts +63 -63
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/raw_response_type.d.ts +63 -63
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/param_type.d.ts +61 -61
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/raw_response_type.d.ts +65 -65
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/param_type.d.ts +21 -21
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/raw_response_type.d.ts +31 -31
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/param_type.d.ts +61 -61
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/raw_response_type.d.ts +65 -65
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/param_type.d.ts +12 -12
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/raw_response_type.d.ts +12 -12
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/entrypoint.d.ts +7 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/entrypoint.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/entrypoint.js +22 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/normalization_ast.d.ts +4 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/normalization_ast.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/normalization_ast.js +29 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/output_type.d.ts +3 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/output_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/output_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/param_type.d.ts +11 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/param_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/param_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/parameters_type.d.ts +4 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/parameters_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/parameters_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/query_text.d.ts +3 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/query_text.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/query_text.js +6 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/raw_response_type.d.ts +7 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/raw_response_type.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/raw_response_type.js +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/resolver_reader.d.ts +6 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/resolver_reader.d.ts.map +1 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/resolver_reader.js +41 -0
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/param_type.d.ts +17 -17
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/raw_response_type.d.ts +17 -17
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/param_type.d.ts +17 -17
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/raw_response_type.d.ts +17 -17
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/param_type.d.ts +45 -45
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/raw_response_type.d.ts +45 -45
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/param_type.d.ts +58 -58
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/raw_response_type.d.ts +58 -58
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/param_type.d.ts +35 -35
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/raw_response_type.d.ts +35 -35
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/param_type.d.ts +58 -58
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/raw_response_type.d.ts +58 -58
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/param_type.d.ts +131 -131
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/raw_response_type.d.ts +131 -131
- package/esm/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/param_type.d.ts +3 -3
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/raw_response_type.d.ts +3 -3
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/param_type.d.ts +2 -2
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/raw_response_type.d.ts +11 -11
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/param_type.d.ts +2 -2
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts +37 -37
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/param_type.d.ts +2 -2
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts +33 -33
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/param_type.d.ts +2 -2
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts +76 -76
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/param_type.d.ts +3 -3
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts +53 -53
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaces/raw_response_type.d.ts +7 -7
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaces/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/param_type.d.ts +78 -78
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/raw_response_type.d.ts +78 -78
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/param_type.d.ts +11 -11
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/raw_response_type.d.ts +11 -11
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/param_type.d.ts +37 -37
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/raw_response_type.d.ts +37 -37
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/param_type.d.ts +76 -76
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/raw_response_type.d.ts +76 -76
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/param_type.d.ts +21 -21
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/raw_response_type.d.ts +46 -46
- package/esm/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/raw_response_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/SimulatorAppDrawer/param_type.d.ts +7 -7
- package/esm/simulator-ui/__generated__/__isograph/Query/SimulatorAppDrawer/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/SimulatorBuildContentShell/param_type.d.ts +2 -2
- package/esm/simulator-ui/__generated__/__isograph/Query/SimulatorBuildContentShell/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Query/SimulatorWorkspacesPage/param_type.d.ts +7 -7
- package/esm/simulator-ui/__generated__/__isograph/Query/SimulatorWorkspacesPage/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/BuildTab/param_type.d.ts +8 -8
- package/esm/simulator-ui/__generated__/__isograph/Workspace/BuildTab/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts +35 -35
- package/esm/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts +31 -31
- package/esm/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts +74 -74
- package/esm/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts +19 -19
- package/esm/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/WorkspaceConversationRun/WorkbenchConversationRunChat/param_type.d.ts +26 -26
- package/esm/simulator-ui/__generated__/__isograph/WorkspaceConversationRun/WorkbenchConversationRunChat/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/WorkspaceFile/PreviewFile/param_type.d.ts +2 -2
- package/esm/simulator-ui/__generated__/__isograph/WorkspaceFile/PreviewFile/param_type.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/iso.d.ts +8 -0
- package/esm/simulator-ui/__generated__/__isograph/iso.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/__isograph/iso.js +6 -0
- package/esm/simulator-ui/__generated__/builtRoutes.d.ts +4 -0
- package/esm/simulator-ui/__generated__/builtRoutes.d.ts.map +1 -1
- package/esm/simulator-ui/__generated__/builtRoutes.js +6 -0
- package/esm/simulator-ui/isograph/components/Query/SimulatorAppDrawer.d.ts +6 -0
- package/esm/simulator-ui/isograph/components/Query/SimulatorAppDrawer.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/Query/SimulatorAppDrawer.js +61 -14
- package/esm/simulator-ui/isograph/components/Query/SimulatorTestPage.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/Query/SimulatorTestPage.js +10 -8
- package/esm/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.js +148 -3
- package/esm/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts +5 -0
- package/esm/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.js +1 -1
- package/esm/simulator-ui/isograph/components/grade/GradeTabView.d.ts.map +1 -1
- package/esm/simulator-ui/isograph/components/grade/GradeTabView.js +3 -1
- package/esm/simulator-ui/mutations/GambitSimulatorResetWorkspace.d.ts +55 -0
- package/esm/simulator-ui/mutations/GambitSimulatorResetWorkspace.d.ts.map +1 -0
- package/esm/simulator-ui/mutations/GambitSimulatorResetWorkspace.js +63 -0
- package/esm/simulator-ui/mutations/GambitSimulatorResetWorkspaceMutation.d.ts +55 -0
- package/esm/simulator-ui/mutations/GambitSimulatorResetWorkspaceMutation.d.ts.map +1 -0
- package/esm/simulator-ui/mutations/GambitSimulatorResetWorkspaceMutation.js +7 -0
- package/esm/simulator-ui/mutations/GambitSimulatorStopRun.d.ts +62 -62
- package/esm/simulator-ui/mutations/GambitSimulatorStopRun.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitSimulatorStopRunMutation.d.ts +62 -62
- package/esm/simulator-ui/mutations/GambitSimulatorStopRunMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceBuildRunCreate.d.ts +62 -62
- package/esm/simulator-ui/mutations/GambitWorkspaceBuildRunCreate.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceBuildRunCreateMutation.d.ts +62 -62
- package/esm/simulator-ui/mutations/GambitWorkspaceBuildRunCreateMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceConversationSessionSend.d.ts +60 -60
- package/esm/simulator-ui/mutations/GambitWorkspaceConversationSessionSend.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceConversationSessionStart.d.ts +20 -20
- package/esm/simulator-ui/mutations/GambitWorkspaceConversationSessionStart.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceConversationSessionStop.d.ts +60 -60
- package/esm/simulator-ui/mutations/GambitWorkspaceConversationSessionStop.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceCreate.d.ts +11 -11
- package/esm/simulator-ui/mutations/GambitWorkspaceCreate.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceCreateMutation.d.ts +11 -11
- package/esm/simulator-ui/mutations/GambitWorkspaceCreateMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceDelete.d.ts +6 -0
- package/esm/simulator-ui/mutations/GambitWorkspaceDelete.d.ts.map +1 -0
- package/esm/simulator-ui/mutations/GambitWorkspaceDelete.js +12 -0
- package/esm/simulator-ui/mutations/GambitWorkspaceDeleteMutation.d.ts +6 -0
- package/esm/simulator-ui/mutations/GambitWorkspaceDeleteMutation.d.ts.map +1 -0
- package/esm/simulator-ui/mutations/GambitWorkspaceDeleteMutation.js +7 -0
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdate.d.ts +16 -16
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdate.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdateMutation.d.ts +16 -16
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdateMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagToggle.d.ts +16 -16
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagToggle.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagToggleMutation.d.ts +16 -16
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeFlagToggleMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeRunCreate.d.ts +44 -44
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeRunCreate.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeRunCreateMutation.d.ts +44 -44
- package/esm/simulator-ui/mutations/GambitWorkspaceGradeRunCreateMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunSend.d.ts +57 -57
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunSend.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunSendMutation.d.ts +57 -57
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunSendMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStart.d.ts +34 -34
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStart.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStartMutation.d.ts +34 -34
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStartMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStop.d.ts +57 -57
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStop.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStopMutation.d.ts +57 -57
- package/esm/simulator-ui/mutations/GambitWorkspaceScenarioRunStopMutation.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreate.d.ts +130 -130
- package/esm/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreate.d.ts.map +1 -1
- package/esm/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreateMutation.d.ts +130 -130
- package/esm/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreateMutation.d.ts.map +1 -1
- package/esm/simulator-ui/src/AppRoot.d.ts.map +1 -1
- package/esm/simulator-ui/src/AppRoot.js +10 -2
- package/esm/simulator-ui/src/AppShell.d.ts +6 -0
- package/esm/simulator-ui/src/AppShell.d.ts.map +1 -1
- package/esm/simulator-ui/src/AppShell.js +99 -29
- package/esm/simulator-ui/src/DocsPage.d.ts +2 -0
- package/esm/simulator-ui/src/DocsPage.d.ts.map +1 -0
- package/esm/simulator-ui/src/DocsPage.js +80 -0
- package/esm/simulator-ui/src/WorkbenchDrawerIso.d.ts +4 -0
- package/esm/simulator-ui/src/WorkbenchDrawerIso.d.ts.map +1 -1
- package/esm/simulator-ui/src/WorkbenchDrawerIso.js +20 -3
- package/esm/simulator-ui/src/WorkspaceContext.d.ts.map +1 -1
- package/esm/simulator-ui/src/WorkspaceContext.js +42 -10
- package/esm/simulator-ui/src/grade/GradeResultsPanel.d.ts.map +1 -1
- package/esm/simulator-ui/src/grade/GradeResultsPanel.js +3 -1
- package/esm/simulator-ui/src/routing.d.ts.map +1 -1
- package/esm/simulator-ui/src/routing.js +2 -0
- package/esm/simulator-ui/src/test_tab_start_gate.d.ts +8 -0
- package/esm/simulator-ui/src/test_tab_start_gate.d.ts.map +1 -0
- package/esm/simulator-ui/src/test_tab_start_gate.js +8 -0
- package/esm/src/providers/claude_code.d.ts.map +1 -1
- package/esm/src/providers/claude_code.js +65 -6
- package/esm/src/providers/codex.d.ts.map +1 -1
- package/esm/src/providers/codex.js +64 -1
- package/esm/src/server.d.ts.map +1 -1
- package/esm/src/server.js +272 -127
- package/esm/src/server_build_chat_provider.d.ts +26 -0
- package/esm/src/server_build_chat_provider.d.ts.map +1 -0
- package/esm/src/server_build_chat_provider.js +127 -0
- package/esm/src/server_isograph_environment.d.ts +17 -0
- package/esm/src/server_isograph_environment.d.ts.map +1 -1
- package/esm/src/server_isograph_environment.js +6 -0
- package/esm/src/server_session_store.d.ts +41 -1
- package/esm/src/server_session_store.d.ts.map +1 -1
- package/esm/src/server_session_store.js +1010 -0
- package/esm/src/simulator_graphql.d.ts +40 -0
- package/esm/src/simulator_graphql.d.ts.map +1 -1
- package/esm/src/simulator_graphql.js +141 -58
- package/package.json +1 -1
- package/script/gambit/simulator-ui/dist/bundle.js +2537 -1204
- package/script/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/entrypoint.d.ts +7 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/entrypoint.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/entrypoint.js +27 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/normalization_ast.d.ts +4 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/normalization_ast.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/normalization_ast.js +277 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/output_type.d.ts +3 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/output_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/output_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/param_type.d.ts +72 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/param_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/param_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/parameters_type.d.ts +6 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/parameters_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/parameters_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/query_text.d.ts +3 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/query_text.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/query_text.js +61 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/raw_response_type.d.ts +55 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/raw_response_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/raw_response_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/resolver_reader.d.ts +6 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/resolver_reader.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorResetWorkspace/resolver_reader.js +365 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/param_type.d.ts +63 -63
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/raw_response_type.d.ts +63 -63
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitSimulatorStopRun/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/param_type.d.ts +63 -63
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/raw_response_type.d.ts +63 -63
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceBuildRunCreate/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/param_type.d.ts +61 -61
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/raw_response_type.d.ts +65 -65
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionSend/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/param_type.d.ts +21 -21
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/raw_response_type.d.ts +31 -31
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStart/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/param_type.d.ts +61 -61
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/raw_response_type.d.ts +65 -65
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceConversationSessionStop/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/param_type.d.ts +12 -12
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/raw_response_type.d.ts +12 -12
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceCreate/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/entrypoint.d.ts +7 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/entrypoint.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/entrypoint.js +27 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/normalization_ast.d.ts +4 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/normalization_ast.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/normalization_ast.js +31 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/output_type.d.ts +3 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/output_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/output_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/param_type.d.ts +11 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/param_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/param_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/parameters_type.d.ts +4 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/parameters_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/parameters_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/query_text.d.ts +3 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/query_text.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/query_text.js +8 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/raw_response_type.d.ts +7 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/raw_response_type.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/raw_response_type.js +2 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/resolver_reader.d.ts +6 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/resolver_reader.d.ts.map +1 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceDelete/resolver_reader.js +43 -0
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/param_type.d.ts +17 -17
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/raw_response_type.d.ts +17 -17
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagReasonUpdate/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/param_type.d.ts +17 -17
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/raw_response_type.d.ts +17 -17
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeFlagToggle/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/param_type.d.ts +45 -45
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/raw_response_type.d.ts +45 -45
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceGradeRunCreate/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/param_type.d.ts +58 -58
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/raw_response_type.d.ts +58 -58
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunSend/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/param_type.d.ts +35 -35
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/raw_response_type.d.ts +35 -35
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStart/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/param_type.d.ts +58 -58
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/raw_response_type.d.ts +58 -58
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceScenarioRunStop/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/param_type.d.ts +131 -131
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/raw_response_type.d.ts +131 -131
- package/script/simulator-ui/__generated__/__isograph/Mutation/GambitWorkspaceVerifyBatchRunCreate/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/param_type.d.ts +3 -3
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/raw_response_type.d.ts +3 -3
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointChatOptimisticPlaceholder/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/param_type.d.ts +2 -2
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/raw_response_type.d.ts +11 -11
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorBuildPage/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/param_type.d.ts +2 -2
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts +37 -37
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorGradePage/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/param_type.d.ts +2 -2
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts +33 -33
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorTestPage/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/param_type.d.ts +2 -2
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts +76 -76
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorVerifyPage/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/param_type.d.ts +3 -3
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts +53 -53
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaceShell/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaces/raw_response_type.d.ts +7 -7
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointSimulatorWorkspaces/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/param_type.d.ts +78 -78
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/raw_response_type.d.ts +78 -78
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildLiveWrite/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/param_type.d.ts +11 -11
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/raw_response_type.d.ts +11 -11
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceBuildTabLiveWrite/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/param_type.d.ts +37 -37
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/raw_response_type.d.ts +37 -37
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceGradeLiveWrite/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/param_type.d.ts +76 -76
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/raw_response_type.d.ts +76 -76
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceVerifyLiveWrite/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/param_type.d.ts +21 -21
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/raw_response_type.d.ts +46 -46
- package/script/simulator-ui/__generated__/__isograph/Query/EntrypointWorkspaceWorkbenchLiveWrite/raw_response_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/SimulatorAppDrawer/param_type.d.ts +7 -7
- package/script/simulator-ui/__generated__/__isograph/Query/SimulatorAppDrawer/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/SimulatorBuildContentShell/param_type.d.ts +2 -2
- package/script/simulator-ui/__generated__/__isograph/Query/SimulatorBuildContentShell/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Query/SimulatorWorkspacesPage/param_type.d.ts +7 -7
- package/script/simulator-ui/__generated__/__isograph/Query/SimulatorWorkspacesPage/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/BuildTab/param_type.d.ts +8 -8
- package/script/simulator-ui/__generated__/__isograph/Workspace/BuildTab/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts +35 -35
- package/script/simulator-ui/__generated__/__isograph/Workspace/GradeTab/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts +31 -31
- package/script/simulator-ui/__generated__/__isograph/Workspace/TestTab/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts +74 -74
- package/script/simulator-ui/__generated__/__isograph/Workspace/VerifyTab/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts +19 -19
- package/script/simulator-ui/__generated__/__isograph/Workspace/WorkbenchChatDrawer/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/WorkspaceConversationRun/WorkbenchConversationRunChat/param_type.d.ts +26 -26
- package/script/simulator-ui/__generated__/__isograph/WorkspaceConversationRun/WorkbenchConversationRunChat/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/WorkspaceFile/PreviewFile/param_type.d.ts +2 -2
- package/script/simulator-ui/__generated__/__isograph/WorkspaceFile/PreviewFile/param_type.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/iso.d.ts +8 -0
- package/script/simulator-ui/__generated__/__isograph/iso.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/__isograph/iso.js +60 -54
- package/script/simulator-ui/__generated__/builtRoutes.d.ts +4 -0
- package/script/simulator-ui/__generated__/builtRoutes.d.ts.map +1 -1
- package/script/simulator-ui/__generated__/builtRoutes.js +33 -27
- package/script/simulator-ui/isograph/components/Query/SimulatorAppDrawer.d.ts +6 -0
- package/script/simulator-ui/isograph/components/Query/SimulatorAppDrawer.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/Query/SimulatorAppDrawer.js +60 -13
- package/script/simulator-ui/isograph/components/Query/SimulatorTestPage.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/Query/SimulatorTestPage.js +10 -8
- package/script/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/Workspace/WorkbenchChatDrawer.js +180 -2
- package/script/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts +5 -0
- package/script/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/WorkspaceConversationRun/WorkbenchConversationRunChat.js +1 -1
- package/script/simulator-ui/isograph/components/grade/GradeTabView.d.ts.map +1 -1
- package/script/simulator-ui/isograph/components/grade/GradeTabView.js +3 -1
- package/script/simulator-ui/mutations/GambitSimulatorResetWorkspace.d.ts +55 -0
- package/script/simulator-ui/mutations/GambitSimulatorResetWorkspace.d.ts.map +1 -0
- package/script/simulator-ui/mutations/GambitSimulatorResetWorkspace.js +66 -0
- package/script/simulator-ui/mutations/GambitSimulatorResetWorkspaceMutation.d.ts +55 -0
- package/script/simulator-ui/mutations/GambitSimulatorResetWorkspaceMutation.d.ts.map +1 -0
- package/script/simulator-ui/mutations/GambitSimulatorResetWorkspaceMutation.js +13 -0
- package/script/simulator-ui/mutations/GambitSimulatorStopRun.d.ts +62 -62
- package/script/simulator-ui/mutations/GambitSimulatorStopRun.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitSimulatorStopRunMutation.d.ts +62 -62
- package/script/simulator-ui/mutations/GambitSimulatorStopRunMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceBuildRunCreate.d.ts +62 -62
- package/script/simulator-ui/mutations/GambitWorkspaceBuildRunCreate.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceBuildRunCreateMutation.d.ts +62 -62
- package/script/simulator-ui/mutations/GambitWorkspaceBuildRunCreateMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceConversationSessionSend.d.ts +60 -60
- package/script/simulator-ui/mutations/GambitWorkspaceConversationSessionSend.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceConversationSessionStart.d.ts +20 -20
- package/script/simulator-ui/mutations/GambitWorkspaceConversationSessionStart.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceConversationSessionStop.d.ts +60 -60
- package/script/simulator-ui/mutations/GambitWorkspaceConversationSessionStop.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceCreate.d.ts +11 -11
- package/script/simulator-ui/mutations/GambitWorkspaceCreate.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceCreateMutation.d.ts +11 -11
- package/script/simulator-ui/mutations/GambitWorkspaceCreateMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceDelete.d.ts +6 -0
- package/script/simulator-ui/mutations/GambitWorkspaceDelete.d.ts.map +1 -0
- package/script/simulator-ui/mutations/GambitWorkspaceDelete.js +15 -0
- package/script/simulator-ui/mutations/GambitWorkspaceDeleteMutation.d.ts +6 -0
- package/script/simulator-ui/mutations/GambitWorkspaceDeleteMutation.d.ts.map +1 -0
- package/script/simulator-ui/mutations/GambitWorkspaceDeleteMutation.js +13 -0
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdate.d.ts +16 -16
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdate.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdateMutation.d.ts +16 -16
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagReasonUpdateMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagToggle.d.ts +16 -16
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagToggle.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagToggleMutation.d.ts +16 -16
- package/script/simulator-ui/mutations/GambitWorkspaceGradeFlagToggleMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceGradeRunCreate.d.ts +44 -44
- package/script/simulator-ui/mutations/GambitWorkspaceGradeRunCreate.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceGradeRunCreateMutation.d.ts +44 -44
- package/script/simulator-ui/mutations/GambitWorkspaceGradeRunCreateMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunSend.d.ts +57 -57
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunSend.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunSendMutation.d.ts +57 -57
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunSendMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStart.d.ts +34 -34
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStart.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStartMutation.d.ts +34 -34
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStartMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStop.d.ts +57 -57
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStop.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStopMutation.d.ts +57 -57
- package/script/simulator-ui/mutations/GambitWorkspaceScenarioRunStopMutation.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreate.d.ts +130 -130
- package/script/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreate.d.ts.map +1 -1
- package/script/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreateMutation.d.ts +130 -130
- package/script/simulator-ui/mutations/GambitWorkspaceVerifyBatchRunCreateMutation.d.ts.map +1 -1
- package/script/simulator-ui/src/AppRoot.d.ts.map +1 -1
- package/script/simulator-ui/src/AppRoot.js +9 -1
- package/script/simulator-ui/src/AppShell.d.ts +6 -0
- package/script/simulator-ui/src/AppShell.d.ts.map +1 -1
- package/script/simulator-ui/src/AppShell.js +98 -28
- package/script/simulator-ui/src/DocsPage.d.ts +2 -0
- package/script/simulator-ui/src/DocsPage.d.ts.map +1 -0
- package/script/simulator-ui/src/DocsPage.js +86 -0
- package/script/simulator-ui/src/WorkbenchDrawerIso.d.ts +4 -0
- package/script/simulator-ui/src/WorkbenchDrawerIso.d.ts.map +1 -1
- package/script/simulator-ui/src/WorkbenchDrawerIso.js +20 -3
- package/script/simulator-ui/src/WorkspaceContext.d.ts.map +1 -1
- package/script/simulator-ui/src/WorkspaceContext.js +42 -10
- package/script/simulator-ui/src/grade/GradeResultsPanel.d.ts.map +1 -1
- package/script/simulator-ui/src/grade/GradeResultsPanel.js +3 -1
- package/script/simulator-ui/src/routing.d.ts.map +1 -1
- package/script/simulator-ui/src/routing.js +2 -0
- package/script/simulator-ui/src/test_tab_start_gate.d.ts +8 -0
- package/script/simulator-ui/src/test_tab_start_gate.d.ts.map +1 -0
- package/script/simulator-ui/src/test_tab_start_gate.js +11 -0
- package/script/src/providers/claude_code.d.ts.map +1 -1
- package/script/src/providers/claude_code.js +65 -6
- package/script/src/providers/codex.d.ts.map +1 -1
- package/script/src/providers/codex.js +64 -1
- package/script/src/server.d.ts.map +1 -1
- package/script/src/server.js +272 -127
- package/script/src/server_build_chat_provider.d.ts +26 -0
- package/script/src/server_build_chat_provider.d.ts.map +1 -0
- package/script/src/server_build_chat_provider.js +166 -0
- package/script/src/server_isograph_environment.d.ts +17 -0
- package/script/src/server_isograph_environment.d.ts.map +1 -1
- package/script/src/server_isograph_environment.js +6 -0
- package/script/src/server_session_store.d.ts +41 -1
- package/script/src/server_session_store.d.ts.map +1 -1
- package/script/src/server_session_store.js +1010 -0
- package/script/src/simulator_graphql.d.ts +40 -0
- package/script/src/simulator_graphql.d.ts.map +1 -1
- package/script/src/simulator_graphql.js +141 -58
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
|
2
2
|
import * as path from "../deps/jsr.io/@std/path/1.1.4/mod.js";
|
|
3
3
|
import { existsSync } from "../deps/jsr.io/@std/fs/1.0.23/mod.js";
|
|
4
|
+
import { DatabaseSync } from "node:sqlite";
|
|
5
|
+
import { isOpenResponsesRunEventPayload, toOpenResponsesRunEventV0, } from "@bolt-foundry/gambit-core";
|
|
4
6
|
const TRACE_EVENT_TYPES = new Set([
|
|
5
7
|
"run.start",
|
|
6
8
|
"message.user",
|
|
@@ -114,6 +116,225 @@ const safeStringify = (value, space) => {
|
|
|
114
116
|
return candidate;
|
|
115
117
|
}, space);
|
|
116
118
|
};
|
|
119
|
+
const OPENRESPONSES_RUN_EVENT_RECORD_TYPE = "gambit.openresponses.run_event";
|
|
120
|
+
const OPENRESPONSES_RUN_EVENT_RECORD_KIND = "openresponses.run_event.v0";
|
|
121
|
+
const SESSION_SQLITE_DB_FILENAME = "workspace.sqlite";
|
|
122
|
+
const SESSION_SQLITE_SCHEMA_VERSION = 3;
|
|
123
|
+
const OPENRESPONSES_EVENTS_SQLITE_TABLE = "openresponses_run_events_v0";
|
|
124
|
+
const OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE = "openresponses_output_items_v0";
|
|
125
|
+
function isObjectRecord(value) {
|
|
126
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
127
|
+
}
|
|
128
|
+
function ensureDirSync(dir) {
|
|
129
|
+
try {
|
|
130
|
+
dntShim.Deno.mkdirSync(dir, { recursive: true });
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
if (!(error instanceof dntShim.Deno.errors.AlreadyExists)) {
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function ensureSessionSqliteSchema(db) {
|
|
139
|
+
const row = db.prepare("PRAGMA user_version;").get();
|
|
140
|
+
const current = typeof row?.user_version === "number" ? row.user_version : 0;
|
|
141
|
+
if (current < 1) {
|
|
142
|
+
db.exec(`
|
|
143
|
+
CREATE TABLE IF NOT EXISTS ${OPENRESPONSES_EVENTS_SQLITE_TABLE} (
|
|
144
|
+
workspace_id TEXT NOT NULL,
|
|
145
|
+
run_id TEXT NOT NULL,
|
|
146
|
+
sequence INTEGER NOT NULL,
|
|
147
|
+
event_type TEXT NOT NULL,
|
|
148
|
+
payload_json TEXT NOT NULL,
|
|
149
|
+
idempotency_key TEXT NOT NULL,
|
|
150
|
+
created_at TEXT NOT NULL,
|
|
151
|
+
offset INTEGER NOT NULL UNIQUE,
|
|
152
|
+
UNIQUE (workspace_id, run_id, idempotency_key),
|
|
153
|
+
PRIMARY KEY (workspace_id, run_id, sequence)
|
|
154
|
+
);
|
|
155
|
+
CREATE INDEX IF NOT EXISTS ${OPENRESPONSES_EVENTS_SQLITE_TABLE}_workspace_run_sequence_idx
|
|
156
|
+
ON ${OPENRESPONSES_EVENTS_SQLITE_TABLE}(workspace_id, run_id, sequence);
|
|
157
|
+
CREATE INDEX IF NOT EXISTS ${OPENRESPONSES_EVENTS_SQLITE_TABLE}_workspace_run_idempotency_idx
|
|
158
|
+
ON ${OPENRESPONSES_EVENTS_SQLITE_TABLE}(workspace_id, run_id, idempotency_key);
|
|
159
|
+
`);
|
|
160
|
+
}
|
|
161
|
+
if (current < 2) {
|
|
162
|
+
db.exec(`
|
|
163
|
+
CREATE TABLE IF NOT EXISTS ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE} (
|
|
164
|
+
workspace_id TEXT NOT NULL,
|
|
165
|
+
run_id TEXT NOT NULL,
|
|
166
|
+
item_key TEXT NOT NULL,
|
|
167
|
+
item_id TEXT NOT NULL,
|
|
168
|
+
item_kind TEXT NOT NULL,
|
|
169
|
+
role TEXT,
|
|
170
|
+
content TEXT,
|
|
171
|
+
message_ref_id TEXT,
|
|
172
|
+
reasoning_type TEXT,
|
|
173
|
+
summary TEXT,
|
|
174
|
+
tool_call_id TEXT,
|
|
175
|
+
tool_name TEXT,
|
|
176
|
+
tool_status TEXT,
|
|
177
|
+
arguments_text TEXT,
|
|
178
|
+
result_text TEXT,
|
|
179
|
+
error_text TEXT,
|
|
180
|
+
output_index INTEGER,
|
|
181
|
+
sequence INTEGER NOT NULL,
|
|
182
|
+
PRIMARY KEY (workspace_id, run_id, item_key)
|
|
183
|
+
);
|
|
184
|
+
CREATE INDEX IF NOT EXISTS ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}_workspace_run_sequence_idx
|
|
185
|
+
ON ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}(workspace_id, run_id, sequence);
|
|
186
|
+
`);
|
|
187
|
+
}
|
|
188
|
+
if (current >= 1 && current < 3) {
|
|
189
|
+
db.exec("BEGIN IMMEDIATE;");
|
|
190
|
+
try {
|
|
191
|
+
const migratedTable = `${OPENRESPONSES_EVENTS_SQLITE_TABLE}__v3_migrated`;
|
|
192
|
+
db.exec(`
|
|
193
|
+
DROP TABLE IF EXISTS ${migratedTable};
|
|
194
|
+
CREATE TABLE ${migratedTable} (
|
|
195
|
+
workspace_id TEXT NOT NULL,
|
|
196
|
+
run_id TEXT NOT NULL,
|
|
197
|
+
sequence INTEGER NOT NULL,
|
|
198
|
+
event_type TEXT NOT NULL,
|
|
199
|
+
payload_json TEXT NOT NULL,
|
|
200
|
+
idempotency_key TEXT NOT NULL,
|
|
201
|
+
created_at TEXT NOT NULL,
|
|
202
|
+
offset INTEGER NOT NULL UNIQUE,
|
|
203
|
+
UNIQUE (workspace_id, run_id, idempotency_key),
|
|
204
|
+
PRIMARY KEY (workspace_id, run_id, sequence)
|
|
205
|
+
);
|
|
206
|
+
INSERT INTO ${migratedTable} (
|
|
207
|
+
workspace_id,
|
|
208
|
+
run_id,
|
|
209
|
+
sequence,
|
|
210
|
+
event_type,
|
|
211
|
+
payload_json,
|
|
212
|
+
idempotency_key,
|
|
213
|
+
created_at,
|
|
214
|
+
offset
|
|
215
|
+
)
|
|
216
|
+
SELECT
|
|
217
|
+
workspace_id,
|
|
218
|
+
run_id,
|
|
219
|
+
sequence,
|
|
220
|
+
event_type,
|
|
221
|
+
payload_json,
|
|
222
|
+
idempotency_key,
|
|
223
|
+
created_at,
|
|
224
|
+
offset
|
|
225
|
+
FROM ${OPENRESPONSES_EVENTS_SQLITE_TABLE}
|
|
226
|
+
ORDER BY offset ASC;
|
|
227
|
+
DROP TABLE ${OPENRESPONSES_EVENTS_SQLITE_TABLE};
|
|
228
|
+
ALTER TABLE ${migratedTable} RENAME TO ${OPENRESPONSES_EVENTS_SQLITE_TABLE};
|
|
229
|
+
CREATE INDEX IF NOT EXISTS ${OPENRESPONSES_EVENTS_SQLITE_TABLE}_workspace_run_sequence_idx
|
|
230
|
+
ON ${OPENRESPONSES_EVENTS_SQLITE_TABLE}(workspace_id, run_id, sequence);
|
|
231
|
+
CREATE INDEX IF NOT EXISTS ${OPENRESPONSES_EVENTS_SQLITE_TABLE}_workspace_run_idempotency_idx
|
|
232
|
+
ON ${OPENRESPONSES_EVENTS_SQLITE_TABLE}(workspace_id, run_id, idempotency_key);
|
|
233
|
+
`);
|
|
234
|
+
db.exec("COMMIT;");
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
db.exec("ROLLBACK;");
|
|
238
|
+
throw error;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (current < SESSION_SQLITE_SCHEMA_VERSION) {
|
|
242
|
+
db.exec(`PRAGMA user_version = ${SESSION_SQLITE_SCHEMA_VERSION};`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function parseOpenResponsesRunEventRecord(value) {
|
|
246
|
+
if (!isObjectRecord(value))
|
|
247
|
+
return null;
|
|
248
|
+
if (value.type !== OPENRESPONSES_RUN_EVENT_RECORD_TYPE)
|
|
249
|
+
return null;
|
|
250
|
+
const meta = isObjectRecord(value._gambit) ? value._gambit : null;
|
|
251
|
+
if (meta?.kind !== OPENRESPONSES_RUN_EVENT_RECORD_KIND ||
|
|
252
|
+
!isOpenResponsesRunEventPayload(value.payload)) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
const sequence = typeof value.sequence === "number" &&
|
|
256
|
+
Number.isInteger(value.sequence)
|
|
257
|
+
? value.sequence
|
|
258
|
+
: null;
|
|
259
|
+
if (sequence === null || sequence < 0)
|
|
260
|
+
return null;
|
|
261
|
+
const workspaceId = typeof value.workspace_id === "string"
|
|
262
|
+
? value.workspace_id.trim()
|
|
263
|
+
: "";
|
|
264
|
+
const runId = typeof value.run_id === "string" ? value.run_id.trim() : "";
|
|
265
|
+
const eventType = typeof value.event_type === "string"
|
|
266
|
+
? value.event_type.trim()
|
|
267
|
+
: "";
|
|
268
|
+
const idempotencyKey = typeof value.idempotency_key === "string"
|
|
269
|
+
? value.idempotency_key.trim()
|
|
270
|
+
: "";
|
|
271
|
+
const createdAt = typeof value.created_at === "string"
|
|
272
|
+
? value.created_at
|
|
273
|
+
: "";
|
|
274
|
+
if (!workspaceId || !runId || !eventType || !idempotencyKey || !createdAt) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
workspace_id: workspaceId,
|
|
279
|
+
run_id: runId,
|
|
280
|
+
sequence,
|
|
281
|
+
event_type: eventType,
|
|
282
|
+
payload: value.payload,
|
|
283
|
+
idempotency_key: idempotencyKey,
|
|
284
|
+
created_at: createdAt,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function parsePersistedOpenResponsesRunEventRecord(value) {
|
|
288
|
+
const parsed = parseOpenResponsesRunEventRecord(value);
|
|
289
|
+
if (!parsed || !isObjectRecord(value))
|
|
290
|
+
return null;
|
|
291
|
+
const offset = typeof value.offset === "number" &&
|
|
292
|
+
Number.isInteger(value.offset) &&
|
|
293
|
+
value.offset >= 0
|
|
294
|
+
? value.offset
|
|
295
|
+
: typeof value._gambit?.offset ===
|
|
296
|
+
"number" &&
|
|
297
|
+
Number.isInteger(value._gambit?.offset) &&
|
|
298
|
+
(value._gambit?.offset ?? -1) >= 0
|
|
299
|
+
? value._gambit.offset
|
|
300
|
+
: null;
|
|
301
|
+
return { ...parsed, offset };
|
|
302
|
+
}
|
|
303
|
+
function asRecord(value) {
|
|
304
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
305
|
+
? value
|
|
306
|
+
: null;
|
|
307
|
+
}
|
|
308
|
+
function asString(value) {
|
|
309
|
+
return typeof value === "string" ? value : "";
|
|
310
|
+
}
|
|
311
|
+
function asFiniteNumber(value) {
|
|
312
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
313
|
+
}
|
|
314
|
+
function toEventMessageText(value) {
|
|
315
|
+
if (typeof value === "string")
|
|
316
|
+
return value;
|
|
317
|
+
if (Array.isArray(value)) {
|
|
318
|
+
return value.map((entry) => {
|
|
319
|
+
if (typeof entry === "string")
|
|
320
|
+
return entry;
|
|
321
|
+
const record = asRecord(entry);
|
|
322
|
+
if (!record)
|
|
323
|
+
return "";
|
|
324
|
+
const text = asString(record.text);
|
|
325
|
+
if (text.length > 0)
|
|
326
|
+
return text;
|
|
327
|
+
return toEventMessageText(record.content);
|
|
328
|
+
}).join("");
|
|
329
|
+
}
|
|
330
|
+
const record = asRecord(value);
|
|
331
|
+
if (!record)
|
|
332
|
+
return "";
|
|
333
|
+
const text = asString(record.text);
|
|
334
|
+
if (text.length > 0)
|
|
335
|
+
return text;
|
|
336
|
+
return toEventMessageText(record.content);
|
|
337
|
+
}
|
|
117
338
|
export const createSessionStore = (deps) => {
|
|
118
339
|
const { sessionsRoot, randomId, logger, enrichStateWithSession, workspaceStateSchemaVersion, workspaceSchemaError, } = deps;
|
|
119
340
|
const sessionStateCache = new Map();
|
|
@@ -122,6 +343,9 @@ export const createSessionStore = (deps) => {
|
|
|
122
343
|
const sessionOffsetById = new Map();
|
|
123
344
|
const buildProjectionCache = new Map();
|
|
124
345
|
const buildProjectionRefreshInFlight = new Map();
|
|
346
|
+
const openResponsesRunEventsBySession = new Map();
|
|
347
|
+
const sessionSqliteById = new Map();
|
|
348
|
+
const openResponsesRunEventListenersBySessionRun = new Map();
|
|
125
349
|
const drainSessionWriteQueue = async (sessionId) => {
|
|
126
350
|
let shouldContinueDrain = false;
|
|
127
351
|
try {
|
|
@@ -164,6 +388,16 @@ export const createSessionStore = (deps) => {
|
|
|
164
388
|
sessionWriteActive.add(sessionId);
|
|
165
389
|
void drainSessionWriteQueue(sessionId);
|
|
166
390
|
};
|
|
391
|
+
const enqueueSessionWriteResult = (sessionId, task) => new Promise((resolve, reject) => {
|
|
392
|
+
enqueueSessionWrite(sessionId, async () => {
|
|
393
|
+
try {
|
|
394
|
+
resolve(await task());
|
|
395
|
+
}
|
|
396
|
+
catch (error) {
|
|
397
|
+
reject(error);
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
});
|
|
167
401
|
const mergeSessionState = (current, next) => {
|
|
168
402
|
if (!current)
|
|
169
403
|
return next;
|
|
@@ -192,6 +426,31 @@ export const createSessionStore = (deps) => {
|
|
|
192
426
|
return undefined;
|
|
193
427
|
return value;
|
|
194
428
|
};
|
|
429
|
+
const getSessionSqlitePath = (sessionId, state) => {
|
|
430
|
+
const stateMeta = state?.meta;
|
|
431
|
+
const fromMeta = typeof stateMeta?.sessionSqlitePath === "string"
|
|
432
|
+
? stateMeta.sessionSqlitePath
|
|
433
|
+
: "";
|
|
434
|
+
if (fromMeta.trim().length > 0)
|
|
435
|
+
return fromMeta;
|
|
436
|
+
const sessionDir = typeof stateMeta?.sessionDir === "string"
|
|
437
|
+
? stateMeta.sessionDir
|
|
438
|
+
: path.join(sessionsRoot, sessionId);
|
|
439
|
+
return path.join(sessionDir, SESSION_SQLITE_DB_FILENAME);
|
|
440
|
+
};
|
|
441
|
+
const getSessionSqliteDb = (sessionId, state) => {
|
|
442
|
+
const existing = sessionSqliteById.get(sessionId);
|
|
443
|
+
if (existing)
|
|
444
|
+
return existing;
|
|
445
|
+
const sqlitePath = getSessionSqlitePath(sessionId, state);
|
|
446
|
+
ensureDirSync(path.dirname(sqlitePath));
|
|
447
|
+
const db = new DatabaseSync(sqlitePath);
|
|
448
|
+
db.exec("PRAGMA busy_timeout=5000;");
|
|
449
|
+
db.exec("PRAGMA journal_mode=WAL;");
|
|
450
|
+
ensureSessionSqliteSchema(db);
|
|
451
|
+
sessionSqliteById.set(sessionId, db);
|
|
452
|
+
return db;
|
|
453
|
+
};
|
|
195
454
|
const normalizeBuildProjectionRun = (workspaceId, value) => {
|
|
196
455
|
if (!value || typeof value !== "object") {
|
|
197
456
|
return {
|
|
@@ -340,6 +599,488 @@ export const createSessionStore = (deps) => {
|
|
|
340
599
|
}
|
|
341
600
|
return highest;
|
|
342
601
|
};
|
|
602
|
+
const openResponsesRunEventListenerKey = (workspaceId, runId) => `${workspaceId}::${runId}`;
|
|
603
|
+
const openResponsesRunEventIdempotencyKey = (workspaceId, runId, idempotencyKey) => `${workspaceId}::${runId}::${idempotencyKey}`;
|
|
604
|
+
const getOpenResponsesRunEventStore = (sessionId) => {
|
|
605
|
+
const existing = openResponsesRunEventsBySession.get(sessionId);
|
|
606
|
+
if (existing)
|
|
607
|
+
return existing;
|
|
608
|
+
const created = {
|
|
609
|
+
byIdempotencyKey: new Map(),
|
|
610
|
+
byRunId: new Map(),
|
|
611
|
+
hydrated: false,
|
|
612
|
+
};
|
|
613
|
+
openResponsesRunEventsBySession.set(sessionId, created);
|
|
614
|
+
return created;
|
|
615
|
+
};
|
|
616
|
+
const indexOpenResponsesRunEvent = (store, event) => {
|
|
617
|
+
const idempotencyStoreKey = openResponsesRunEventIdempotencyKey(event.workspace_id, event.run_id, event.idempotency_key);
|
|
618
|
+
if (store.byIdempotencyKey.has(idempotencyStoreKey)) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
store.byIdempotencyKey.set(idempotencyStoreKey, event);
|
|
622
|
+
const runStoreKey = openResponsesRunEventListenerKey(event.workspace_id, event.run_id);
|
|
623
|
+
const byRun = store.byRunId.get(runStoreKey) ?? [];
|
|
624
|
+
byRun.push(event);
|
|
625
|
+
byRun.sort((a, b) => a.sequence - b.sequence);
|
|
626
|
+
store.byRunId.set(runStoreKey, byRun);
|
|
627
|
+
};
|
|
628
|
+
const resetOpenResponsesRunEventStore = (sessionId) => {
|
|
629
|
+
const store = getOpenResponsesRunEventStore(sessionId);
|
|
630
|
+
store.byIdempotencyKey.clear();
|
|
631
|
+
store.byRunId.clear();
|
|
632
|
+
store.hydrated = false;
|
|
633
|
+
};
|
|
634
|
+
const projectOutputItemRowsFromEvent = (event) => {
|
|
635
|
+
const payload = asRecord(event.payload);
|
|
636
|
+
if (!payload)
|
|
637
|
+
return [];
|
|
638
|
+
const payloadType = asString(payload.type) || event.event_type;
|
|
639
|
+
if (payloadType === "input.item") {
|
|
640
|
+
const role = asString(payload.role).trim() || "user";
|
|
641
|
+
const text = toEventMessageText(payload.content).trim() ||
|
|
642
|
+
asString(payload.text).trim();
|
|
643
|
+
if (!text || role !== "user")
|
|
644
|
+
return [];
|
|
645
|
+
return [{
|
|
646
|
+
workspaceId: event.workspace_id,
|
|
647
|
+
runId: event.run_id,
|
|
648
|
+
itemKey: `input:event:${event.sequence}`,
|
|
649
|
+
itemId: `${event.run_id}:input:event:${event.sequence}`,
|
|
650
|
+
itemKind: "message",
|
|
651
|
+
role,
|
|
652
|
+
content: text,
|
|
653
|
+
messageRefId: asString(payload.message_id).trim() ||
|
|
654
|
+
asString(payload.messageRefId).trim() ||
|
|
655
|
+
null,
|
|
656
|
+
reasoningType: null,
|
|
657
|
+
summary: null,
|
|
658
|
+
summaryMode: "replace",
|
|
659
|
+
toolCallId: null,
|
|
660
|
+
toolName: null,
|
|
661
|
+
toolStatus: null,
|
|
662
|
+
argumentsText: null,
|
|
663
|
+
resultText: null,
|
|
664
|
+
errorText: null,
|
|
665
|
+
outputIndex: null,
|
|
666
|
+
sequence: event.sequence,
|
|
667
|
+
}];
|
|
668
|
+
}
|
|
669
|
+
if (payloadType === "response.reasoning.delta" ||
|
|
670
|
+
payloadType === "response.reasoning.done" ||
|
|
671
|
+
payloadType === "response.reasoning_summary_text.delta" ||
|
|
672
|
+
payloadType === "response.reasoning_summary_text.done" ||
|
|
673
|
+
payloadType === "response.reasoning_summary_part.added" ||
|
|
674
|
+
payloadType === "response.reasoning_summary_part.done") {
|
|
675
|
+
const outputIndex = asFiniteNumber(payload.output_index);
|
|
676
|
+
const itemId = asString(payload.item_id).trim() ||
|
|
677
|
+
`reasoning-${outputIndex ?? event.sequence}`;
|
|
678
|
+
const text = asString(payload.delta).trim() ||
|
|
679
|
+
asString(payload.text).trim() ||
|
|
680
|
+
toEventMessageText(payload.part).trim() ||
|
|
681
|
+
toEventMessageText(payload.summary).trim();
|
|
682
|
+
if (!text)
|
|
683
|
+
return [];
|
|
684
|
+
const appendMode = payloadType.endsWith(".delta") ||
|
|
685
|
+
payloadType.endsWith(".added");
|
|
686
|
+
return [{
|
|
687
|
+
workspaceId: event.workspace_id,
|
|
688
|
+
runId: event.run_id,
|
|
689
|
+
itemKey: `reasoning:${itemId}`,
|
|
690
|
+
itemId: `${event.run_id}:reasoning:${itemId}`,
|
|
691
|
+
itemKind: "reasoning",
|
|
692
|
+
role: null,
|
|
693
|
+
content: null,
|
|
694
|
+
messageRefId: null,
|
|
695
|
+
reasoningType: payloadType,
|
|
696
|
+
summary: text,
|
|
697
|
+
summaryMode: appendMode ? "append" : "replace",
|
|
698
|
+
toolCallId: null,
|
|
699
|
+
toolName: null,
|
|
700
|
+
toolStatus: null,
|
|
701
|
+
argumentsText: null,
|
|
702
|
+
resultText: null,
|
|
703
|
+
errorText: null,
|
|
704
|
+
outputIndex,
|
|
705
|
+
sequence: event.sequence,
|
|
706
|
+
}];
|
|
707
|
+
}
|
|
708
|
+
if (payloadType !== "response.output_item.done")
|
|
709
|
+
return [];
|
|
710
|
+
const item = asRecord(payload.item);
|
|
711
|
+
if (!item)
|
|
712
|
+
return [];
|
|
713
|
+
const itemType = asString(item.type);
|
|
714
|
+
const outputIndex = asFiniteNumber(payload.output_index);
|
|
715
|
+
if (itemType === "function_call" || itemType === "tool_call") {
|
|
716
|
+
const toolCallId = asString(item.call_id).trim() ||
|
|
717
|
+
asString(item.id).trim() ||
|
|
718
|
+
`tool-${outputIndex ?? event.sequence}`;
|
|
719
|
+
return [{
|
|
720
|
+
workspaceId: event.workspace_id,
|
|
721
|
+
runId: event.run_id,
|
|
722
|
+
itemKey: `tool:${toolCallId}`,
|
|
723
|
+
itemId: `${event.run_id}:tool:${toolCallId}`,
|
|
724
|
+
itemKind: "tool_call",
|
|
725
|
+
role: null,
|
|
726
|
+
content: null,
|
|
727
|
+
messageRefId: null,
|
|
728
|
+
reasoningType: null,
|
|
729
|
+
summary: null,
|
|
730
|
+
summaryMode: "replace",
|
|
731
|
+
toolCallId,
|
|
732
|
+
toolName: asString(item.name).trim() || "tool_call",
|
|
733
|
+
toolStatus: "RUNNING",
|
|
734
|
+
argumentsText: asString(item.arguments).trim() || null,
|
|
735
|
+
resultText: asString(item.output).trim() || null,
|
|
736
|
+
errorText: asString(item.error).trim() || null,
|
|
737
|
+
outputIndex,
|
|
738
|
+
sequence: event.sequence,
|
|
739
|
+
}];
|
|
740
|
+
}
|
|
741
|
+
if (itemType === "function_call_output") {
|
|
742
|
+
const toolCallId = asString(item.call_id).trim() ||
|
|
743
|
+
asString(item.id).trim() ||
|
|
744
|
+
`tool-${outputIndex ?? event.sequence}`;
|
|
745
|
+
const resultText = asString(item.output).trim() ||
|
|
746
|
+
toEventMessageText(item.output).trim();
|
|
747
|
+
const errorText = asString(item.error).trim() || null;
|
|
748
|
+
return [{
|
|
749
|
+
workspaceId: event.workspace_id,
|
|
750
|
+
runId: event.run_id,
|
|
751
|
+
itemKey: `tool:${toolCallId}`,
|
|
752
|
+
itemId: `${event.run_id}:tool:${toolCallId}`,
|
|
753
|
+
itemKind: "tool_call",
|
|
754
|
+
role: null,
|
|
755
|
+
content: null,
|
|
756
|
+
messageRefId: null,
|
|
757
|
+
reasoningType: null,
|
|
758
|
+
summary: null,
|
|
759
|
+
summaryMode: "replace",
|
|
760
|
+
toolCallId,
|
|
761
|
+
toolName: asString(item.name).trim() || null,
|
|
762
|
+
toolStatus: errorText ? "ERROR" : "COMPLETED",
|
|
763
|
+
argumentsText: asString(item.arguments).trim() || null,
|
|
764
|
+
resultText: resultText || null,
|
|
765
|
+
errorText,
|
|
766
|
+
outputIndex,
|
|
767
|
+
sequence: event.sequence,
|
|
768
|
+
}];
|
|
769
|
+
}
|
|
770
|
+
if (itemType === "message" || itemType === "agent_message" ||
|
|
771
|
+
itemType === "assistant_message") {
|
|
772
|
+
const text = toEventMessageText(item.content).trim() ||
|
|
773
|
+
toEventMessageText(item.text).trim();
|
|
774
|
+
if (!text)
|
|
775
|
+
return [];
|
|
776
|
+
const role = asString(item.role).trim() || "assistant";
|
|
777
|
+
return [{
|
|
778
|
+
workspaceId: event.workspace_id,
|
|
779
|
+
runId: event.run_id,
|
|
780
|
+
itemKey: `output:${outputIndex ?? "na"}:${event.sequence}`,
|
|
781
|
+
itemId: `${event.run_id}:output:${outputIndex ?? "na"}:${event.sequence}`,
|
|
782
|
+
itemKind: "message",
|
|
783
|
+
role,
|
|
784
|
+
content: text,
|
|
785
|
+
messageRefId: asString(item.messageRefId).trim() || null,
|
|
786
|
+
reasoningType: null,
|
|
787
|
+
summary: null,
|
|
788
|
+
summaryMode: "replace",
|
|
789
|
+
toolCallId: null,
|
|
790
|
+
toolName: null,
|
|
791
|
+
toolStatus: null,
|
|
792
|
+
argumentsText: null,
|
|
793
|
+
resultText: null,
|
|
794
|
+
errorText: null,
|
|
795
|
+
outputIndex,
|
|
796
|
+
sequence: event.sequence,
|
|
797
|
+
}];
|
|
798
|
+
}
|
|
799
|
+
if (itemType === "reasoning") {
|
|
800
|
+
const summary = toEventMessageText(item.summary).trim() ||
|
|
801
|
+
asString(item.text).trim();
|
|
802
|
+
if (!summary)
|
|
803
|
+
return [];
|
|
804
|
+
const itemId = asString(item.id).trim() ||
|
|
805
|
+
`reasoning-${outputIndex ?? event.sequence}`;
|
|
806
|
+
return [{
|
|
807
|
+
workspaceId: event.workspace_id,
|
|
808
|
+
runId: event.run_id,
|
|
809
|
+
itemKey: `reasoning:${itemId}`,
|
|
810
|
+
itemId: `${event.run_id}:reasoning:${itemId}`,
|
|
811
|
+
itemKind: "reasoning",
|
|
812
|
+
role: null,
|
|
813
|
+
content: null,
|
|
814
|
+
messageRefId: null,
|
|
815
|
+
reasoningType: itemType,
|
|
816
|
+
summary,
|
|
817
|
+
summaryMode: "replace",
|
|
818
|
+
toolCallId: null,
|
|
819
|
+
toolName: null,
|
|
820
|
+
toolStatus: null,
|
|
821
|
+
argumentsText: null,
|
|
822
|
+
resultText: null,
|
|
823
|
+
errorText: null,
|
|
824
|
+
outputIndex,
|
|
825
|
+
sequence: event.sequence,
|
|
826
|
+
}];
|
|
827
|
+
}
|
|
828
|
+
return [];
|
|
829
|
+
};
|
|
830
|
+
const upsertOutputItemRow = (db, row) => {
|
|
831
|
+
let summary = row.summary;
|
|
832
|
+
if (row.itemKind === "reasoning" && row.summaryMode === "append") {
|
|
833
|
+
const existing = db.prepare(`
|
|
834
|
+
SELECT summary
|
|
835
|
+
FROM ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}
|
|
836
|
+
WHERE workspace_id = ? AND run_id = ? AND item_key = ?
|
|
837
|
+
LIMIT 1
|
|
838
|
+
`).get(row.workspaceId, row.runId, row.itemKey);
|
|
839
|
+
summary = `${existing?.summary ?? ""}${row.summary ?? ""}`;
|
|
840
|
+
}
|
|
841
|
+
db.prepare(`
|
|
842
|
+
INSERT INTO ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE} (
|
|
843
|
+
workspace_id,
|
|
844
|
+
run_id,
|
|
845
|
+
item_key,
|
|
846
|
+
item_id,
|
|
847
|
+
item_kind,
|
|
848
|
+
role,
|
|
849
|
+
content,
|
|
850
|
+
message_ref_id,
|
|
851
|
+
reasoning_type,
|
|
852
|
+
summary,
|
|
853
|
+
tool_call_id,
|
|
854
|
+
tool_name,
|
|
855
|
+
tool_status,
|
|
856
|
+
arguments_text,
|
|
857
|
+
result_text,
|
|
858
|
+
error_text,
|
|
859
|
+
output_index,
|
|
860
|
+
sequence
|
|
861
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
862
|
+
ON CONFLICT(workspace_id, run_id, item_key) DO UPDATE SET
|
|
863
|
+
item_id = excluded.item_id,
|
|
864
|
+
item_kind = excluded.item_kind,
|
|
865
|
+
role = excluded.role,
|
|
866
|
+
content = excluded.content,
|
|
867
|
+
message_ref_id = excluded.message_ref_id,
|
|
868
|
+
reasoning_type = excluded.reasoning_type,
|
|
869
|
+
summary = excluded.summary,
|
|
870
|
+
tool_call_id = excluded.tool_call_id,
|
|
871
|
+
tool_name = COALESCE(excluded.tool_name, ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}.tool_name),
|
|
872
|
+
tool_status = excluded.tool_status,
|
|
873
|
+
arguments_text = COALESCE(excluded.arguments_text, ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}.arguments_text),
|
|
874
|
+
result_text = excluded.result_text,
|
|
875
|
+
error_text = excluded.error_text,
|
|
876
|
+
output_index = COALESCE(${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}.output_index, excluded.output_index),
|
|
877
|
+
sequence = CASE
|
|
878
|
+
WHEN excluded.sequence > ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}.sequence THEN excluded.sequence
|
|
879
|
+
ELSE ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}.sequence
|
|
880
|
+
END
|
|
881
|
+
`).run(row.workspaceId, row.runId, row.itemKey, row.itemId, row.itemKind, row.role, row.content, row.messageRefId, row.reasoningType, summary, row.toolCallId, row.toolName, row.toolStatus, row.argumentsText, row.resultText, row.errorText, row.outputIndex, row.sequence);
|
|
882
|
+
};
|
|
883
|
+
const persistOutputItemsFromRunEvent = (db, event) => {
|
|
884
|
+
const rows = projectOutputItemRowsFromEvent(event);
|
|
885
|
+
for (const row of rows) {
|
|
886
|
+
upsertOutputItemRow(db, row);
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
const importOpenResponsesRunEventsFromJsonl = (sessionId, eventsPath, db) => {
|
|
890
|
+
let text = "";
|
|
891
|
+
try {
|
|
892
|
+
text = dntShim.Deno.readTextFileSync(eventsPath);
|
|
893
|
+
}
|
|
894
|
+
catch {
|
|
895
|
+
return 0;
|
|
896
|
+
}
|
|
897
|
+
const insert = db.prepare(`
|
|
898
|
+
INSERT OR IGNORE INTO ${OPENRESPONSES_EVENTS_SQLITE_TABLE} (
|
|
899
|
+
workspace_id,
|
|
900
|
+
run_id,
|
|
901
|
+
sequence,
|
|
902
|
+
event_type,
|
|
903
|
+
payload_json,
|
|
904
|
+
idempotency_key,
|
|
905
|
+
created_at,
|
|
906
|
+
offset
|
|
907
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
908
|
+
`);
|
|
909
|
+
const maxOffsetRow = db.prepare(`
|
|
910
|
+
SELECT MAX(offset) AS offset
|
|
911
|
+
FROM ${OPENRESPONSES_EVENTS_SQLITE_TABLE}
|
|
912
|
+
`).get();
|
|
913
|
+
let nextSyntheticOffset = typeof maxOffsetRow.offset === "number"
|
|
914
|
+
? maxOffsetRow.offset + 1
|
|
915
|
+
: 0;
|
|
916
|
+
let inserted = 0;
|
|
917
|
+
db.exec("BEGIN IMMEDIATE;");
|
|
918
|
+
try {
|
|
919
|
+
for (const line of text.split("\n")) {
|
|
920
|
+
if (!line.trim())
|
|
921
|
+
continue;
|
|
922
|
+
let parsed = null;
|
|
923
|
+
try {
|
|
924
|
+
parsed = JSON.parse(line);
|
|
925
|
+
}
|
|
926
|
+
catch {
|
|
927
|
+
continue;
|
|
928
|
+
}
|
|
929
|
+
const record = parsePersistedOpenResponsesRunEventRecord(parsed);
|
|
930
|
+
if (!record)
|
|
931
|
+
continue;
|
|
932
|
+
const event = {
|
|
933
|
+
workspace_id: record.workspace_id,
|
|
934
|
+
run_id: record.run_id,
|
|
935
|
+
sequence: record.sequence,
|
|
936
|
+
event_type: record.event_type,
|
|
937
|
+
payload: record.payload,
|
|
938
|
+
idempotency_key: record.idempotency_key,
|
|
939
|
+
created_at: record.created_at,
|
|
940
|
+
};
|
|
941
|
+
const offset = record.offset ?? nextSyntheticOffset;
|
|
942
|
+
if (record.offset === null) {
|
|
943
|
+
nextSyntheticOffset += 1;
|
|
944
|
+
}
|
|
945
|
+
else if (record.offset >= nextSyntheticOffset) {
|
|
946
|
+
nextSyntheticOffset = record.offset + 1;
|
|
947
|
+
}
|
|
948
|
+
const result = insert.run(record.workspace_id, record.run_id, record.sequence, record.event_type, safeStringify(record.payload), record.idempotency_key, record.created_at, offset);
|
|
949
|
+
const changes = Number(result.changes ?? 0);
|
|
950
|
+
if (changes > 0) {
|
|
951
|
+
persistOutputItemsFromRunEvent(db, event);
|
|
952
|
+
}
|
|
953
|
+
inserted += changes;
|
|
954
|
+
}
|
|
955
|
+
db.exec("COMMIT;");
|
|
956
|
+
}
|
|
957
|
+
catch (error) {
|
|
958
|
+
db.exec("ROLLBACK;");
|
|
959
|
+
throw error;
|
|
960
|
+
}
|
|
961
|
+
if (inserted > 0) {
|
|
962
|
+
resetOpenResponsesRunEventStore(sessionId);
|
|
963
|
+
}
|
|
964
|
+
return inserted;
|
|
965
|
+
};
|
|
966
|
+
const hydrateOpenResponsesRunEvents = (sessionId, state, eventsPath) => {
|
|
967
|
+
const store = getOpenResponsesRunEventStore(sessionId);
|
|
968
|
+
if (store.hydrated)
|
|
969
|
+
return;
|
|
970
|
+
const db = getSessionSqliteDb(sessionId, state);
|
|
971
|
+
importOpenResponsesRunEventsFromJsonl(sessionId, eventsPath, db);
|
|
972
|
+
const rows = db.prepare(`
|
|
973
|
+
SELECT
|
|
974
|
+
workspace_id,
|
|
975
|
+
run_id,
|
|
976
|
+
sequence,
|
|
977
|
+
event_type,
|
|
978
|
+
payload_json,
|
|
979
|
+
idempotency_key,
|
|
980
|
+
created_at
|
|
981
|
+
FROM ${OPENRESPONSES_EVENTS_SQLITE_TABLE}
|
|
982
|
+
ORDER BY run_id ASC, sequence ASC
|
|
983
|
+
`).all();
|
|
984
|
+
for (const row of rows) {
|
|
985
|
+
let payload = null;
|
|
986
|
+
try {
|
|
987
|
+
payload = JSON.parse(row.payload_json);
|
|
988
|
+
}
|
|
989
|
+
catch {
|
|
990
|
+
continue;
|
|
991
|
+
}
|
|
992
|
+
if (!isOpenResponsesRunEventPayload(payload))
|
|
993
|
+
continue;
|
|
994
|
+
indexOpenResponsesRunEvent(store, {
|
|
995
|
+
workspace_id: row.workspace_id,
|
|
996
|
+
run_id: row.run_id,
|
|
997
|
+
sequence: row.sequence,
|
|
998
|
+
event_type: row.event_type,
|
|
999
|
+
payload,
|
|
1000
|
+
idempotency_key: row.idempotency_key,
|
|
1001
|
+
created_at: row.created_at,
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
store.hydrated = true;
|
|
1005
|
+
};
|
|
1006
|
+
const appendOpenResponsesRunEventSqlite = (args) => {
|
|
1007
|
+
const db = getSessionSqliteDb(args.sessionId, args.state);
|
|
1008
|
+
importOpenResponsesRunEventsFromJsonl(args.sessionId, args.eventsPath, db);
|
|
1009
|
+
const existing = db.prepare(`
|
|
1010
|
+
SELECT
|
|
1011
|
+
workspace_id,
|
|
1012
|
+
run_id,
|
|
1013
|
+
sequence,
|
|
1014
|
+
event_type,
|
|
1015
|
+
payload_json,
|
|
1016
|
+
idempotency_key,
|
|
1017
|
+
created_at
|
|
1018
|
+
FROM ${OPENRESPONSES_EVENTS_SQLITE_TABLE}
|
|
1019
|
+
WHERE workspace_id = ? AND run_id = ? AND idempotency_key = ?
|
|
1020
|
+
LIMIT 1
|
|
1021
|
+
`).get(args.workspaceId, args.input.run_id, args.input.idempotency_key);
|
|
1022
|
+
if (existing) {
|
|
1023
|
+
// JSON.parse returns `any`; force a runtime-validation path via unknown first.
|
|
1024
|
+
const payload = JSON.parse(existing.payload_json);
|
|
1025
|
+
if (isOpenResponsesRunEventPayload(payload)) {
|
|
1026
|
+
return {
|
|
1027
|
+
event: {
|
|
1028
|
+
workspace_id: existing.workspace_id,
|
|
1029
|
+
run_id: existing.run_id,
|
|
1030
|
+
sequence: existing.sequence,
|
|
1031
|
+
event_type: existing.event_type,
|
|
1032
|
+
payload,
|
|
1033
|
+
idempotency_key: existing.idempotency_key,
|
|
1034
|
+
created_at: existing.created_at,
|
|
1035
|
+
},
|
|
1036
|
+
inserted: false,
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
db.exec("BEGIN IMMEDIATE;");
|
|
1041
|
+
try {
|
|
1042
|
+
const sequenceRow = db.prepare(`
|
|
1043
|
+
SELECT MAX(sequence) AS sequence
|
|
1044
|
+
FROM ${OPENRESPONSES_EVENTS_SQLITE_TABLE}
|
|
1045
|
+
WHERE workspace_id = ? AND run_id = ?
|
|
1046
|
+
`).get(args.workspaceId, args.input.run_id);
|
|
1047
|
+
const sequence = typeof sequenceRow.sequence === "number"
|
|
1048
|
+
? sequenceRow.sequence + 1
|
|
1049
|
+
: 0;
|
|
1050
|
+
const event = toOpenResponsesRunEventV0({
|
|
1051
|
+
...args.input,
|
|
1052
|
+
workspace_id: args.workspaceId,
|
|
1053
|
+
sequence,
|
|
1054
|
+
});
|
|
1055
|
+
db.prepare(`
|
|
1056
|
+
INSERT INTO ${OPENRESPONSES_EVENTS_SQLITE_TABLE} (
|
|
1057
|
+
workspace_id,
|
|
1058
|
+
run_id,
|
|
1059
|
+
sequence,
|
|
1060
|
+
event_type,
|
|
1061
|
+
payload_json,
|
|
1062
|
+
idempotency_key,
|
|
1063
|
+
created_at,
|
|
1064
|
+
offset
|
|
1065
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
1066
|
+
`).run(event.workspace_id, event.run_id, event.sequence, event.event_type, safeStringify(event.payload), event.idempotency_key, event.created_at, args.offset);
|
|
1067
|
+
persistOutputItemsFromRunEvent(db, event);
|
|
1068
|
+
db.exec("COMMIT;");
|
|
1069
|
+
return { event, inserted: true };
|
|
1070
|
+
}
|
|
1071
|
+
catch (error) {
|
|
1072
|
+
db.exec("ROLLBACK;");
|
|
1073
|
+
throw error;
|
|
1074
|
+
}
|
|
1075
|
+
};
|
|
1076
|
+
const publishOpenResponsesRunEvent = (event) => {
|
|
1077
|
+
const listeners = openResponsesRunEventListenersBySessionRun.get(openResponsesRunEventListenerKey(event.workspace_id, event.run_id));
|
|
1078
|
+
if (!listeners || listeners.size === 0)
|
|
1079
|
+
return;
|
|
1080
|
+
for (const listener of listeners) {
|
|
1081
|
+
listener(event);
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
343
1084
|
const getCurrentSessionOffset = (sessionId, state) => {
|
|
344
1085
|
const cached = sessionOffsetById.get(sessionId);
|
|
345
1086
|
if (cached !== undefined)
|
|
@@ -691,6 +1432,257 @@ export const createSessionStore = (deps) => {
|
|
|
691
1432
|
});
|
|
692
1433
|
return envelope;
|
|
693
1434
|
};
|
|
1435
|
+
const appendOpenResponsesRunEvent = async (state, input) => {
|
|
1436
|
+
const sessionId = typeof state.meta?.sessionId === "string"
|
|
1437
|
+
? state.meta.sessionId
|
|
1438
|
+
: undefined;
|
|
1439
|
+
const eventsPath = typeof state.meta?.sessionEventsPath === "string"
|
|
1440
|
+
? state.meta.sessionEventsPath
|
|
1441
|
+
: undefined;
|
|
1442
|
+
const statePath = typeof state.meta?.sessionStatePath === "string"
|
|
1443
|
+
? state.meta.sessionStatePath
|
|
1444
|
+
: undefined;
|
|
1445
|
+
const workspaceId = typeof state.meta?.workspaceId === "string"
|
|
1446
|
+
? state.meta.workspaceId
|
|
1447
|
+
: sessionId;
|
|
1448
|
+
if (!sessionId || !eventsPath || !workspaceId)
|
|
1449
|
+
return null;
|
|
1450
|
+
if (!isOpenResponsesRunEventPayload(input.payload)) {
|
|
1451
|
+
throw new Error("OpenResponses run event payload must include a type");
|
|
1452
|
+
}
|
|
1453
|
+
importOpenResponsesRunEventsFromJsonl(sessionId, eventsPath, getSessionSqliteDb(sessionId, state));
|
|
1454
|
+
const store = getOpenResponsesRunEventStore(sessionId);
|
|
1455
|
+
hydrateOpenResponsesRunEvents(sessionId, state, eventsPath);
|
|
1456
|
+
const idempotencyStoreKey = openResponsesRunEventIdempotencyKey(workspaceId, input.run_id, input.idempotency_key);
|
|
1457
|
+
const existing = store.byIdempotencyKey.get(idempotencyStoreKey);
|
|
1458
|
+
if (existing)
|
|
1459
|
+
return existing;
|
|
1460
|
+
return await enqueueSessionWriteResult(sessionId, async () => {
|
|
1461
|
+
importOpenResponsesRunEventsFromJsonl(sessionId, eventsPath, getSessionSqliteDb(sessionId, state));
|
|
1462
|
+
const localStore = getOpenResponsesRunEventStore(sessionId);
|
|
1463
|
+
hydrateOpenResponsesRunEvents(sessionId, state, eventsPath);
|
|
1464
|
+
const idempotent = localStore.byIdempotencyKey.get(idempotencyStoreKey);
|
|
1465
|
+
if (idempotent) {
|
|
1466
|
+
publishOpenResponsesRunEvent(idempotent);
|
|
1467
|
+
return idempotent;
|
|
1468
|
+
}
|
|
1469
|
+
const offset = nextSessionOffsetCandidate(sessionId, state);
|
|
1470
|
+
const { event, inserted } = appendOpenResponsesRunEventSqlite({
|
|
1471
|
+
sessionId,
|
|
1472
|
+
state,
|
|
1473
|
+
eventsPath,
|
|
1474
|
+
input,
|
|
1475
|
+
workspaceId,
|
|
1476
|
+
offset,
|
|
1477
|
+
});
|
|
1478
|
+
if (!inserted) {
|
|
1479
|
+
indexOpenResponsesRunEvent(localStore, event);
|
|
1480
|
+
publishOpenResponsesRunEvent(event);
|
|
1481
|
+
return event;
|
|
1482
|
+
}
|
|
1483
|
+
const record = {
|
|
1484
|
+
...event,
|
|
1485
|
+
offset,
|
|
1486
|
+
type: OPENRESPONSES_RUN_EVENT_RECORD_TYPE,
|
|
1487
|
+
_gambit: {
|
|
1488
|
+
kind: OPENRESPONSES_RUN_EVENT_RECORD_KIND,
|
|
1489
|
+
domain: "session",
|
|
1490
|
+
offset,
|
|
1491
|
+
},
|
|
1492
|
+
};
|
|
1493
|
+
await appendJsonl(eventsPath, record);
|
|
1494
|
+
sessionOffsetById.set(sessionId, offset);
|
|
1495
|
+
if (state.meta && typeof state.meta === "object") {
|
|
1496
|
+
state.meta.lastAppliedOffset = offset;
|
|
1497
|
+
state.meta.lastAppliedEventSeq = offset;
|
|
1498
|
+
}
|
|
1499
|
+
await updateSnapshotBoundary(sessionId, statePath, offset);
|
|
1500
|
+
indexOpenResponsesRunEvent(localStore, event);
|
|
1501
|
+
publishOpenResponsesRunEvent(event);
|
|
1502
|
+
return event;
|
|
1503
|
+
});
|
|
1504
|
+
};
|
|
1505
|
+
const listOpenResponsesRunEvents = (args) => {
|
|
1506
|
+
const state = readSessionState(args.workspaceId);
|
|
1507
|
+
if (!state)
|
|
1508
|
+
return [];
|
|
1509
|
+
const sessionId = typeof state.meta?.sessionId === "string"
|
|
1510
|
+
? state.meta.sessionId
|
|
1511
|
+
: args.workspaceId;
|
|
1512
|
+
const eventsPath = typeof state.meta?.sessionEventsPath === "string"
|
|
1513
|
+
? state.meta.sessionEventsPath
|
|
1514
|
+
: path.join(sessionsRoot, sessionId, "events.jsonl");
|
|
1515
|
+
const fromSequence = parseFiniteInteger(args.fromSequence) ?? 0;
|
|
1516
|
+
const db = getSessionSqliteDb(sessionId, state);
|
|
1517
|
+
importOpenResponsesRunEventsFromJsonl(sessionId, eventsPath, db);
|
|
1518
|
+
const rows = db.prepare(`
|
|
1519
|
+
SELECT
|
|
1520
|
+
workspace_id,
|
|
1521
|
+
run_id,
|
|
1522
|
+
sequence,
|
|
1523
|
+
event_type,
|
|
1524
|
+
payload_json,
|
|
1525
|
+
idempotency_key,
|
|
1526
|
+
created_at
|
|
1527
|
+
FROM ${OPENRESPONSES_EVENTS_SQLITE_TABLE}
|
|
1528
|
+
WHERE workspace_id = ? AND run_id = ? AND sequence >= ?
|
|
1529
|
+
ORDER BY sequence ASC
|
|
1530
|
+
`).all(args.workspaceId, args.runId, fromSequence);
|
|
1531
|
+
return rows.flatMap((row) => {
|
|
1532
|
+
let payload = {};
|
|
1533
|
+
try {
|
|
1534
|
+
payload = JSON.parse(row.payload_json);
|
|
1535
|
+
}
|
|
1536
|
+
catch {
|
|
1537
|
+
return [];
|
|
1538
|
+
}
|
|
1539
|
+
if (!isOpenResponsesRunEventPayload(payload))
|
|
1540
|
+
return [];
|
|
1541
|
+
return toOpenResponsesRunEventV0({
|
|
1542
|
+
workspace_id: row.workspace_id,
|
|
1543
|
+
run_id: row.run_id,
|
|
1544
|
+
sequence: row.sequence,
|
|
1545
|
+
event_type: row.event_type,
|
|
1546
|
+
payload,
|
|
1547
|
+
idempotency_key: row.idempotency_key,
|
|
1548
|
+
created_at: row.created_at,
|
|
1549
|
+
});
|
|
1550
|
+
});
|
|
1551
|
+
};
|
|
1552
|
+
const listOpenResponsesOutputItems = (args) => {
|
|
1553
|
+
const state = readSessionState(args.workspaceId);
|
|
1554
|
+
if (!state)
|
|
1555
|
+
return [];
|
|
1556
|
+
const sessionId = typeof state.meta?.sessionId === "string"
|
|
1557
|
+
? state.meta.sessionId
|
|
1558
|
+
: args.workspaceId;
|
|
1559
|
+
const eventsPath = typeof state.meta?.sessionEventsPath === "string"
|
|
1560
|
+
? state.meta.sessionEventsPath
|
|
1561
|
+
: path.join(sessionsRoot, sessionId, "events.jsonl");
|
|
1562
|
+
const db = getSessionSqliteDb(sessionId, state);
|
|
1563
|
+
importOpenResponsesRunEventsFromJsonl(sessionId, eventsPath, db);
|
|
1564
|
+
const rows = db.prepare(`
|
|
1565
|
+
SELECT
|
|
1566
|
+
item_id,
|
|
1567
|
+
item_kind,
|
|
1568
|
+
role,
|
|
1569
|
+
content,
|
|
1570
|
+
message_ref_id,
|
|
1571
|
+
reasoning_type,
|
|
1572
|
+
summary,
|
|
1573
|
+
tool_call_id,
|
|
1574
|
+
tool_name,
|
|
1575
|
+
tool_status,
|
|
1576
|
+
arguments_text,
|
|
1577
|
+
result_text,
|
|
1578
|
+
error_text
|
|
1579
|
+
FROM ${OPENRESPONSES_OUTPUT_ITEMS_SQLITE_TABLE}
|
|
1580
|
+
WHERE workspace_id = ? AND run_id = ?
|
|
1581
|
+
ORDER BY sequence ASC, output_index ASC, item_key ASC
|
|
1582
|
+
`).all(args.workspaceId, args.runId);
|
|
1583
|
+
return rows.flatMap((row) => {
|
|
1584
|
+
if (row.item_kind === "message") {
|
|
1585
|
+
return [{
|
|
1586
|
+
__typename: "OutputMessage",
|
|
1587
|
+
id: row.item_id,
|
|
1588
|
+
role: row.role ?? "assistant",
|
|
1589
|
+
content: row.content ?? "",
|
|
1590
|
+
messageRefId: row.message_ref_id ?? undefined,
|
|
1591
|
+
}];
|
|
1592
|
+
}
|
|
1593
|
+
if (row.item_kind === "reasoning") {
|
|
1594
|
+
if (!(row.summary ?? "").trim())
|
|
1595
|
+
return [];
|
|
1596
|
+
return [{
|
|
1597
|
+
__typename: "OutputReasoning",
|
|
1598
|
+
id: row.item_id,
|
|
1599
|
+
summary: row.summary ?? "",
|
|
1600
|
+
reasoningType: row.reasoning_type ?? undefined,
|
|
1601
|
+
}];
|
|
1602
|
+
}
|
|
1603
|
+
if (row.item_kind === "tool_call") {
|
|
1604
|
+
const status = row.tool_status === "RUNNING" ||
|
|
1605
|
+
row.tool_status === "ERROR"
|
|
1606
|
+
? row.tool_status
|
|
1607
|
+
: "COMPLETED";
|
|
1608
|
+
return [{
|
|
1609
|
+
__typename: "OutputToolCall",
|
|
1610
|
+
id: row.item_id,
|
|
1611
|
+
toolCallId: row.tool_call_id ?? row.item_id,
|
|
1612
|
+
toolName: row.tool_name ?? "tool_call",
|
|
1613
|
+
status,
|
|
1614
|
+
argumentsText: row.arguments_text ?? undefined,
|
|
1615
|
+
resultText: row.result_text ?? undefined,
|
|
1616
|
+
error: row.error_text ?? undefined,
|
|
1617
|
+
}];
|
|
1618
|
+
}
|
|
1619
|
+
return [];
|
|
1620
|
+
});
|
|
1621
|
+
};
|
|
1622
|
+
const subscribeOpenResponsesRunEvents = (args) => {
|
|
1623
|
+
const replayFrom = parseFiniteInteger(args.fromSequence) ?? 0;
|
|
1624
|
+
return {
|
|
1625
|
+
async *[Symbol.asyncIterator]() {
|
|
1626
|
+
const listenerKey = openResponsesRunEventListenerKey(args.workspaceId, args.runId);
|
|
1627
|
+
const listeners = openResponsesRunEventListenersBySessionRun.get(listenerKey) ??
|
|
1628
|
+
new Set();
|
|
1629
|
+
openResponsesRunEventListenersBySessionRun.set(listenerKey, listeners);
|
|
1630
|
+
const pending = [];
|
|
1631
|
+
let wake = null;
|
|
1632
|
+
let highWatermark = replayFrom - 1;
|
|
1633
|
+
const wakeNow = () => {
|
|
1634
|
+
if (!wake)
|
|
1635
|
+
return;
|
|
1636
|
+
const resolve = wake;
|
|
1637
|
+
wake = null;
|
|
1638
|
+
resolve();
|
|
1639
|
+
};
|
|
1640
|
+
const listener = (event) => {
|
|
1641
|
+
if (event.sequence <= highWatermark)
|
|
1642
|
+
return;
|
|
1643
|
+
pending.push(event);
|
|
1644
|
+
pending.sort((a, b) => a.sequence - b.sequence);
|
|
1645
|
+
wakeNow();
|
|
1646
|
+
};
|
|
1647
|
+
listeners.add(listener);
|
|
1648
|
+
const abortListener = () => wakeNow();
|
|
1649
|
+
args.signal?.addEventListener("abort", abortListener, { once: true });
|
|
1650
|
+
try {
|
|
1651
|
+
const replay = listOpenResponsesRunEvents({
|
|
1652
|
+
workspaceId: args.workspaceId,
|
|
1653
|
+
runId: args.runId,
|
|
1654
|
+
fromSequence: replayFrom,
|
|
1655
|
+
});
|
|
1656
|
+
for (const event of replay) {
|
|
1657
|
+
if (event.sequence <= highWatermark)
|
|
1658
|
+
continue;
|
|
1659
|
+
highWatermark = event.sequence;
|
|
1660
|
+
yield event;
|
|
1661
|
+
}
|
|
1662
|
+
while (!args.signal?.aborted) {
|
|
1663
|
+
if (pending.length === 0) {
|
|
1664
|
+
await new Promise((resolve) => {
|
|
1665
|
+
wake = resolve;
|
|
1666
|
+
});
|
|
1667
|
+
continue;
|
|
1668
|
+
}
|
|
1669
|
+
const next = pending.shift();
|
|
1670
|
+
if (!next || next.sequence <= highWatermark)
|
|
1671
|
+
continue;
|
|
1672
|
+
highWatermark = next.sequence;
|
|
1673
|
+
yield next;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
finally {
|
|
1677
|
+
args.signal?.removeEventListener("abort", abortListener);
|
|
1678
|
+
listeners.delete(listener);
|
|
1679
|
+
if (listeners.size === 0) {
|
|
1680
|
+
openResponsesRunEventListenersBySessionRun.delete(listenerKey);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
},
|
|
1684
|
+
};
|
|
1685
|
+
};
|
|
694
1686
|
const appendSessionEvent = (state, payload) => appendWorkspaceEnvelope(state, "session", payload);
|
|
695
1687
|
const appendFeedbackLog = (state, payload) => appendWorkspaceEnvelope(state, "session", {
|
|
696
1688
|
...payload,
|
|
@@ -759,9 +1751,19 @@ export const createSessionStore = (deps) => {
|
|
|
759
1751
|
const statePath = typeof snapshot.meta?.sessionStatePath === "string"
|
|
760
1752
|
? snapshot.meta.sessionStatePath
|
|
761
1753
|
: path.join(dir, "state.json");
|
|
1754
|
+
const sqlitePath = typeof snapshot.meta?.sessionSqlitePath === "string"
|
|
1755
|
+
? snapshot.meta.sessionSqlitePath
|
|
1756
|
+
: path.join(dir, SESSION_SQLITE_DB_FILENAME);
|
|
762
1757
|
enqueueSessionWrite(sessionId, async () => {
|
|
763
1758
|
try {
|
|
764
1759
|
await ensureDirAsync(dir);
|
|
1760
|
+
getSessionSqliteDb(sessionId, {
|
|
1761
|
+
...snapshot,
|
|
1762
|
+
meta: {
|
|
1763
|
+
...(snapshot.meta ?? {}),
|
|
1764
|
+
sessionSqlitePath: sqlitePath,
|
|
1765
|
+
},
|
|
1766
|
+
});
|
|
765
1767
|
let firstWrite = false;
|
|
766
1768
|
try {
|
|
767
1769
|
await dntShim.Deno.stat(eventsPath);
|
|
@@ -801,6 +1803,7 @@ export const createSessionStore = (deps) => {
|
|
|
801
1803
|
...(snapshot.meta ?? {}),
|
|
802
1804
|
lastAppliedOffset: snapshotOffset,
|
|
803
1805
|
lastAppliedEventSeq: snapshotOffset,
|
|
1806
|
+
sessionSqlitePath: sqlitePath,
|
|
804
1807
|
},
|
|
805
1808
|
};
|
|
806
1809
|
await appendJsonl(eventsPath, toCanonicalEventRecord({
|
|
@@ -880,6 +1883,9 @@ export const createSessionStore = (deps) => {
|
|
|
880
1883
|
if (typeof meta.sessionBuildStatePath !== "string") {
|
|
881
1884
|
meta.sessionBuildStatePath = path.join(dir, "build_state.json");
|
|
882
1885
|
}
|
|
1886
|
+
if (typeof meta.sessionSqlitePath !== "string") {
|
|
1887
|
+
meta.sessionSqlitePath = path.join(dir, SESSION_SQLITE_DB_FILENAME);
|
|
1888
|
+
}
|
|
883
1889
|
const eventsPath = typeof meta.sessionEventsPath === "string"
|
|
884
1890
|
? meta.sessionEventsPath
|
|
885
1891
|
: undefined;
|
|
@@ -955,6 +1961,7 @@ export const createSessionStore = (deps) => {
|
|
|
955
1961
|
parseFiniteInteger,
|
|
956
1962
|
selectCanonicalScenarioRunSummary,
|
|
957
1963
|
appendWorkspaceEnvelope,
|
|
1964
|
+
appendOpenResponsesRunEvent,
|
|
958
1965
|
appendSessionEvent,
|
|
959
1966
|
appendFeedbackLog,
|
|
960
1967
|
appendGradingLog,
|
|
@@ -964,6 +1971,9 @@ export const createSessionStore = (deps) => {
|
|
|
964
1971
|
readSessionStateStrict,
|
|
965
1972
|
readSessionState,
|
|
966
1973
|
readBuildState,
|
|
1974
|
+
listOpenResponsesRunEvents,
|
|
1975
|
+
listOpenResponsesOutputItems,
|
|
1976
|
+
subscribeOpenResponsesRunEvents,
|
|
967
1977
|
replayBuildProjection,
|
|
968
1978
|
};
|
|
969
1979
|
};
|