@stigmer/react 3.3.0 → 3.4.1
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/agent/useAgentCount.d.ts +2 -0
- package/agent/useAgentCount.d.ts.map +1 -1
- package/agent/useAgentCount.js.map +1 -1
- package/api-key/CreateApiKeyForm.d.ts +7 -1
- package/api-key/CreateApiKeyForm.d.ts.map +1 -1
- package/api-key/CreateApiKeyForm.js +2 -2
- package/api-key/CreateApiKeyForm.js.map +1 -1
- package/billing/index.d.ts +0 -18
- package/billing/index.d.ts.map +1 -1
- package/billing/index.js +4 -9
- package/billing/index.js.map +1 -1
- package/cursor-accounts/CursorAccountEditor.d.ts +7 -1
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -1
- package/cursor-accounts/CursorAccountEditor.js +21 -5
- package/cursor-accounts/CursorAccountEditor.js.map +1 -1
- package/cursor-accounts/CursorAccountsConsole.d.ts +9 -5
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -1
- package/cursor-accounts/CursorAccountsConsole.js +34 -140
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -1
- package/cursor-accounts/MemberCoverageTable.d.ts +29 -0
- package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -0
- package/cursor-accounts/MemberCoverageTable.js +150 -0
- package/cursor-accounts/MemberCoverageTable.js.map +1 -0
- package/cursor-accounts/MemberKeysPanel.d.ts +25 -0
- package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -0
- package/cursor-accounts/MemberKeysPanel.js +115 -0
- package/cursor-accounts/MemberKeysPanel.js.map +1 -0
- package/cursor-accounts/badges.d.ts +9 -0
- package/cursor-accounts/badges.d.ts.map +1 -0
- package/cursor-accounts/badges.js +10 -0
- package/cursor-accounts/badges.js.map +1 -0
- package/cursor-accounts/cursor-account-coverage.d.ts +41 -0
- package/cursor-accounts/cursor-account-coverage.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-coverage.js +26 -0
- package/cursor-accounts/cursor-account-coverage.js.map +1 -0
- package/cursor-accounts/cursor-account-format.d.ts +13 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -1
- package/cursor-accounts/cursor-account-format.js +16 -1
- package/cursor-accounts/cursor-account-format.js.map +1 -1
- package/datastore/CollectionRecordsBrowser.js +18 -4
- package/datastore/CollectionRecordsBrowser.js.map +1 -1
- package/datastore/RecordFilterBuilder.d.ts +8 -1
- package/datastore/RecordFilterBuilder.d.ts.map +1 -1
- package/datastore/RecordFilterBuilder.js +2 -2
- package/datastore/RecordFilterBuilder.js.map +1 -1
- package/datastore/recordFilter.d.ts +9 -1
- package/datastore/recordFilter.d.ts.map +1 -1
- package/datastore/recordFilter.js +12 -1
- package/datastore/recordFilter.js.map +1 -1
- package/datastore/useDatastoreCount.d.ts +2 -0
- package/datastore/useDatastoreCount.d.ts.map +1 -1
- package/datastore/useDatastoreCount.js.map +1 -1
- package/execution/ExecutionProgress.d.ts.map +1 -1
- package/execution/ExecutionProgress.js +13 -4
- package/execution/ExecutionProgress.js.map +1 -1
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +10 -2
- package/execution/MessageThread.js.map +1 -1
- package/execution/useCreateAgentExecution.d.ts +31 -1
- package/execution/useCreateAgentExecution.d.ts.map +1 -1
- package/execution/useCreateAgentExecution.js +2 -0
- package/execution/useCreateAgentExecution.js.map +1 -1
- package/index.d.ts +8 -6
- package/index.d.ts.map +1 -1
- package/index.js +8 -4
- package/index.js.map +1 -1
- package/internal/form-primitives.d.ts +10 -0
- package/internal/form-primitives.d.ts.map +1 -0
- package/{billing → internal}/form-primitives.js +5 -9
- package/internal/form-primitives.js.map +1 -0
- package/manifest/ApplyManifestDialog.d.ts +10 -5
- package/manifest/ApplyManifestDialog.d.ts.map +1 -1
- package/manifest/ApplyManifestDialog.js +30 -13
- package/manifest/ApplyManifestDialog.js.map +1 -1
- package/manifest/useApplyManifest.d.ts +6 -2
- package/manifest/useApplyManifest.d.ts.map +1 -1
- package/manifest/useApplyManifest.js +5 -5
- package/manifest/useApplyManifest.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts +38 -2
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +21 -5
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +7 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +9 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +4 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -1
- package/mcp-server/steps/EnvironmentAuthStep.js +4 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -1
- package/mcp-server/steps/IdentityTransportStep.d.ts +6 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -1
- package/mcp-server/steps/IdentityTransportStep.js +7 -1
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -1
- package/mcp-server/steps/ReviewStep.d.ts +5 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
- package/mcp-server/steps/ReviewStep.js +16 -2
- package/mcp-server/steps/ReviewStep.js.map +1 -1
- package/mcp-server/useMcpServerCount.d.ts +2 -0
- package/mcp-server/useMcpServerCount.d.ts.map +1 -1
- package/mcp-server/useMcpServerCount.js.map +1 -1
- package/package.json +4 -4
- package/pricing-governance/BaselineEditor.d.ts.map +1 -0
- package/{billing → pricing-governance}/BaselineEditor.js +19 -2
- package/pricing-governance/BaselineEditor.js.map +1 -0
- package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -0
- package/pricing-governance/ModelCatalogPanel.js.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.d.ts.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.js.map +1 -0
- package/pricing-governance/OperatorAccessNotice.d.ts.map +1 -0
- package/pricing-governance/OperatorAccessNotice.js.map +1 -0
- package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -0
- package/{billing → pricing-governance}/PricingGovernanceConsole.js +1 -1
- package/pricing-governance/PricingGovernanceConsole.js.map +1 -0
- package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -0
- package/pricing-governance/PricingGovernancePanel.js.map +1 -0
- package/pricing-governance/RetireConfirm.d.ts.map +1 -0
- package/{billing → pricing-governance}/RetireConfirm.js +1 -1
- package/pricing-governance/RetireConfirm.js.map +1 -0
- package/pricing-governance/governance-primitives.d.ts.map +1 -0
- package/pricing-governance/governance-primitives.js.map +1 -0
- package/pricing-governance/index.d.ts +19 -0
- package/pricing-governance/index.d.ts.map +1 -0
- package/pricing-governance/index.js +20 -0
- package/pricing-governance/index.js.map +1 -0
- package/pricing-governance/pricing-format.d.ts.map +1 -0
- package/pricing-governance/pricing-format.js.map +1 -0
- package/pricing-governance/useDecidePricingOverride.d.ts.map +1 -0
- package/pricing-governance/useDecidePricingOverride.js.map +1 -0
- package/pricing-governance/useModelGovernanceView.d.ts.map +1 -0
- package/pricing-governance/useModelGovernanceView.js.map +1 -0
- package/pricing-governance/useModelPricingBaselines.d.ts.map +1 -0
- package/pricing-governance/useModelPricingBaselines.js.map +1 -0
- package/pricing-governance/usePricingGovernance.d.ts.map +1 -0
- package/pricing-governance/usePricingGovernance.js.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.js.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.js.map +1 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -1
- package/resource-creation/CreationPicker.js +3 -3
- package/resource-creation/CreationPicker.js.map +1 -1
- package/resource-creation/WizardNav.d.ts.map +1 -1
- package/resource-creation/WizardNav.js +1 -1
- package/resource-creation/WizardNav.js.map +1 -1
- package/resource-detail/Section.d.ts +8 -1
- package/resource-detail/Section.d.ts.map +1 -1
- package/resource-detail/Section.js +2 -2
- package/resource-detail/Section.js.map +1 -1
- package/resource-workbench/components/ResourceWorkbench.d.ts +9 -1
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -1
- package/resource-workbench/components/ResourceWorkbench.js +2 -1
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -1
- package/resource-workbench/hooks/useResourceCollection.d.ts +9 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -1
- package/resource-workbench/hooks/useResourceCollection.js +2 -2
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -1
- package/search/useResourceCount.d.ts +7 -0
- package/search/useResourceCount.d.ts.map +1 -1
- package/search/useResourceCount.js +2 -1
- package/search/useResourceCount.js.map +1 -1
- package/session/NewSessionViewer.d.ts.map +1 -1
- package/session/NewSessionViewer.js +17 -3
- package/session/NewSessionViewer.js.map +1 -1
- package/session/SessionViewer.d.ts +2 -1
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +19 -11
- package/session/SessionViewer.js.map +1 -1
- package/session/SessionViewerLayout.d.ts +90 -0
- package/session/SessionViewerLayout.d.ts.map +1 -0
- package/session/SessionViewerLayout.js +32 -0
- package/session/SessionViewerLayout.js.map +1 -0
- package/session/index.d.ts +4 -0
- package/session/index.d.ts.map +1 -1
- package/session/index.js +10 -0
- package/session/index.js.map +1 -1
- package/session/useCreateSession.d.ts +28 -0
- package/session/useCreateSession.d.ts.map +1 -1
- package/session/useCreateSession.js +2 -1
- package/session/useCreateSession.js.map +1 -1
- package/session/useNewSessionFlow.d.ts +30 -0
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +7 -1
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useSessionRailViews.d.ts +2 -2
- package/session/useUpdateSession.d.ts +29 -10
- package/session/useUpdateSession.d.ts.map +1 -1
- package/session/useUpdateSession.js +29 -10
- package/session/useUpdateSession.js.map +1 -1
- package/skill/useSkillCount.d.ts +2 -0
- package/skill/useSkillCount.d.ts.map +1 -1
- package/skill/useSkillCount.js.map +1 -1
- package/src/agent/useAgentCount.ts +2 -0
- package/src/api-key/CreateApiKeyForm.tsx +8 -1
- package/src/api-key/__tests__/CreateApiKeyForm.test.tsx +58 -0
- package/src/billing/index.ts +5 -37
- package/src/cursor-accounts/CursorAccountEditor.tsx +61 -13
- package/src/cursor-accounts/CursorAccountsConsole.tsx +44 -400
- package/src/cursor-accounts/MemberCoverageTable.tsx +439 -0
- package/src/cursor-accounts/MemberKeysPanel.tsx +278 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +306 -10
- package/src/cursor-accounts/__tests__/cursor-account-coverage.test.ts +73 -0
- package/src/cursor-accounts/badges.tsx +26 -0
- package/src/cursor-accounts/cursor-account-coverage.ts +71 -0
- package/src/cursor-accounts/cursor-account-format.ts +17 -1
- package/src/datastore/CollectionRecordsBrowser.tsx +29 -3
- package/src/datastore/RecordFilterBuilder.tsx +12 -1
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +38 -0
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +14 -0
- package/src/datastore/__tests__/recordFilter.test.ts +13 -0
- package/src/datastore/recordFilter.ts +15 -1
- package/src/datastore/useDatastoreCount.ts +2 -0
- package/src/execution/ExecutionProgress.tsx +14 -4
- package/src/execution/MessageThread.tsx +10 -2
- package/src/execution/__tests__/ExecutionProgress.test.tsx +67 -0
- package/src/execution/__tests__/MessageThread.test.tsx +44 -0
- package/src/execution/__tests__/useCreateAgentExecution.test.tsx +86 -0
- package/src/execution/useCreateAgentExecution.ts +41 -6
- package/src/index.ts +43 -24
- package/src/{billing → internal}/form-primitives.tsx +4 -32
- package/src/manifest/ApplyManifestDialog.tsx +40 -16
- package/src/manifest/__tests__/ApplyManifestDialog.test.tsx +147 -0
- package/src/manifest/__tests__/useApplyManifest.test.tsx +6 -6
- package/src/manifest/useApplyManifest.ts +12 -8
- package/src/mcp-server/McpServerDetailView.tsx +52 -4
- package/src/mcp-server/__tests__/McpServerDetailView.test.tsx +345 -0
- package/src/mcp-server/index.ts +13 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +4 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +9 -1
- package/src/mcp-server/steps/ReviewStep.tsx +18 -1
- package/src/mcp-server/useMcpServerCount.ts +2 -0
- package/src/{billing → pricing-governance}/BaselineEditor.tsx +36 -3
- package/src/{billing → pricing-governance}/PricingGovernanceConsole.tsx +1 -1
- package/src/{billing → pricing-governance}/RetireConfirm.tsx +1 -1
- package/src/pricing-governance/index.ts +50 -0
- package/src/resource-creation/CreationPicker.tsx +7 -0
- package/src/resource-creation/WizardNav.tsx +1 -0
- package/src/resource-detail/Section.tsx +9 -1
- package/src/resource-workbench/components/ResourceWorkbench.tsx +13 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +11 -1
- package/src/search/useResourceCount.ts +9 -1
- package/src/session/NewSessionViewer.tsx +48 -61
- package/src/session/SessionViewer.tsx +71 -86
- package/src/session/SessionViewerLayout.tsx +131 -0
- package/src/session/__tests__/SessionViewerLayout.test.tsx +140 -0
- package/src/session/__tests__/useCreateSession.test.tsx +94 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
- package/src/session/index.ts +14 -0
- package/src/session/useCreateSession.ts +30 -0
- package/src/session/useNewSessionFlow.ts +45 -1
- package/src/session/useSessionRailViews.tsx +2 -2
- package/src/session/useUpdateSession.ts +29 -10
- package/src/skill/useSkillCount.ts +2 -0
- package/src/test/__tests__/samples.test.ts +159 -2
- package/src/test/index.ts +1 -1
- package/src/test/samples.ts +109 -14
- package/src/workflow/useWorkflowCount.ts +2 -0
- package/styles.css +1 -1
- package/test/index.d.ts +1 -1
- package/test/index.d.ts.map +1 -1
- package/test/index.js +1 -1
- package/test/index.js.map +1 -1
- package/test/samples.d.ts +79 -7
- package/test/samples.d.ts.map +1 -1
- package/test/samples.js +101 -14
- package/test/samples.js.map +1 -1
- package/workflow/useWorkflowCount.d.ts +2 -0
- package/workflow/useWorkflowCount.d.ts.map +1 -1
- package/workflow/useWorkflowCount.js.map +1 -1
- package/billing/BaselineEditor.d.ts.map +0 -1
- package/billing/BaselineEditor.js.map +0 -1
- package/billing/ModelCatalogPanel.d.ts.map +0 -1
- package/billing/ModelCatalogPanel.js.map +0 -1
- package/billing/ModelGovernanceDetail.d.ts.map +0 -1
- package/billing/ModelGovernanceDetail.js.map +0 -1
- package/billing/OperatorAccessNotice.d.ts.map +0 -1
- package/billing/OperatorAccessNotice.js.map +0 -1
- package/billing/PricingGovernanceConsole.d.ts.map +0 -1
- package/billing/PricingGovernanceConsole.js.map +0 -1
- package/billing/PricingGovernancePanel.d.ts.map +0 -1
- package/billing/PricingGovernancePanel.js.map +0 -1
- package/billing/RetireConfirm.d.ts.map +0 -1
- package/billing/RetireConfirm.js.map +0 -1
- package/billing/form-primitives.d.ts +0 -18
- package/billing/form-primitives.d.ts.map +0 -1
- package/billing/form-primitives.js.map +0 -1
- package/billing/governance-primitives.d.ts.map +0 -1
- package/billing/governance-primitives.js.map +0 -1
- package/billing/pricing-format.d.ts.map +0 -1
- package/billing/pricing-format.js.map +0 -1
- package/billing/useDecidePricingOverride.d.ts.map +0 -1
- package/billing/useDecidePricingOverride.js.map +0 -1
- package/billing/useModelGovernanceView.d.ts.map +0 -1
- package/billing/useModelGovernanceView.js.map +0 -1
- package/billing/useModelPricingBaselines.d.ts.map +0 -1
- package/billing/useModelPricingBaselines.js.map +0 -1
- package/billing/usePricingGovernance.d.ts.map +0 -1
- package/billing/usePricingGovernance.js.map +0 -1
- package/billing/useRetireModelPricingBaseline.d.ts.map +0 -1
- package/billing/useRetireModelPricingBaseline.js.map +0 -1
- package/billing/useUpsertModelPricingBaseline.d.ts.map +0 -1
- package/billing/useUpsertModelPricingBaseline.js.map +0 -1
- /package/{billing → pricing-governance}/BaselineEditor.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelCatalogPanel.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelCatalogPanel.js +0 -0
- /package/{billing → pricing-governance}/ModelGovernanceDetail.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelGovernanceDetail.js +0 -0
- /package/{billing → pricing-governance}/OperatorAccessNotice.d.ts +0 -0
- /package/{billing → pricing-governance}/OperatorAccessNotice.js +0 -0
- /package/{billing → pricing-governance}/PricingGovernanceConsole.d.ts +0 -0
- /package/{billing → pricing-governance}/PricingGovernancePanel.d.ts +0 -0
- /package/{billing → pricing-governance}/PricingGovernancePanel.js +0 -0
- /package/{billing → pricing-governance}/RetireConfirm.d.ts +0 -0
- /package/{billing → pricing-governance}/governance-primitives.d.ts +0 -0
- /package/{billing → pricing-governance}/governance-primitives.js +0 -0
- /package/{billing → pricing-governance}/pricing-format.d.ts +0 -0
- /package/{billing → pricing-governance}/pricing-format.js +0 -0
- /package/{billing → pricing-governance}/useDecidePricingOverride.d.ts +0 -0
- /package/{billing → pricing-governance}/useDecidePricingOverride.js +0 -0
- /package/{billing → pricing-governance}/useModelGovernanceView.d.ts +0 -0
- /package/{billing → pricing-governance}/useModelGovernanceView.js +0 -0
- /package/{billing → pricing-governance}/useModelPricingBaselines.d.ts +0 -0
- /package/{billing → pricing-governance}/useModelPricingBaselines.js +0 -0
- /package/{billing → pricing-governance}/usePricingGovernance.d.ts +0 -0
- /package/{billing → pricing-governance}/usePricingGovernance.js +0 -0
- /package/{billing → pricing-governance}/useRetireModelPricingBaseline.d.ts +0 -0
- /package/{billing → pricing-governance}/useRetireModelPricingBaseline.js +0 -0
- /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.d.ts +0 -0
- /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.js +0 -0
- /package/src/{billing → pricing-governance}/ModelCatalogPanel.tsx +0 -0
- /package/src/{billing → pricing-governance}/ModelGovernanceDetail.tsx +0 -0
- /package/src/{billing → pricing-governance}/OperatorAccessNotice.tsx +0 -0
- /package/src/{billing → pricing-governance}/PricingGovernancePanel.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/ModelCatalogPanel.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/PricingGovernanceConsole.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/useModelGovernanceView.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/governance-primitives.tsx +0 -0
- /package/src/{billing → pricing-governance}/pricing-format.ts +0 -0
- /package/src/{billing → pricing-governance}/useDecidePricingOverride.ts +0 -0
- /package/src/{billing → pricing-governance}/useModelGovernanceView.ts +0 -0
- /package/src/{billing → pricing-governance}/useModelPricingBaselines.ts +0 -0
- /package/src/{billing → pricing-governance}/usePricingGovernance.ts +0 -0
- /package/src/{billing → pricing-governance}/useRetireModelPricingBaseline.ts +0 -0
- /package/src/{billing → pricing-governance}/useUpsertModelPricingBaseline.ts +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
1
|
+
import { describe, it, expect, afterEach, vi } from "vitest";
|
|
2
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
2
3
|
import { ExecutionPhase, MessageType, ToolCallStatus, ExecutionArtifactKind } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
3
4
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
4
|
-
import {
|
|
5
|
+
import { formatDuration } from "../../execution/ToolCallDetail";
|
|
6
|
+
import { samples, SAMPLE_INSTANT, sampleInstant, sampleDate } from "../samples";
|
|
5
7
|
|
|
6
8
|
describe("samples", () => {
|
|
7
9
|
describe("session", () => {
|
|
@@ -169,3 +171,158 @@ describe("samples", () => {
|
|
|
169
171
|
});
|
|
170
172
|
});
|
|
171
173
|
});
|
|
174
|
+
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
// Determinism — the reason these factories exist. A `samples.*` value is
|
|
177
|
+
// rendered into Scenar tours that replay in the browser and export to video
|
|
178
|
+
// frame by frame, so any live-clock read paints a pixel that changes between
|
|
179
|
+
// runs (scenar-cloud DD-006). These tests are the regression lock: each one
|
|
180
|
+
// FAILS if a factory is reverted to reading the clock.
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
|
|
183
|
+
describe("samples determinism", () => {
|
|
184
|
+
afterEach(() => {
|
|
185
|
+
vi.useRealTimers();
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// A zero-arg call for every factory, with representative arguments. The
|
|
189
|
+
// completeness test below asserts this map covers `samples` exactly, so a
|
|
190
|
+
// newly-added factory that reads the clock cannot slip past the stability
|
|
191
|
+
// sweep unnoticed.
|
|
192
|
+
const invoke: Record<keyof typeof samples, () => unknown> = {
|
|
193
|
+
session: () => samples.session(),
|
|
194
|
+
agent: () => samples.agent(),
|
|
195
|
+
agentExecution: () => samples.agentExecution(),
|
|
196
|
+
skill: () => samples.skill(),
|
|
197
|
+
mcpServer: () => samples.mcpServer(),
|
|
198
|
+
environment: () => samples.environment(),
|
|
199
|
+
agentInstance: () => samples.agentInstance(),
|
|
200
|
+
apiKey: () => samples.apiKey(),
|
|
201
|
+
humanMessage: () => samples.humanMessage("hello"),
|
|
202
|
+
aiMessage: () => samples.aiMessage("hi"),
|
|
203
|
+
toolCall: () => samples.toolCall("lookup_order", '{"orderId":"123"}'),
|
|
204
|
+
artifact: () => samples.artifact("report.md"),
|
|
205
|
+
sessionList: () => samples.sessionList(),
|
|
206
|
+
agentExecutionList: () => samples.agentExecutionList(),
|
|
207
|
+
searchResponse: () => samples.searchResponse(),
|
|
208
|
+
apiKeyList: () => samples.apiKeyList(),
|
|
209
|
+
searchResult: () => samples.searchResult(),
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
it("the stability sweep covers every factory", () => {
|
|
213
|
+
expect(Object.keys(invoke).sort()).toEqual(Object.keys(samples).sort());
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Two calls under system clocks a full calendar day apart must produce
|
|
217
|
+
// identical objects. The day boundary is deliberate: it is what reproduces
|
|
218
|
+
// the `apiKey` bug (a `createdAt` date that changed daily) and the message
|
|
219
|
+
// and tool-call timestamp drift, none of which a same-millisecond back-to-
|
|
220
|
+
// back call would expose.
|
|
221
|
+
it.each(Object.keys(invoke) as (keyof typeof samples)[])(
|
|
222
|
+
"%s is identical across a day boundary",
|
|
223
|
+
(name) => {
|
|
224
|
+
vi.useFakeTimers();
|
|
225
|
+
|
|
226
|
+
vi.setSystemTime(new Date("2026-03-01T08:15:00Z"));
|
|
227
|
+
const first = invoke[name]();
|
|
228
|
+
|
|
229
|
+
vi.setSystemTime(new Date("2026-03-02T21:45:30Z"));
|
|
230
|
+
const second = invoke[name]();
|
|
231
|
+
|
|
232
|
+
expect(second).toEqual(first);
|
|
233
|
+
},
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
it("stamps the frozen instant on every timestamped primitive", () => {
|
|
237
|
+
expect(samples.humanMessage("x").timestamp).toBe(SAMPLE_INSTANT);
|
|
238
|
+
expect(samples.aiMessage("x").timestamp).toBe(SAMPLE_INSTANT);
|
|
239
|
+
expect(samples.artifact("x").createdAt).toBe(SAMPLE_INSTANT);
|
|
240
|
+
expect(samples.toolCall("x", "y").startedAt).toBe(SAMPLE_INSTANT);
|
|
241
|
+
|
|
242
|
+
const createdAt = samples.apiKey().status?.audit?.specAudit?.createdAt;
|
|
243
|
+
expect(createdAt).toBeDefined();
|
|
244
|
+
expect(timestampDate(createdAt!).toISOString()).toBe(SAMPLE_INSTANT);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
it("renders a stable duration chip rather than the old 0ms flake", () => {
|
|
248
|
+
const tc = samples.toolCall("lookup_order", "{}");
|
|
249
|
+
expect(formatDuration(tc.startedAt, tc.completedAt)).toBe("1.2s");
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it("derives a clock-free tool-call id from the name", () => {
|
|
253
|
+
expect(samples.toolCall("process_return", "{}").id).toBe("tc-process_return");
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it("honors an ApiKeyOverrides.createdAt override", () => {
|
|
257
|
+
const frozen = "2026-01-02T03:04:05.000Z";
|
|
258
|
+
const key = samples.apiKey({ createdAt: frozen });
|
|
259
|
+
const createdAt = key.status?.audit?.specAudit?.createdAt;
|
|
260
|
+
expect(timestampDate(createdAt!).toISOString()).toBe(frozen);
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// ---------------------------------------------------------------------------
|
|
265
|
+
// The reader offset window — why SAMPLE_INSTANT is 11:00 UTC. Components
|
|
266
|
+
// format dates in the reader's local time, and real UTC offsets span −11:00
|
|
267
|
+
// to +14:00 (25 hours against a 24-hour day), so no instant renders one
|
|
268
|
+
// calendar date everywhere. The supported window is UTC−11:00 (Midway)
|
|
269
|
+
// through UTC+12:45 (Chatham, southern winter): every inhabited zone except
|
|
270
|
+
// Tongatapu (+13) and Kiritimati (+14). Local date is monotonic in offset,
|
|
271
|
+
// so agreement at the two boundaries proves agreement throughout.
|
|
272
|
+
//
|
|
273
|
+
// `scripts/verify-scenar-tours.mjs` exports the same boundaries as
|
|
274
|
+
// READER_OFFSET_WINDOW (its own test locks those values); this suite locks
|
|
275
|
+
// the anchor's side of the contract.
|
|
276
|
+
// ---------------------------------------------------------------------------
|
|
277
|
+
|
|
278
|
+
describe("SAMPLE_INSTANT reader offset window", () => {
|
|
279
|
+
const WEST_OFFSET_MINUTES = -11 * 60; // UTC−11:00, Midway
|
|
280
|
+
const EAST_OFFSET_MINUTES = 12 * 60 + 45; // UTC+12:45, Chatham (Jul)
|
|
281
|
+
|
|
282
|
+
/** Calendar date (YYYY-MM-DD) the instant renders at a fixed UTC offset. */
|
|
283
|
+
const localDateAtOffset = (iso: string, offsetMinutes: number): string =>
|
|
284
|
+
new Date(Date.parse(iso) + offsetMinutes * 60_000).toISOString().slice(0, 10);
|
|
285
|
+
|
|
286
|
+
it("renders one calendar date at both window boundaries", () => {
|
|
287
|
+
const west = localDateAtOffset(SAMPLE_INSTANT, WEST_OFFSET_MINUTES);
|
|
288
|
+
const east = localDateAtOffset(SAMPLE_INSTANT, EAST_OFFSET_MINUTES);
|
|
289
|
+
expect(west).toBe("2026-07-20");
|
|
290
|
+
expect(east).toBe("2026-07-20");
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
// The two anchors this one replaced, kept as negative cases so nobody
|
|
294
|
+
// "corrects" the constant back: 09:30Z was the original tour-world instant
|
|
295
|
+
// (read Jul 19 in Honolulu); noon was SAMPLE_INSTANT's first value and the
|
|
296
|
+
// once-planned fix (read Jul 21 in Auckland, Fiji, and Chatham).
|
|
297
|
+
it.each([
|
|
298
|
+
["2026-07-20T09:30:00.000Z", "drifts at the west boundary"],
|
|
299
|
+
["2026-07-20T12:00:00.000Z", "drifts at the east boundary"],
|
|
300
|
+
])("rejected anchor %s %s", (iso) => {
|
|
301
|
+
expect(localDateAtOffset(iso, WEST_OFFSET_MINUTES)).not.toBe(
|
|
302
|
+
localDateAtOffset(iso, EAST_OFFSET_MINUTES),
|
|
303
|
+
);
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
describe("sampleInstant / sampleDate derivation", () => {
|
|
308
|
+
it("sampleInstant with no delta is the anchor itself", () => {
|
|
309
|
+
expect(sampleInstant()).toBe(SAMPLE_INSTANT);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it("applies positive and negative deltas exactly", () => {
|
|
313
|
+
expect(sampleInstant(2_400)).toBe("2026-07-20T11:00:02.400Z");
|
|
314
|
+
expect(sampleInstant(-86_400_000)).toBe("2026-07-19T11:00:00.000Z");
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it("sampleDate agrees with sampleInstant at every delta", () => {
|
|
318
|
+
for (const deltaMs of [0, 1_200, 2_400, -3_600_000, 86_400_000]) {
|
|
319
|
+
expect(sampleDate(deltaMs).toISOString()).toBe(sampleInstant(deltaMs));
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it("the default toolCall span derives from the anchor", () => {
|
|
324
|
+
const tc = samples.toolCall("lookup_order", "{}");
|
|
325
|
+
expect(tc.startedAt).toBe(sampleInstant());
|
|
326
|
+
expect(tc.completedAt).toBe(sampleInstant(1_200));
|
|
327
|
+
});
|
|
328
|
+
});
|
package/src/test/index.ts
CHANGED
package/src/test/samples.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { create } from "@bufbuild/protobuf";
|
|
2
|
+
import { timestampFromDate } from "@bufbuild/protobuf/wkt";
|
|
2
3
|
import { AgentSchema, type Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
3
4
|
import { AgentSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
4
5
|
import {
|
|
@@ -75,6 +76,77 @@ import {
|
|
|
75
76
|
type SearchResult,
|
|
76
77
|
} from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
77
78
|
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// The frozen instant
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The frozen instant every timestamped `samples.*` factory defaults to — the
|
|
85
|
+
* tour world's single clock. Anything in a demo that needs an instant derives
|
|
86
|
+
* from this one via {@link sampleInstant} / {@link sampleDate}; nothing
|
|
87
|
+
* authors a second instant of its own (`scripts/verify-scenar-tours.mjs`
|
|
88
|
+
* enforces that under `demos/tours/`).
|
|
89
|
+
*
|
|
90
|
+
* These factories must never read the live clock. A `samples.*` value is
|
|
91
|
+
* rendered into Scenar tours that replay in the browser and export to video
|
|
92
|
+
* frame by frame; a clock read paints a pixel that changes between runs, which
|
|
93
|
+
* breaks the "same source, same result" guarantee (scenar-cloud DD-006).
|
|
94
|
+
*
|
|
95
|
+
* The date is `2026-07-20`, the tour world's demo day. The time is 11:00 UTC,
|
|
96
|
+
* chosen by the *reader offset window*: components format dates in the
|
|
97
|
+
* reader's local time (e.g. `ApiKeyListPanel` via `toLocaleDateString`), and
|
|
98
|
+
* real UTC offsets span −11:00 (Midway) to +14:00 (Kiritimati) — a 25-hour
|
|
99
|
+
* range against a 24-hour day, so **no instant renders one calendar date
|
|
100
|
+
* everywhere**. The supported window is UTC−11:00 through UTC+12:45 — every
|
|
101
|
+
* inhabited zone except Tongatapu (+13, ~100k) and Kiritimati (+14, ~6k).
|
|
102
|
+
* 11:00Z holds `Jul 20` across that whole window; the previous noon anchor
|
|
103
|
+
* flipped to `Jul 21` at UTC+12:45 and beyond (Auckland, Fiji, Chatham).
|
|
104
|
+
* Instants whose calendar *date* is rendered must stay inside the window's
|
|
105
|
+
* stable band, 11:00:00Z–11:14:59Z — the anchor sits at its start so all
|
|
106
|
+
* derivation headroom points forward. Duration deltas (end minus start) are
|
|
107
|
+
* zone-invariant and may leave the band freely.
|
|
108
|
+
*
|
|
109
|
+
* The window stabilises the rendered *date*, not the rendered *string*:
|
|
110
|
+
* locale-unpinned formatters still vary the format per reader ("Jul 20, 2026"
|
|
111
|
+
* vs "20 Jul 2026"), and a component that renders a *time of day* is
|
|
112
|
+
* zone-dependent no matter which instant is chosen. The property test in
|
|
113
|
+
* `__tests__/samples.test.ts` locks the date-stability claim at both window
|
|
114
|
+
* boundaries.
|
|
115
|
+
*/
|
|
116
|
+
export const SAMPLE_INSTANT = "2026-07-20T11:00:00.000Z";
|
|
117
|
+
|
|
118
|
+
/** {@link SAMPLE_INSTANT} in epoch milliseconds, the base all derivation uses. */
|
|
119
|
+
const SAMPLE_INSTANT_MS = Date.parse(SAMPLE_INSTANT);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* An ISO-8601 instant `deltaMs` after {@link SAMPLE_INSTANT} — the way a
|
|
123
|
+
* fixture expresses "2.4 seconds later" or "a day earlier" without authoring
|
|
124
|
+
* a second instant. `sampleInstant()` with no argument is the anchor itself.
|
|
125
|
+
*
|
|
126
|
+
* Prefer this over a hand-written literal even for values that never render:
|
|
127
|
+
* derivation keeps the whole fixture world moving together if the demo day is
|
|
128
|
+
* ever refreshed, and the tour gate rejects authored instant literals anyway.
|
|
129
|
+
*/
|
|
130
|
+
export function sampleInstant(deltaMs = 0): string {
|
|
131
|
+
return new Date(SAMPLE_INSTANT_MS + deltaMs).toISOString();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* {@link sampleInstant} as a `Date`, for APIs that take one (e.g. protobuf's
|
|
136
|
+
* `timestampFromDate`). Same instant, same derivation rule.
|
|
137
|
+
*/
|
|
138
|
+
export function sampleDate(deltaMs = 0): Date {
|
|
139
|
+
return new Date(SAMPLE_INSTANT_MS + deltaMs);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* When a default {@link samples.toolCall} completes: {@link SAMPLE_INSTANT}
|
|
144
|
+
* plus 1.2s, so the rendered duration chip reads a stable "1.2s" — long
|
|
145
|
+
* enough to never collapse to the "0ms" that two adjacent live clock reads
|
|
146
|
+
* used to produce.
|
|
147
|
+
*/
|
|
148
|
+
const SAMPLE_TOOL_CALL_COMPLETED_AT = sampleInstant(1_200);
|
|
149
|
+
|
|
78
150
|
// ---------------------------------------------------------------------------
|
|
79
151
|
// Override interfaces — flat projections of commonly-customized fields
|
|
80
152
|
// ---------------------------------------------------------------------------
|
|
@@ -145,6 +217,8 @@ export interface ApiKeyOverrides {
|
|
|
145
217
|
readonly fingerprint?: string;
|
|
146
218
|
readonly neverExpires?: boolean;
|
|
147
219
|
readonly keyHash?: string;
|
|
220
|
+
/** Frozen ISO-8601 instant for the key's `createdAt`. Defaults to {@link SAMPLE_INSTANT}. */
|
|
221
|
+
readonly createdAt?: string;
|
|
148
222
|
}
|
|
149
223
|
|
|
150
224
|
export interface SearchResultOverrides {
|
|
@@ -166,17 +240,30 @@ export interface SearchResultOverrides {
|
|
|
166
240
|
*
|
|
167
241
|
* Each factory returns a realistic protobuf object with sensible defaults.
|
|
168
242
|
* Pass an overrides object to customize the most commonly-needed fields.
|
|
169
|
-
*
|
|
170
|
-
*
|
|
243
|
+
*
|
|
244
|
+
* Every timestamp is frozen at {@link SAMPLE_INSTANT} — these factories never
|
|
245
|
+
* read the live clock, so a fixture renders identical pixels on every browser
|
|
246
|
+
* replay and every video-export frame (scenar-cloud DD-006). Do not
|
|
247
|
+
* reintroduce `Date.now()` or `new Date()` here.
|
|
248
|
+
*
|
|
249
|
+
* For a value the overrides do not cover — a different timestamp, a distinct
|
|
250
|
+
* tool-call id — modify the returned object directly rather than growing the
|
|
251
|
+
* override surface: protobuf messages from `create()` are mutable plain
|
|
252
|
+
* objects. Timestamps derive from the anchor via {@link sampleInstant} rather
|
|
253
|
+
* than a hand-written literal, so the fixture world keeps a single clock.
|
|
171
254
|
*
|
|
172
255
|
* @example
|
|
173
256
|
* ```ts
|
|
174
|
-
* import { samples } from "@stigmer/react/test";
|
|
257
|
+
* import { samples, sampleInstant } from "@stigmer/react/test";
|
|
175
258
|
*
|
|
176
259
|
* const scenario = buildScenario(
|
|
177
260
|
* fixtures.session.get(() => samples.session({ subject: "My topic" })),
|
|
178
261
|
* fixtures.agent.getByReference(() => samples.agent({ name: "My Agent" })),
|
|
179
262
|
* );
|
|
263
|
+
*
|
|
264
|
+
* // Deeper customization — derive "5 seconds later" from the anchor:
|
|
265
|
+
* const later = samples.humanMessage("later");
|
|
266
|
+
* later.timestamp = sampleInstant(5_000);
|
|
180
267
|
* ```
|
|
181
268
|
*/
|
|
182
269
|
export const samples = {
|
|
@@ -363,7 +450,7 @@ export const samples = {
|
|
|
363
450
|
status: create(ApiKeyStatusSchema, {
|
|
364
451
|
audit: create(ApiResourceAuditSchema, {
|
|
365
452
|
specAudit: create(ApiResourceAuditInfoSchema, {
|
|
366
|
-
createdAt:
|
|
453
|
+
createdAt: timestampFromDate(new Date(o?.createdAt ?? SAMPLE_INSTANT)),
|
|
367
454
|
}),
|
|
368
455
|
}),
|
|
369
456
|
}),
|
|
@@ -372,44 +459,52 @@ export const samples = {
|
|
|
372
459
|
|
|
373
460
|
// ---- Message & artifact primitives ----
|
|
374
461
|
|
|
375
|
-
/** A human (user) message. */
|
|
462
|
+
/** A human (user) message, stamped at {@link SAMPLE_INSTANT}. */
|
|
376
463
|
humanMessage(content: string): AgentMessage {
|
|
377
464
|
return create(AgentMessageSchema, {
|
|
378
465
|
type: MessageType.MESSAGE_HUMAN,
|
|
379
466
|
content,
|
|
380
|
-
timestamp:
|
|
467
|
+
timestamp: SAMPLE_INSTANT,
|
|
381
468
|
});
|
|
382
469
|
},
|
|
383
470
|
|
|
384
|
-
/** An AI (assistant) message, optionally with tool calls. */
|
|
471
|
+
/** An AI (assistant) message, optionally with tool calls, stamped at {@link SAMPLE_INSTANT}. */
|
|
385
472
|
aiMessage(content: string, toolCalls?: ToolCall[]): AgentMessage {
|
|
386
473
|
return create(AgentMessageSchema, {
|
|
387
474
|
type: MessageType.MESSAGE_AI,
|
|
388
475
|
content,
|
|
389
|
-
timestamp:
|
|
476
|
+
timestamp: SAMPLE_INSTANT,
|
|
390
477
|
toolCalls: toolCalls ?? [],
|
|
391
478
|
});
|
|
392
479
|
},
|
|
393
480
|
|
|
394
|
-
/**
|
|
481
|
+
/**
|
|
482
|
+
* A completed tool call with a result, spanning {@link SAMPLE_INSTANT} to 1.2s
|
|
483
|
+
* later so its duration chip reads a stable "1.2s".
|
|
484
|
+
*
|
|
485
|
+
* The `id` is `tc-${name}`, derived from the name so it is stable across
|
|
486
|
+
* runs. Two tool calls sharing a name therefore share an id — if a single
|
|
487
|
+
* demo renders both and one drives an approval (`useApproval(toolCall.id)`),
|
|
488
|
+
* build the second by hand with a distinct id via `create(ToolCallSchema)`.
|
|
489
|
+
*/
|
|
395
490
|
toolCall(name: string, result: string): ToolCall {
|
|
396
491
|
return create(ToolCallSchema, {
|
|
397
|
-
id: `tc-${name}
|
|
492
|
+
id: `tc-${name}`,
|
|
398
493
|
name,
|
|
399
494
|
result,
|
|
400
495
|
status: ToolCallStatus.TOOL_CALL_COMPLETED,
|
|
401
|
-
startedAt:
|
|
402
|
-
completedAt:
|
|
496
|
+
startedAt: SAMPLE_INSTANT,
|
|
497
|
+
completedAt: SAMPLE_TOOL_CALL_COMPLETED_AT,
|
|
403
498
|
});
|
|
404
499
|
},
|
|
405
500
|
|
|
406
|
-
/** A file artifact produced by an execution. */
|
|
501
|
+
/** A file artifact produced by an execution, stamped at {@link SAMPLE_INSTANT}. */
|
|
407
502
|
artifact(name: string, kind?: ExecutionArtifactKind): ExecutionArtifact {
|
|
408
503
|
return create(ExecutionArtifactSchema, {
|
|
409
504
|
name,
|
|
410
505
|
kind: kind ?? ExecutionArtifactKind.FILE,
|
|
411
506
|
storageKey: `demo-artifact-${name}`,
|
|
412
|
-
createdAt:
|
|
507
|
+
createdAt: SAMPLE_INSTANT,
|
|
413
508
|
});
|
|
414
509
|
},
|
|
415
510
|
|
|
@@ -17,6 +17,8 @@ export interface UseWorkflowCountOptions {
|
|
|
17
17
|
* @default "org"
|
|
18
18
|
*/
|
|
19
19
|
readonly scope?: ResourceListScope;
|
|
20
|
+
/** Opaque token that forces a recount when its value changes. */
|
|
21
|
+
readonly refetchToken?: unknown;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/** Return value of {@link useWorkflowCount}. */
|