@stigmer/react 3.2.2 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +6 -3
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/steps/ReviewStep.d.ts.map +1 -1
- package/agent/steps/ReviewStep.js +2 -3
- package/agent/steps/ReviewStep.js.map +1 -1
- package/billing/BaselineEditor.d.ts +9 -0
- package/billing/BaselineEditor.d.ts.map +1 -0
- package/billing/BaselineEditor.js +253 -0
- package/billing/BaselineEditor.js.map +1 -0
- package/billing/ModelCatalogPanel.d.ts +28 -0
- package/billing/ModelCatalogPanel.d.ts.map +1 -0
- package/billing/ModelCatalogPanel.js +102 -0
- package/billing/ModelCatalogPanel.js.map +1 -0
- package/billing/ModelGovernanceDetail.d.ts +8 -0
- package/billing/ModelGovernanceDetail.d.ts.map +1 -0
- package/billing/ModelGovernanceDetail.js +64 -0
- package/billing/ModelGovernanceDetail.js.map +1 -0
- package/billing/OperatorAccessNotice.d.ts +12 -0
- package/billing/OperatorAccessNotice.d.ts.map +1 -0
- package/billing/OperatorAccessNotice.js +15 -0
- package/billing/OperatorAccessNotice.js.map +1 -0
- package/billing/PricingGovernanceConsole.d.ts +57 -0
- package/billing/PricingGovernanceConsole.d.ts.map +1 -0
- package/billing/PricingGovernanceConsole.js +164 -0
- package/billing/PricingGovernanceConsole.js.map +1 -0
- package/billing/PricingGovernancePanel.d.ts +26 -0
- package/billing/PricingGovernancePanel.d.ts.map +1 -0
- package/billing/PricingGovernancePanel.js +64 -0
- package/billing/PricingGovernancePanel.js.map +1 -0
- package/billing/RetireConfirm.d.ts +9 -0
- package/billing/RetireConfirm.d.ts.map +1 -0
- package/billing/RetireConfirm.js +19 -0
- package/billing/RetireConfirm.js.map +1 -0
- package/billing/form-primitives.d.ts +18 -0
- package/billing/form-primitives.d.ts.map +1 -0
- package/billing/form-primitives.js +19 -0
- package/billing/form-primitives.js.map +1 -0
- package/billing/governance-primitives.d.ts +33 -0
- package/billing/governance-primitives.d.ts.map +1 -0
- package/billing/governance-primitives.js +43 -0
- package/billing/governance-primitives.js.map +1 -0
- package/billing/index.d.ts +18 -0
- package/billing/index.d.ts.map +1 -1
- package/billing/index.js +9 -0
- package/billing/index.js.map +1 -1
- package/billing/pricing-format.d.ts +12 -0
- package/billing/pricing-format.d.ts.map +1 -0
- package/billing/pricing-format.js +50 -0
- package/billing/pricing-format.js.map +1 -0
- package/billing/useDecidePricingOverride.d.ts +46 -0
- package/billing/useDecidePricingOverride.d.ts.map +1 -0
- package/billing/useDecidePricingOverride.js +44 -0
- package/billing/useDecidePricingOverride.js.map +1 -0
- package/billing/useModelGovernanceView.d.ts +103 -0
- package/billing/useModelGovernanceView.d.ts.map +1 -0
- package/billing/useModelGovernanceView.js +144 -0
- package/billing/useModelGovernanceView.js.map +1 -0
- package/billing/useModelPricingBaselines.d.ts +40 -0
- package/billing/useModelPricingBaselines.d.ts.map +1 -0
- package/billing/useModelPricingBaselines.js +32 -0
- package/billing/useModelPricingBaselines.js.map +1 -0
- package/billing/usePricingGovernance.d.ts +39 -0
- package/billing/usePricingGovernance.d.ts.map +1 -0
- package/billing/usePricingGovernance.js +31 -0
- package/billing/usePricingGovernance.js.map +1 -0
- package/billing/useRetireModelPricingBaseline.d.ts +31 -0
- package/billing/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/billing/useRetireModelPricingBaseline.js +36 -0
- package/billing/useRetireModelPricingBaseline.js.map +1 -0
- package/billing/useUpsertModelPricingBaseline.d.ts +38 -0
- package/billing/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/billing/useUpsertModelPricingBaseline.js +37 -0
- package/billing/useUpsertModelPricingBaseline.js.map +1 -0
- package/channel/AgentChannelsPanel.d.ts.map +1 -1
- package/channel/AgentChannelsPanel.js +11 -5
- package/channel/AgentChannelsPanel.js.map +1 -1
- package/composer/SessionComposer.d.ts +1 -1
- package/cursor-accounts/CursorAccountEditor.d.ts +28 -0
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountEditor.js +51 -0
- package/cursor-accounts/CursorAccountEditor.js.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts +28 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.js +275 -0
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
- package/cursor-accounts/cursor-account-format.d.ts +10 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-format.js +26 -0
- package/cursor-accounts/cursor-account-format.js.map +1 -0
- package/cursor-accounts/index.d.ts +18 -0
- package/cursor-accounts/index.d.ts.map +1 -0
- package/cursor-accounts/index.js +13 -0
- package/cursor-accounts/index.js.map +1 -0
- package/cursor-accounts/useCursorAccountView.d.ts +30 -0
- package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccountView.js +25 -0
- package/cursor-accounts/useCursorAccountView.js.map +1 -0
- package/cursor-accounts/useCursorAccounts.d.ts +33 -0
- package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccounts.js +25 -0
- package/cursor-accounts/useCursorAccounts.js.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
- package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.js +32 -0
- package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.js +31 -0
- package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.js +34 -0
- package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
- package/datastore/CollectionRecordsBrowser.d.ts +34 -0
- package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
- package/datastore/CollectionRecordsBrowser.js +209 -0
- package/datastore/CollectionRecordsBrowser.js.map +1 -0
- package/datastore/CollectionSchemaView.d.ts +29 -0
- package/datastore/CollectionSchemaView.d.ts.map +1 -0
- package/datastore/CollectionSchemaView.js +93 -0
- package/datastore/CollectionSchemaView.js.map +1 -0
- package/datastore/DatastoreDetailView.d.ts +44 -0
- package/datastore/DatastoreDetailView.d.ts.map +1 -0
- package/datastore/DatastoreDetailView.js +76 -0
- package/datastore/DatastoreDetailView.js.map +1 -0
- package/datastore/DatastoreSyncReport.d.ts +19 -0
- package/datastore/DatastoreSyncReport.d.ts.map +1 -0
- package/datastore/DatastoreSyncReport.js +45 -0
- package/datastore/DatastoreSyncReport.js.map +1 -0
- package/datastore/DeleteDatastoreDialog.d.ts +35 -0
- package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
- package/datastore/DeleteDatastoreDialog.js +90 -0
- package/datastore/DeleteDatastoreDialog.js.map +1 -0
- package/datastore/FieldValueControl.d.ts +55 -0
- package/datastore/FieldValueControl.d.ts.map +1 -0
- package/datastore/FieldValueControl.js +138 -0
- package/datastore/FieldValueControl.js.map +1 -0
- package/datastore/RecordFilterBuilder.d.ts +30 -0
- package/datastore/RecordFilterBuilder.d.ts.map +1 -0
- package/datastore/RecordFilterBuilder.js +122 -0
- package/datastore/RecordFilterBuilder.js.map +1 -0
- package/datastore/RecordFormPanel.d.ts +45 -0
- package/datastore/RecordFormPanel.d.ts.map +1 -0
- package/datastore/RecordFormPanel.js +215 -0
- package/datastore/RecordFormPanel.js.map +1 -0
- package/datastore/index.d.ts +43 -0
- package/datastore/index.d.ts.map +1 -0
- package/datastore/index.js +22 -0
- package/datastore/index.js.map +1 -0
- package/datastore/recordFilter.d.ts +54 -0
- package/datastore/recordFilter.d.ts.map +1 -0
- package/datastore/recordFilter.js +93 -0
- package/datastore/recordFilter.js.map +1 -0
- package/datastore/recordValues.d.ts +85 -0
- package/datastore/recordValues.d.ts.map +1 -0
- package/datastore/recordValues.js +282 -0
- package/datastore/recordValues.js.map +1 -0
- package/datastore/useDatastore.d.ts +39 -0
- package/datastore/useDatastore.d.ts.map +1 -0
- package/datastore/useDatastore.js +44 -0
- package/datastore/useDatastore.js.map +1 -0
- package/datastore/useDatastoreCount.d.ts +48 -0
- package/datastore/useDatastoreCount.d.ts.map +1 -0
- package/datastore/useDatastoreCount.js +27 -0
- package/datastore/useDatastoreCount.js.map +1 -0
- package/datastore/useDatastoreDescription.d.ts +54 -0
- package/datastore/useDatastoreDescription.d.ts.map +1 -0
- package/datastore/useDatastoreDescription.js +50 -0
- package/datastore/useDatastoreDescription.js.map +1 -0
- package/datastore/useDatastoreList.d.ts +57 -0
- package/datastore/useDatastoreList.d.ts.map +1 -0
- package/datastore/useDatastoreList.js +29 -0
- package/datastore/useDatastoreList.js.map +1 -0
- package/datastore/useDatastoreSearch.d.ts +19 -0
- package/datastore/useDatastoreSearch.d.ts.map +1 -0
- package/datastore/useDatastoreSearch.js +22 -0
- package/datastore/useDatastoreSearch.js.map +1 -0
- package/datastore/useDeleteDatastore.d.ts +53 -0
- package/datastore/useDeleteDatastore.d.ts.map +1 -0
- package/datastore/useDeleteDatastore.js +40 -0
- package/datastore/useDeleteDatastore.js.map +1 -0
- package/datastore/useDeleteRecord.d.ts +34 -0
- package/datastore/useDeleteRecord.d.ts.map +1 -0
- package/datastore/useDeleteRecord.js +43 -0
- package/datastore/useDeleteRecord.js.map +1 -0
- package/datastore/useInsertRecord.d.ts +50 -0
- package/datastore/useInsertRecord.d.ts.map +1 -0
- package/datastore/useInsertRecord.js +55 -0
- package/datastore/useInsertRecord.js.map +1 -0
- package/datastore/useRecordCollection.d.ts +104 -0
- package/datastore/useRecordCollection.d.ts.map +1 -0
- package/datastore/useRecordCollection.js +136 -0
- package/datastore/useRecordCollection.js.map +1 -0
- package/datastore/useRecordList.d.ts +66 -0
- package/datastore/useRecordList.d.ts.map +1 -0
- package/datastore/useRecordList.js +58 -0
- package/datastore/useRecordList.js.map +1 -0
- package/datastore/useUpdateRecord.d.ts +52 -0
- package/datastore/useUpdateRecord.d.ts.map +1 -0
- package/datastore/useUpdateRecord.js +55 -0
- package/datastore/useUpdateRecord.js.map +1 -0
- package/environment/EnvironmentListPanel.d.ts.map +1 -1
- package/environment/EnvironmentListPanel.js +12 -7
- package/environment/EnvironmentListPanel.js.map +1 -1
- package/execution/index.d.ts +1 -2
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +0 -1
- package/execution/index.js.map +1 -1
- package/execution/useLiveAgentExecution.d.ts +17 -1
- package/execution/useLiveAgentExecution.d.ts.map +1 -1
- package/execution/useLiveAgentExecution.js +19 -4
- package/execution/useLiveAgentExecution.js.map +1 -1
- package/iam-policy/index.d.ts +1 -1
- package/iam-policy/index.d.ts.map +1 -1
- package/iam-policy/index.js.map +1 -1
- package/iam-policy/useCheckPermission.d.ts +32 -11
- package/iam-policy/useCheckPermission.d.ts.map +1 -1
- package/iam-policy/useCheckPermission.js +24 -19
- package/iam-policy/useCheckPermission.js.map +1 -1
- package/index.d.ts +16 -10
- package/index.d.ts.map +1 -1
- package/index.js +16 -5
- package/index.js.map +1 -1
- package/internal/useInViewport.d.ts +24 -0
- package/internal/useInViewport.d.ts.map +1 -0
- package/internal/useInViewport.js +49 -0
- package/internal/useInViewport.js.map +1 -0
- package/library/VisibilitySelector.d.ts +22 -6
- package/library/VisibilitySelector.d.ts.map +1 -1
- package/library/VisibilitySelector.js +12 -4
- package/library/VisibilitySelector.js.map +1 -1
- package/library/index.d.ts +1 -8
- package/library/index.d.ts.map +1 -1
- package/library/index.js +0 -4
- package/library/index.js.map +1 -1
- package/library/useApplyResource.d.ts +12 -12
- package/library/useApplyResource.d.ts.map +1 -1
- package/library/useApplyResource.js +16 -25
- package/library/useApplyResource.js.map +1 -1
- package/library/useExportResource.d.ts +13 -9
- package/library/useExportResource.d.ts.map +1 -1
- package/library/useExportResource.js +18 -36
- package/library/useExportResource.js.map +1 -1
- package/manifest/ApplyManifestDialog.d.ts +48 -0
- package/manifest/ApplyManifestDialog.d.ts.map +1 -0
- package/manifest/ApplyManifestDialog.js +135 -0
- package/manifest/ApplyManifestDialog.js.map +1 -0
- package/manifest/EditResourceYamlDialog.d.ts +51 -0
- package/manifest/EditResourceYamlDialog.d.ts.map +1 -0
- package/manifest/EditResourceYamlDialog.js +104 -0
- package/manifest/EditResourceYamlDialog.js.map +1 -0
- package/manifest/RedactedSecretsNotice.d.ts +14 -0
- package/manifest/RedactedSecretsNotice.d.ts.map +1 -0
- package/manifest/RedactedSecretsNotice.js +14 -0
- package/manifest/RedactedSecretsNotice.js.map +1 -0
- package/manifest/YamlEditor.d.ts +44 -0
- package/manifest/YamlEditor.d.ts.map +1 -0
- package/manifest/YamlEditor.js +216 -0
- package/manifest/YamlEditor.js.map +1 -0
- package/manifest/index.d.ts +13 -0
- package/manifest/index.d.ts.map +1 -0
- package/manifest/index.js +13 -0
- package/manifest/index.js.map +1 -0
- package/manifest/useApplyManifest.d.ts +82 -0
- package/manifest/useApplyManifest.d.ts.map +1 -0
- package/manifest/useApplyManifest.js +180 -0
- package/manifest/useApplyManifest.js.map +1 -0
- package/manifest/useEditResourceYaml.d.ts +106 -0
- package/manifest/useEditResourceYaml.d.ts.map +1 -0
- package/manifest/useEditResourceYaml.js +168 -0
- package/manifest/useEditResourceYaml.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +4 -3
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
- package/mcp-server/steps/ReviewStep.js +2 -3
- package/mcp-server/steps/ReviewStep.js.map +1 -1
- package/package.json +4 -4
- package/resource-creation/templates/workflow-templates.js +4 -4
- package/session/SessionViewer.js +8 -1
- package/session/SessionViewer.js.map +1 -1
- package/session/audience.d.ts +6 -1
- package/session/audience.d.ts.map +1 -1
- package/session/useEditSessionPrep.js +3 -3
- package/session/useEditSessionPrep.js.map +1 -1
- package/settings/index.d.ts +2 -1
- package/settings/index.d.ts.map +1 -1
- package/settings/index.js +2 -1
- package/settings/index.js.map +1 -1
- package/settings/settings-nav.d.ts +22 -0
- package/settings/settings-nav.d.ts.map +1 -1
- package/settings/settings-nav.js +32 -1
- package/settings/settings-nav.js.map +1 -1
- package/settings/useSettingsNavGroups.d.ts +29 -0
- package/settings/useSettingsNavGroups.d.ts.map +1 -0
- package/settings/useSettingsNavGroups.js +61 -0
- package/settings/useSettingsNavGroups.js.map +1 -0
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +4 -3
- package/skill/SkillDetailView.js.map +1 -1
- package/src/access/__tests__/useManageAccess.test.tsx +104 -0
- package/src/agent/AgentDetailView.tsx +9 -3
- package/src/agent/steps/ReviewStep.tsx +2 -3
- package/src/billing/BaselineEditor.tsx +619 -0
- package/src/billing/ModelCatalogPanel.tsx +283 -0
- package/src/billing/ModelGovernanceDetail.tsx +289 -0
- package/src/billing/OperatorAccessNotice.tsx +32 -0
- package/src/billing/PricingGovernanceConsole.tsx +465 -0
- package/src/billing/PricingGovernancePanel.tsx +166 -0
- package/src/billing/RetireConfirm.tsx +82 -0
- package/src/billing/__tests__/ModelCatalogPanel.test.tsx +253 -0
- package/src/billing/__tests__/PricingGovernanceConsole.test.tsx +410 -0
- package/src/billing/__tests__/useModelGovernanceView.test.tsx +308 -0
- package/src/billing/form-primitives.tsx +68 -0
- package/src/billing/governance-primitives.tsx +133 -0
- package/src/billing/index.ts +37 -0
- package/src/billing/pricing-format.ts +53 -0
- package/src/billing/useDecidePricingOverride.ts +78 -0
- package/src/billing/useModelGovernanceView.ts +290 -0
- package/src/billing/useModelPricingBaselines.ts +69 -0
- package/src/billing/usePricingGovernance.ts +57 -0
- package/src/billing/useRetireModelPricingBaseline.ts +65 -0
- package/src/billing/useUpsertModelPricingBaseline.ts +72 -0
- package/src/channel/AgentChannelsPanel.tsx +27 -1
- package/src/composer/SessionComposer.tsx +1 -1
- package/src/cursor-accounts/CursorAccountEditor.tsx +181 -0
- package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
- package/src/cursor-accounts/CursorAccountsConsole.tsx +810 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +384 -0
- package/src/cursor-accounts/cursor-account-format.ts +29 -0
- package/src/cursor-accounts/index.ts +29 -0
- package/src/cursor-accounts/useCursorAccountView.ts +49 -0
- package/src/cursor-accounts/useCursorAccounts.ts +49 -0
- package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
- package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
- package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
- package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
- package/src/datastore/CollectionRecordsBrowser.tsx +544 -0
- package/src/datastore/CollectionSchemaView.tsx +247 -0
- package/src/datastore/DatastoreDetailView.tsx +201 -0
- package/src/datastore/DatastoreSyncReport.tsx +105 -0
- package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
- package/src/datastore/FieldValueControl.tsx +289 -0
- package/src/datastore/RecordFilterBuilder.tsx +411 -0
- package/src/datastore/RecordFormPanel.tsx +432 -0
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +207 -0
- package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
- package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +141 -0
- package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
- package/src/datastore/__tests__/recordFilter.test.ts +156 -0
- package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
- package/src/datastore/__tests__/recordValues.test.ts +359 -0
- package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
- package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
- package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
- package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
- package/src/datastore/index.ts +111 -0
- package/src/datastore/recordFilter.ts +140 -0
- package/src/datastore/recordValues.ts +327 -0
- package/src/datastore/useDatastore.ts +67 -0
- package/src/datastore/useDatastoreCount.ts +67 -0
- package/src/datastore/useDatastoreDescription.ts +90 -0
- package/src/datastore/useDatastoreList.ts +79 -0
- package/src/datastore/useDatastoreSearch.ts +39 -0
- package/src/datastore/useDeleteDatastore.ts +87 -0
- package/src/datastore/useDeleteRecord.ts +77 -0
- package/src/datastore/useInsertRecord.ts +92 -0
- package/src/datastore/useRecordCollection.ts +256 -0
- package/src/datastore/useRecordList.ts +131 -0
- package/src/datastore/useUpdateRecord.ts +95 -0
- package/src/environment/EnvironmentListPanel.tsx +24 -0
- package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
- package/src/execution/__tests__/useLiveAgentExecution.test.tsx +125 -0
- package/src/execution/index.ts +4 -7
- package/src/execution/useLiveAgentExecution.ts +41 -3
- package/src/iam-policy/__tests__/useCheckPermission.test.tsx +221 -0
- package/src/iam-policy/index.ts +1 -0
- package/src/iam-policy/useCheckPermission.ts +45 -19
- package/src/index.ts +167 -18
- package/src/internal/__tests__/useInViewport.test.tsx +115 -0
- package/src/internal/useInViewport.ts +63 -0
- package/src/library/VisibilitySelector.tsx +50 -9
- package/src/library/__tests__/VisibilitySelector.test.tsx +38 -0
- package/src/library/index.ts +4 -21
- package/src/library/useApplyResource.ts +27 -34
- package/src/library/useExportResource.ts +21 -40
- package/src/manifest/ApplyManifestDialog.tsx +315 -0
- package/src/manifest/EditResourceYamlDialog.tsx +265 -0
- package/src/manifest/RedactedSecretsNotice.tsx +30 -0
- package/src/manifest/YamlEditor.tsx +272 -0
- package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +118 -0
- package/src/manifest/__tests__/useApplyManifest.test.tsx +237 -0
- package/src/manifest/__tests__/useEditResourceYaml.test.tsx +252 -0
- package/src/manifest/index.ts +33 -0
- package/src/manifest/useApplyManifest.ts +270 -0
- package/src/manifest/useEditResourceYaml.ts +273 -0
- package/src/mcp-server/McpServerDetailView.tsx +7 -3
- package/src/mcp-server/steps/ReviewStep.tsx +2 -3
- package/src/resource-creation/templates/workflow-templates.ts +4 -4
- package/src/session/SessionViewer.tsx +7 -1
- package/src/session/__tests__/audienceWiring.test.tsx +31 -1
- package/src/session/audience.ts +6 -1
- package/src/session/useEditSessionPrep.ts +3 -3
- package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
- package/src/settings/index.ts +5 -1
- package/src/settings/settings-nav.ts +43 -0
- package/src/settings/useSettingsNavGroups.ts +81 -0
- package/src/skill/SkillDetailView.tsx +7 -3
- package/src/workflow/WorkflowAgentCallTranscript.tsx +279 -0
- package/src/workflow/WorkflowDetailView.tsx +7 -3
- package/src/workflow/WorkflowExecutionViewer.tsx +20 -77
- package/src/workflow/WorkflowTaskApprovalSummary.tsx +45 -8
- package/src/workflow/WorkflowYamlEditor.tsx +6 -270
- package/src/workflow/__tests__/WorkflowAgentCallTranscript.liveregion.test.tsx +124 -0
- package/src/workflow/__tests__/{WorkflowAgentExecutionDocument.test.tsx → WorkflowAgentCallTranscript.test.tsx} +146 -121
- package/src/workflow/__tests__/WorkflowExecutionViewer.approvals.test.tsx +81 -220
- package/src/workflow/__tests__/WorkflowExecutionViewer.reconciliation.test.tsx +17 -16
- package/src/workflow/__tests__/WorkflowTaskApprovalSummary.test.tsx +52 -2
- package/src/workflow/__tests__/WorkflowTaskThread.test.tsx +168 -185
- package/src/workflow/__tests__/agent-call-live-experience.test.ts +4 -4
- package/src/workflow/__tests__/task-approval.test.ts +119 -0
- package/src/workflow/__tests__/task-presentation.test.ts +35 -1
- package/src/workflow/__tests__/useWorkflowExecutionPanel.test.ts +0 -57
- package/src/workflow/index.ts +6 -3
- package/src/workflow/task-detail/index.ts +3 -0
- package/src/workflow/task-detail/task-approval.ts +95 -1
- package/src/workflow/thread/WorkflowTaskThread.tsx +96 -252
- package/src/workflow/thread/task-presentation.ts +8 -2
- package/src/workflow/useWorkflowExecutionPanel.ts +0 -47
- package/styles.css +1 -1
- package/workflow/CanvasTransitionEdge.d.ts +1 -1
- package/workflow/WorkflowAgentCallTranscript.d.ts +87 -0
- package/workflow/WorkflowAgentCallTranscript.d.ts.map +1 -0
- package/workflow/WorkflowAgentCallTranscript.js +98 -0
- package/workflow/WorkflowAgentCallTranscript.js.map +1 -0
- package/workflow/WorkflowDetailView.d.ts.map +1 -1
- package/workflow/WorkflowDetailView.js +4 -3
- package/workflow/WorkflowDetailView.js.map +1 -1
- package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
- package/workflow/WorkflowExecutionViewer.js +23 -52
- package/workflow/WorkflowExecutionViewer.js.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.js +18 -1
- package/workflow/WorkflowTaskApprovalSummary.js.map +1 -1
- package/workflow/WorkflowYamlEditor.d.ts +2 -42
- package/workflow/WorkflowYamlEditor.d.ts.map +1 -1
- package/workflow/WorkflowYamlEditor.js +5 -214
- package/workflow/WorkflowYamlEditor.js.map +1 -1
- package/workflow/index.d.ts +2 -2
- package/workflow/index.d.ts.map +1 -1
- package/workflow/index.js +2 -2
- package/workflow/index.js.map +1 -1
- package/workflow/task-detail/index.d.ts +1 -1
- package/workflow/task-detail/index.d.ts.map +1 -1
- package/workflow/task-detail/index.js +1 -1
- package/workflow/task-detail/index.js.map +1 -1
- package/workflow/task-detail/task-approval.d.ts +44 -1
- package/workflow/task-detail/task-approval.d.ts.map +1 -1
- package/workflow/task-detail/task-approval.js +47 -0
- package/workflow/task-detail/task-approval.js.map +1 -1
- package/workflow/thread/WorkflowTaskThread.d.ts +17 -25
- package/workflow/thread/WorkflowTaskThread.d.ts.map +1 -1
- package/workflow/thread/WorkflowTaskThread.js +60 -105
- package/workflow/thread/WorkflowTaskThread.js.map +1 -1
- package/workflow/thread/task-presentation.d.ts.map +1 -1
- package/workflow/thread/task-presentation.js +7 -2
- package/workflow/thread/task-presentation.js.map +1 -1
- package/workflow/useWorkflowExecutionPanel.d.ts +0 -12
- package/workflow/useWorkflowExecutionPanel.d.ts.map +1 -1
- package/workflow/useWorkflowExecutionPanel.js +0 -12
- package/workflow/useWorkflowExecutionPanel.js.map +1 -1
- package/execution/agent-execution-document.d.ts +0 -31
- package/execution/agent-execution-document.d.ts.map +0 -1
- package/execution/agent-execution-document.js +0 -48
- package/execution/agent-execution-document.js.map +0 -1
- package/library/ImportResourceDialog.d.ts +0 -43
- package/library/ImportResourceDialog.d.ts.map +0 -1
- package/library/ImportResourceDialog.js +0 -90
- package/library/ImportResourceDialog.js.map +0 -1
- package/library/parse-resource-yaml.d.ts +0 -63
- package/library/parse-resource-yaml.d.ts.map +0 -1
- package/library/parse-resource-yaml.js +0 -407
- package/library/parse-resource-yaml.js.map +0 -1
- package/library/serialize-resource-yaml.d.ts +0 -103
- package/library/serialize-resource-yaml.d.ts.map +0 -1
- package/library/serialize-resource-yaml.js +0 -565
- package/library/serialize-resource-yaml.js.map +0 -1
- package/library/useImportResource.d.ts +0 -84
- package/library/useImportResource.d.ts.map +0 -1
- package/library/useImportResource.js +0 -188
- package/library/useImportResource.js.map +0 -1
- package/src/execution/__tests__/agent-execution-document.test.ts +0 -45
- package/src/execution/agent-execution-document.ts +0 -54
- package/src/library/ImportResourceDialog.tsx +0 -227
- package/src/library/parse-resource-yaml.ts +0 -630
- package/src/library/serialize-resource-yaml.ts +0 -756
- package/src/library/useImportResource.ts +0 -253
- package/src/workflow/WorkflowAgentExecutionDocument.tsx +0 -283
- package/workflow/WorkflowAgentExecutionDocument.d.ts +0 -79
- package/workflow/WorkflowAgentExecutionDocument.d.ts.map +0 -1
- package/workflow/WorkflowAgentExecutionDocument.js +0 -87
- package/workflow/WorkflowAgentExecutionDocument.js.map +0 -1
|
@@ -1,630 +0,0 @@
|
|
|
1
|
-
import { parse as parseYaml } from "yaml";
|
|
2
|
-
import type {
|
|
3
|
-
AgentInput,
|
|
4
|
-
McpServerInput,
|
|
5
|
-
McpServerUsageInput,
|
|
6
|
-
ToolApprovalOverrideInput,
|
|
7
|
-
SubAgentInput,
|
|
8
|
-
McpAccessInput,
|
|
9
|
-
StdioServerConfigInput,
|
|
10
|
-
HttpServerConfigInput,
|
|
11
|
-
ToolApprovalPolicyInput,
|
|
12
|
-
ResourceRef,
|
|
13
|
-
} from "@stigmer/sdk";
|
|
14
|
-
import type { StigmerResourceKind } from "./detect-stigmer-resource.js";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Result of parsing a Stigmer resource YAML into an SDK input type.
|
|
18
|
-
*
|
|
19
|
-
* Discriminated on `kind` so consumers can narrow to the specific input:
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* const parsed = parseResourceYaml(content, "my-org");
|
|
23
|
-
* if (parsed.kind === "Agent") {
|
|
24
|
-
* // parsed.input is AgentInput
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export type ParsedResource =
|
|
29
|
-
| {
|
|
30
|
-
/** The parsed resource is an Agent blueprint. */
|
|
31
|
-
readonly kind: "Agent";
|
|
32
|
-
/** SDK input suitable for `stigmer.agent.apply()`. */
|
|
33
|
-
readonly input: AgentInput;
|
|
34
|
-
}
|
|
35
|
-
| {
|
|
36
|
-
/** The parsed resource is an MCP server definition. */
|
|
37
|
-
readonly kind: "McpServer";
|
|
38
|
-
/** SDK input suitable for `stigmer.mcpServer.apply()`. */
|
|
39
|
-
readonly input: McpServerInput;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Parses a Stigmer resource YAML string into the corresponding SDK input
|
|
44
|
-
* type for use with `stigmer.agent.apply()` or `stigmer.mcpServer.apply()`.
|
|
45
|
-
*
|
|
46
|
-
* Handles the conversion from proto-style snake_case YAML field names to
|
|
47
|
-
* the camelCase TypeScript SDK input types, including nested structures
|
|
48
|
-
* like `mcp_server_usages`, `sub_agents`, and `env`.
|
|
49
|
-
*
|
|
50
|
-
* The `org` parameter **always overrides** `metadata.org` in the YAML.
|
|
51
|
-
* This matches the UX intent of "Apply to [my-org]" — the user explicitly
|
|
52
|
-
* chooses the target organization.
|
|
53
|
-
*
|
|
54
|
-
* **Throws** with descriptive, user-facing error messages when the YAML
|
|
55
|
-
* is malformed or missing required fields. These messages are designed
|
|
56
|
-
* for display in error UI components.
|
|
57
|
-
*
|
|
58
|
-
* @param content - Raw YAML content string (typically from {@link useArtifactContent}).
|
|
59
|
-
* @param org - Target organization slug. Overrides `metadata.org` in the YAML.
|
|
60
|
-
* @returns A discriminated union with the parsed SDK input.
|
|
61
|
-
* @throws {Error} When the content is not valid YAML, not a recognized
|
|
62
|
-
* Stigmer resource, or is missing required fields.
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```ts
|
|
66
|
-
* import { parseResourceYaml } from "@stigmer/react";
|
|
67
|
-
*
|
|
68
|
-
* const parsed = parseResourceYaml(yamlContent, "my-org");
|
|
69
|
-
* if (parsed.kind === "Agent") {
|
|
70
|
-
* await stigmer.agent.apply(parsed.input);
|
|
71
|
-
* } else {
|
|
72
|
-
* await stigmer.mcpServer.apply(parsed.input);
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* @see {@link useApplyResource} for the React hook that wraps this function
|
|
77
|
-
* @see {@link detectStigmerResource} for lightweight detection without full parsing
|
|
78
|
-
*/
|
|
79
|
-
export function parseResourceYaml(
|
|
80
|
-
content: string,
|
|
81
|
-
org: string,
|
|
82
|
-
): ParsedResource {
|
|
83
|
-
const doc = parseYamlDocument(content);
|
|
84
|
-
const { kind, metadata, spec } = validateResourceStructure(doc);
|
|
85
|
-
|
|
86
|
-
const name = extractRequiredString(metadata, "name", "metadata.name");
|
|
87
|
-
const slug = extractOptionalString(metadata, "slug");
|
|
88
|
-
const labels = extractOptionalStringRecord(metadata, "labels");
|
|
89
|
-
|
|
90
|
-
switch (kind) {
|
|
91
|
-
case "Agent":
|
|
92
|
-
return {
|
|
93
|
-
kind: "Agent",
|
|
94
|
-
input: buildAgentInput(name, slug, org, labels, spec),
|
|
95
|
-
};
|
|
96
|
-
case "McpServer":
|
|
97
|
-
return {
|
|
98
|
-
kind: "McpServer",
|
|
99
|
-
input: buildMcpServerInput(name, slug, org, labels, spec),
|
|
100
|
-
};
|
|
101
|
-
default:
|
|
102
|
-
throw new Error(
|
|
103
|
-
`Unsupported resource kind: "${kind}". ` +
|
|
104
|
-
"Only Agent and McpServer can be applied from artifacts.",
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// ---------------------------------------------------------------------------
|
|
110
|
-
// YAML parsing
|
|
111
|
-
// ---------------------------------------------------------------------------
|
|
112
|
-
|
|
113
|
-
function parseYamlDocument(content: string): Record<string, unknown> {
|
|
114
|
-
let parsed: unknown;
|
|
115
|
-
try {
|
|
116
|
-
parsed = parseYaml(content);
|
|
117
|
-
} catch {
|
|
118
|
-
throw new Error("Failed to parse artifact content as YAML.");
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (!isPlainObject(parsed)) {
|
|
122
|
-
throw new Error(
|
|
123
|
-
"Failed to parse artifact content as YAML: expected a mapping document.",
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return parsed;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// ---------------------------------------------------------------------------
|
|
131
|
-
// Structure validation
|
|
132
|
-
// ---------------------------------------------------------------------------
|
|
133
|
-
|
|
134
|
-
interface ValidatedStructure {
|
|
135
|
-
readonly kind: string;
|
|
136
|
-
readonly metadata: Record<string, unknown>;
|
|
137
|
-
readonly spec: Record<string, unknown>;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const STIGMER_API_VERSION_PATTERN = /^[a-z]+\.stigmer\.ai\/v\d+$/;
|
|
141
|
-
|
|
142
|
-
const APPLICABLE_KINDS: ReadonlySet<string> = new Set<StigmerResourceKind>([
|
|
143
|
-
"Agent",
|
|
144
|
-
"McpServer",
|
|
145
|
-
]);
|
|
146
|
-
|
|
147
|
-
function validateResourceStructure(
|
|
148
|
-
doc: Record<string, unknown>,
|
|
149
|
-
): ValidatedStructure {
|
|
150
|
-
const apiVersion = doc.apiVersion ?? doc.api_version;
|
|
151
|
-
if (
|
|
152
|
-
typeof apiVersion !== "string" ||
|
|
153
|
-
!STIGMER_API_VERSION_PATTERN.test(apiVersion)
|
|
154
|
-
) {
|
|
155
|
-
throw new Error(
|
|
156
|
-
"Resource YAML is missing required field: apiVersion " +
|
|
157
|
-
"(expected pattern: *.stigmer.ai/v*).",
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const kind = doc.kind;
|
|
162
|
-
if (typeof kind !== "string" || kind.length === 0) {
|
|
163
|
-
throw new Error("Resource YAML is missing required field: kind.");
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (!APPLICABLE_KINDS.has(kind)) {
|
|
167
|
-
throw new Error(
|
|
168
|
-
`Unsupported resource kind: "${kind}". ` +
|
|
169
|
-
"Only Agent and McpServer can be applied from artifacts.",
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const metadata = doc.metadata;
|
|
174
|
-
if (!isPlainObject(metadata)) {
|
|
175
|
-
throw new Error("Resource YAML is missing required field: metadata.");
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const spec = doc.spec;
|
|
179
|
-
if (!isPlainObject(spec)) {
|
|
180
|
-
throw new Error("Resource YAML is missing required field: spec.");
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return { kind, metadata, spec };
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// ---------------------------------------------------------------------------
|
|
187
|
-
// Agent conversion
|
|
188
|
-
// ---------------------------------------------------------------------------
|
|
189
|
-
|
|
190
|
-
function buildAgentInput(
|
|
191
|
-
name: string,
|
|
192
|
-
slug: string | undefined,
|
|
193
|
-
org: string,
|
|
194
|
-
labels: Record<string, string> | undefined,
|
|
195
|
-
spec: Record<string, unknown>,
|
|
196
|
-
): AgentInput {
|
|
197
|
-
return {
|
|
198
|
-
name,
|
|
199
|
-
org,
|
|
200
|
-
...(slug !== undefined && { slug }),
|
|
201
|
-
...(labels !== undefined && { labels }),
|
|
202
|
-
...optionalString(spec, "description", "description"),
|
|
203
|
-
...optionalSnakeToCamel(spec, "icon_url", "iconUrl"),
|
|
204
|
-
...optionalString(spec, "instructions", "instructions"),
|
|
205
|
-
...optionalField("mcpServerUsages", extractMcpServerUsages(spec)),
|
|
206
|
-
...optionalField("skillRefs", extractResourceRefs(spec, "skill_refs")),
|
|
207
|
-
...optionalField("subAgents", extractSubAgents(spec)),
|
|
208
|
-
...optionalField("env", extractEnv(spec)),
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function extractMcpServerUsages(
|
|
213
|
-
spec: Record<string, unknown>,
|
|
214
|
-
): McpServerUsageInput[] | undefined {
|
|
215
|
-
const raw = spec.mcp_server_usages ?? spec.mcpServerUsages;
|
|
216
|
-
if (!Array.isArray(raw) || raw.length === 0) return undefined;
|
|
217
|
-
|
|
218
|
-
return raw.filter(isPlainObject).map(
|
|
219
|
-
(entry): McpServerUsageInput => {
|
|
220
|
-
const refObj = entry.mcp_server_ref ?? entry.mcpServerRef;
|
|
221
|
-
if (!isPlainObject(refObj)) {
|
|
222
|
-
throw new Error(
|
|
223
|
-
"Agent YAML: each mcp_server_usages entry must have a mcp_server_ref.",
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return {
|
|
228
|
-
mcpServerRef: extractResourceRef(refObj),
|
|
229
|
-
...optionalStringArray(entry, "enabled_tools", "enabledTools"),
|
|
230
|
-
...optionalMappedArray(
|
|
231
|
-
entry,
|
|
232
|
-
"tool_approval_overrides",
|
|
233
|
-
"toolApprovalOverrides",
|
|
234
|
-
extractToolApprovalOverride,
|
|
235
|
-
),
|
|
236
|
-
};
|
|
237
|
-
},
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function extractToolApprovalOverride(
|
|
242
|
-
raw: Record<string, unknown>,
|
|
243
|
-
): ToolApprovalOverrideInput {
|
|
244
|
-
return {
|
|
245
|
-
...optionalSnakeToCamel(raw, "tool_name", "toolName"),
|
|
246
|
-
...optionalSnakeToCamelBool(raw, "requires_approval", "requiresApproval"),
|
|
247
|
-
...optionalString(raw, "message", "message"),
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function extractSubAgents(
|
|
252
|
-
spec: Record<string, unknown>,
|
|
253
|
-
): SubAgentInput[] | undefined {
|
|
254
|
-
const raw = spec.sub_agents ?? spec.subAgents;
|
|
255
|
-
if (!Array.isArray(raw) || raw.length === 0) return undefined;
|
|
256
|
-
|
|
257
|
-
return raw.filter(isPlainObject).map((entry): SubAgentInput => {
|
|
258
|
-
const entryName = entry.name;
|
|
259
|
-
if (typeof entryName !== "string" || entryName.length === 0) {
|
|
260
|
-
throw new Error(
|
|
261
|
-
"Agent YAML: each sub_agents entry must have a non-empty name.",
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return {
|
|
266
|
-
name: entryName,
|
|
267
|
-
...optionalString(entry, "description", "description"),
|
|
268
|
-
...optionalString(entry, "instructions", "instructions"),
|
|
269
|
-
...optionalSnakeToCamel(entry, "model_override", "modelOverride"),
|
|
270
|
-
...optionalMappedArray(
|
|
271
|
-
entry,
|
|
272
|
-
"mcp_access",
|
|
273
|
-
"mcpAccess",
|
|
274
|
-
extractMcpAccess,
|
|
275
|
-
),
|
|
276
|
-
...optionalField(
|
|
277
|
-
"skillRefs",
|
|
278
|
-
extractResourceRefs(entry as Record<string, unknown>, "skill_refs"),
|
|
279
|
-
),
|
|
280
|
-
};
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
function extractMcpAccess(raw: Record<string, unknown>): McpAccessInput {
|
|
285
|
-
const mcpServer = raw.mcp_server ?? raw.mcpServer;
|
|
286
|
-
if (typeof mcpServer !== "string" || mcpServer.length === 0) {
|
|
287
|
-
throw new Error(
|
|
288
|
-
"Agent YAML: each mcp_access entry must have a non-empty mcp_server.",
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return {
|
|
293
|
-
mcpServer,
|
|
294
|
-
...optionalStringArray(raw, "enabled_tools", "enabledTools"),
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// ---------------------------------------------------------------------------
|
|
299
|
-
// McpServer conversion
|
|
300
|
-
// ---------------------------------------------------------------------------
|
|
301
|
-
|
|
302
|
-
function buildMcpServerInput(
|
|
303
|
-
name: string,
|
|
304
|
-
slug: string | undefined,
|
|
305
|
-
org: string,
|
|
306
|
-
labels: Record<string, string> | undefined,
|
|
307
|
-
spec: Record<string, unknown>,
|
|
308
|
-
): McpServerInput {
|
|
309
|
-
const stdio = extractStdioConfig(spec);
|
|
310
|
-
const http = extractHttpConfig(spec);
|
|
311
|
-
|
|
312
|
-
if (!stdio && !http) {
|
|
313
|
-
throw new Error(
|
|
314
|
-
"McpServer YAML must specify either spec.stdio or spec.http.",
|
|
315
|
-
);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return {
|
|
319
|
-
name,
|
|
320
|
-
org,
|
|
321
|
-
...(slug !== undefined && { slug }),
|
|
322
|
-
...(labels !== undefined && { labels }),
|
|
323
|
-
...optionalString(spec, "description", "description"),
|
|
324
|
-
...optionalSnakeToCamel(spec, "icon_url", "iconUrl"),
|
|
325
|
-
...optionalField("stdio", stdio),
|
|
326
|
-
...optionalField("http", http),
|
|
327
|
-
...optionalStringArrayFromSnake(spec, "default_enabled_tools", "defaultEnabledTools"),
|
|
328
|
-
...optionalMappedArray(
|
|
329
|
-
spec,
|
|
330
|
-
"pinned_tool_approvals",
|
|
331
|
-
"pinnedToolApprovals",
|
|
332
|
-
extractToolApprovalPolicy,
|
|
333
|
-
),
|
|
334
|
-
...optionalField("env", extractEnv(spec)),
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function extractStdioConfig(
|
|
339
|
-
spec: Record<string, unknown>,
|
|
340
|
-
): StdioServerConfigInput | undefined {
|
|
341
|
-
const raw = spec.stdio;
|
|
342
|
-
if (!isPlainObject(raw)) return undefined;
|
|
343
|
-
|
|
344
|
-
const command = raw.command;
|
|
345
|
-
if (typeof command !== "string" || command.length === 0) {
|
|
346
|
-
throw new Error(
|
|
347
|
-
"McpServer YAML: spec.stdio must have a non-empty command.",
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return {
|
|
352
|
-
command,
|
|
353
|
-
...optionalStringArray(raw, "args", "args"),
|
|
354
|
-
...optionalSnakeToCamel(raw, "working_dir", "workingDir"),
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function extractHttpConfig(
|
|
359
|
-
spec: Record<string, unknown>,
|
|
360
|
-
): HttpServerConfigInput | undefined {
|
|
361
|
-
const raw = spec.http;
|
|
362
|
-
if (!isPlainObject(raw)) return undefined;
|
|
363
|
-
|
|
364
|
-
const url = raw.url;
|
|
365
|
-
if (typeof url !== "string" || url.length === 0) {
|
|
366
|
-
throw new Error("McpServer YAML: spec.http must have a non-empty url.");
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
return {
|
|
370
|
-
url,
|
|
371
|
-
...optionalStringRecord(raw, "headers", "headers"),
|
|
372
|
-
...optionalStringRecordSnake(raw, "query_params", "queryParams"),
|
|
373
|
-
...optionalSnakeToCamelNumber(raw, "timeout_seconds", "timeoutSeconds"),
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
function extractToolApprovalPolicy(
|
|
378
|
-
raw: Record<string, unknown>,
|
|
379
|
-
): ToolApprovalPolicyInput {
|
|
380
|
-
return {
|
|
381
|
-
...optionalSnakeToCamel(raw, "tool_name", "toolName"),
|
|
382
|
-
...optionalString(raw, "message", "message"),
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
// ---------------------------------------------------------------------------
|
|
387
|
-
// Shared extractors
|
|
388
|
-
// ---------------------------------------------------------------------------
|
|
389
|
-
|
|
390
|
-
function extractEnv(
|
|
391
|
-
spec: Record<string, unknown>,
|
|
392
|
-
): Record<string, { isSecret?: boolean; description?: string; optional?: boolean }> | undefined {
|
|
393
|
-
// Support both new flat `env` and legacy nested `env_spec.data` / `envSpec.data`.
|
|
394
|
-
let envMap: Record<string, unknown> | undefined;
|
|
395
|
-
|
|
396
|
-
const envRaw = spec.env;
|
|
397
|
-
if (isPlainObject(envRaw)) {
|
|
398
|
-
envMap = envRaw;
|
|
399
|
-
} else {
|
|
400
|
-
const envSpecRaw = spec.env_spec ?? spec.envSpec;
|
|
401
|
-
if (isPlainObject(envSpecRaw)) {
|
|
402
|
-
const data = envSpecRaw.data ?? envSpecRaw.variables;
|
|
403
|
-
if (isPlainObject(data)) {
|
|
404
|
-
envMap = data;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (!envMap) return undefined;
|
|
410
|
-
|
|
411
|
-
const result: Record<string, { isSecret?: boolean; description?: string; optional?: boolean }> = {};
|
|
412
|
-
let hasEntries = false;
|
|
413
|
-
|
|
414
|
-
for (const [key, val] of Object.entries(envMap)) {
|
|
415
|
-
if (!isPlainObject(val)) continue;
|
|
416
|
-
|
|
417
|
-
const isSecret = val.is_secret ?? val.isSecret;
|
|
418
|
-
const description = val.description;
|
|
419
|
-
const optional = val.optional;
|
|
420
|
-
|
|
421
|
-
result[key] = {
|
|
422
|
-
...(typeof isSecret === "boolean" && { isSecret }),
|
|
423
|
-
...(typeof description === "string" && { description }),
|
|
424
|
-
...(typeof optional === "boolean" && { optional }),
|
|
425
|
-
};
|
|
426
|
-
hasEntries = true;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
return hasEntries ? result : undefined;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
function extractResourceRef(raw: Record<string, unknown>): ResourceRef {
|
|
433
|
-
const org = raw.org;
|
|
434
|
-
const slug = raw.slug;
|
|
435
|
-
|
|
436
|
-
if (typeof org !== "string" || org.length === 0) {
|
|
437
|
-
throw new Error("Resource reference must have a non-empty org.");
|
|
438
|
-
}
|
|
439
|
-
if (typeof slug !== "string" || slug.length === 0) {
|
|
440
|
-
throw new Error("Resource reference must have a non-empty slug.");
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
return {
|
|
444
|
-
org,
|
|
445
|
-
slug,
|
|
446
|
-
...(typeof raw.version === "string" &&
|
|
447
|
-
raw.version.length > 0 && { version: raw.version }),
|
|
448
|
-
...(typeof raw.kind === "number" && { kind: raw.kind }),
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
function extractResourceRefs(
|
|
453
|
-
container: Record<string, unknown>,
|
|
454
|
-
snakeKey: string,
|
|
455
|
-
): ResourceRef[] | undefined {
|
|
456
|
-
const camelKey = snakeToCamel(snakeKey);
|
|
457
|
-
const raw = container[snakeKey] ?? container[camelKey];
|
|
458
|
-
if (!Array.isArray(raw) || raw.length === 0) return undefined;
|
|
459
|
-
|
|
460
|
-
return raw.filter(isPlainObject).map(extractResourceRef);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// ---------------------------------------------------------------------------
|
|
464
|
-
// Field extraction helpers — return spreadable partials
|
|
465
|
-
// ---------------------------------------------------------------------------
|
|
466
|
-
|
|
467
|
-
function optionalField<K extends string, V>(
|
|
468
|
-
key: K,
|
|
469
|
-
value: V | undefined,
|
|
470
|
-
): { [P in K]: V } | undefined {
|
|
471
|
-
if (value === undefined) return undefined;
|
|
472
|
-
return { [key]: value } as { [P in K]: V };
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
function optionalString<K extends string>(
|
|
476
|
-
obj: Record<string, unknown>,
|
|
477
|
-
sourceKey: string,
|
|
478
|
-
targetKey: K,
|
|
479
|
-
): { [P in K]: string } | undefined {
|
|
480
|
-
const val = obj[sourceKey];
|
|
481
|
-
if (typeof val !== "string") return undefined;
|
|
482
|
-
return { [targetKey]: val } as { [P in K]: string };
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
function optionalSnakeToCamel<K extends string>(
|
|
486
|
-
obj: Record<string, unknown>,
|
|
487
|
-
snakeKey: string,
|
|
488
|
-
camelKey: K,
|
|
489
|
-
): { [P in K]: string } | undefined {
|
|
490
|
-
const val = obj[snakeKey] ?? obj[camelKey];
|
|
491
|
-
if (typeof val !== "string") return undefined;
|
|
492
|
-
return { [camelKey]: val } as { [P in K]: string };
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
function optionalSnakeToCamelBool<K extends string>(
|
|
496
|
-
obj: Record<string, unknown>,
|
|
497
|
-
snakeKey: string,
|
|
498
|
-
camelKey: K,
|
|
499
|
-
): { [P in K]: boolean } | undefined {
|
|
500
|
-
const val = obj[snakeKey] ?? obj[camelKey];
|
|
501
|
-
if (typeof val !== "boolean") return undefined;
|
|
502
|
-
return { [camelKey]: val } as { [P in K]: boolean };
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
function optionalSnakeToCamelNumber<K extends string>(
|
|
506
|
-
obj: Record<string, unknown>,
|
|
507
|
-
snakeKey: string,
|
|
508
|
-
camelKey: K,
|
|
509
|
-
): { [P in K]: number } | undefined {
|
|
510
|
-
const val = obj[snakeKey] ?? obj[camelKey];
|
|
511
|
-
if (typeof val !== "number" || !Number.isFinite(val)) return undefined;
|
|
512
|
-
return { [camelKey]: val } as { [P in K]: number };
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
function optionalStringArray<K extends string>(
|
|
516
|
-
obj: Record<string, unknown>,
|
|
517
|
-
sourceKey: string,
|
|
518
|
-
targetKey: K,
|
|
519
|
-
): { [P in K]: string[] } | undefined {
|
|
520
|
-
const val = obj[sourceKey] ?? obj[targetKey];
|
|
521
|
-
if (!Array.isArray(val)) return undefined;
|
|
522
|
-
const filtered = val.filter((v): v is string => typeof v === "string");
|
|
523
|
-
if (filtered.length === 0) return undefined;
|
|
524
|
-
return { [targetKey]: filtered } as { [P in K]: string[] };
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
function optionalStringArrayFromSnake<K extends string>(
|
|
528
|
-
obj: Record<string, unknown>,
|
|
529
|
-
snakeKey: string,
|
|
530
|
-
camelKey: K,
|
|
531
|
-
): { [P in K]: string[] } | undefined {
|
|
532
|
-
const val = obj[snakeKey] ?? obj[camelKey];
|
|
533
|
-
if (!Array.isArray(val)) return undefined;
|
|
534
|
-
const filtered = val.filter((v): v is string => typeof v === "string");
|
|
535
|
-
if (filtered.length === 0) return undefined;
|
|
536
|
-
return { [camelKey]: filtered } as { [P in K]: string[] };
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
function optionalStringRecord<K extends string>(
|
|
540
|
-
obj: Record<string, unknown>,
|
|
541
|
-
sourceKey: string,
|
|
542
|
-
targetKey: K,
|
|
543
|
-
): { [P in K]: Record<string, string> } | undefined {
|
|
544
|
-
const val = obj[sourceKey];
|
|
545
|
-
if (!isPlainObject(val)) return undefined;
|
|
546
|
-
return { [targetKey]: toStringRecord(val) } as {
|
|
547
|
-
[P in K]: Record<string, string>;
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
function optionalStringRecordSnake<K extends string>(
|
|
552
|
-
obj: Record<string, unknown>,
|
|
553
|
-
snakeKey: string,
|
|
554
|
-
camelKey: K,
|
|
555
|
-
): { [P in K]: Record<string, string> } | undefined {
|
|
556
|
-
const val = obj[snakeKey] ?? obj[camelKey];
|
|
557
|
-
if (!isPlainObject(val)) return undefined;
|
|
558
|
-
return { [camelKey]: toStringRecord(val) } as {
|
|
559
|
-
[P in K]: Record<string, string>;
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
function optionalMappedArray<K extends string, T>(
|
|
564
|
-
obj: Record<string, unknown>,
|
|
565
|
-
snakeKey: string,
|
|
566
|
-
camelKey: K,
|
|
567
|
-
mapper: (item: Record<string, unknown>) => T,
|
|
568
|
-
): { [P in K]: T[] } | undefined {
|
|
569
|
-
const raw = obj[snakeKey] ?? obj[camelKey];
|
|
570
|
-
if (!Array.isArray(raw) || raw.length === 0) return undefined;
|
|
571
|
-
const mapped = raw.filter(isPlainObject).map(mapper);
|
|
572
|
-
if (mapped.length === 0) return undefined;
|
|
573
|
-
return { [camelKey]: mapped } as { [P in K]: T[] };
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
// ---------------------------------------------------------------------------
|
|
577
|
-
// Primitive helpers
|
|
578
|
-
// ---------------------------------------------------------------------------
|
|
579
|
-
|
|
580
|
-
function extractRequiredString(
|
|
581
|
-
obj: Record<string, unknown>,
|
|
582
|
-
key: string,
|
|
583
|
-
displayPath: string,
|
|
584
|
-
): string {
|
|
585
|
-
const val = obj[key];
|
|
586
|
-
if (typeof val !== "string" || val.length === 0) {
|
|
587
|
-
throw new Error(
|
|
588
|
-
`Resource YAML is missing required field: ${displayPath}.`,
|
|
589
|
-
);
|
|
590
|
-
}
|
|
591
|
-
return val;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
function extractOptionalString(
|
|
595
|
-
obj: Record<string, unknown>,
|
|
596
|
-
key: string,
|
|
597
|
-
): string | undefined {
|
|
598
|
-
const val = obj[key];
|
|
599
|
-
return typeof val === "string" && val.length > 0 ? val : undefined;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
function extractOptionalStringRecord(
|
|
603
|
-
obj: Record<string, unknown>,
|
|
604
|
-
key: string,
|
|
605
|
-
): Record<string, string> | undefined {
|
|
606
|
-
const val = obj[key];
|
|
607
|
-
if (!isPlainObject(val)) return undefined;
|
|
608
|
-
return toStringRecord(val);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
// ---------------------------------------------------------------------------
|
|
612
|
-
// Utilities
|
|
613
|
-
// ---------------------------------------------------------------------------
|
|
614
|
-
|
|
615
|
-
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
616
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
function toStringRecord(obj: Record<string, unknown>): Record<string, string> {
|
|
620
|
-
const result: Record<string, string> = {};
|
|
621
|
-
for (const [k, v] of Object.entries(obj)) {
|
|
622
|
-
if (typeof v === "string") result[k] = v;
|
|
623
|
-
else if (v !== null && v !== undefined) result[k] = String(v);
|
|
624
|
-
}
|
|
625
|
-
return result;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
function snakeToCamel(key: string): string {
|
|
629
|
-
return key.replace(/_([a-z])/g, (_, c: string) => c.toUpperCase());
|
|
630
|
-
}
|