@opensoha/contracts 0.1.4
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/COMPATIBILITY.md +306 -0
- package/LICENSE +201 -0
- package/README.md +224 -0
- package/agent/agent-checkpoint.schema.json +19 -0
- package/agent/agent-observation.schema.json +20 -0
- package/agent/agent-protocol.schema.json +717 -0
- package/agent/agent-provider-definition.schema.json +44 -0
- package/agent/agent-provider-registry.schema.json +25 -0
- package/agent/agent-provider-runtime-event.schema.json +26 -0
- package/agent/agent-run-step.schema.json +24 -0
- package/agent/conformance-run.schema.json +19 -0
- package/agent/environment-lease.schema.json +31 -0
- package/agent/environment-snapshot.schema.json +26 -0
- package/agent/environment-template.schema.json +19 -0
- package/agent/fleet-target.schema.json +15 -0
- package/agent/multi-agent-plan.schema.json +18 -0
- package/agent/provider-rollout.schema.json +19 -0
- package/apiresponse/response.go +25 -0
- package/apiresponse/response_test.go +27 -0
- package/auth/token-claims.schema.json +78 -0
- package/capabilities/cluster-capability-matrix.schema.json +87 -0
- package/compat/json-schema-ecosystem-0.1.0.json +59 -0
- package/compat/openapi-0.1.0.snapshot.json +5076 -0
- package/compat/openapi-loose-boundaries-0.1.0.json +769 -0
- package/connectors/connector-event-envelope.schema.json +64 -0
- package/evaluation/evaluation-dataset.schema.json +28 -0
- package/evaluation/evaluation-result.schema.json +18 -0
- package/evaluation/evaluation-run.schema.json +19 -0
- package/evaluation/executor-profile.schema.json +18 -0
- package/evaluation/feedback-sample.schema.json +20 -0
- package/evaluation/gate-decision.schema.json +20 -0
- package/evaluation/gate-policy.schema.json +18 -0
- package/evaluation/replay-plan.schema.json +17 -0
- package/evaluation/sample-attempt.schema.json +22 -0
- package/events/event-envelope.schema.json +58 -0
- package/examples/agent-profile/k8s-sre-readonly.json +16 -0
- package/examples/cluster-capability-matrix/runtime-parity.json +40 -0
- package/examples/connector-event-envelope/feishu-message.json +19 -0
- package/examples/gateway-capability-baseline/minimal.json +61 -0
- package/examples/gateway-manifest/minimal.json +72 -0
- package/examples/governance/approval-request.json +35 -0
- package/examples/governance/audit-log.json +14 -0
- package/examples/marketplace-catalog/default.json +75 -0
- package/examples/mcp-preset/k8s-readonly.json +20 -0
- package/examples/openapi/agent-run-tool-call-request.json +11 -0
- package/examples/openapi/agent-tool-call-result-envelope.json +19 -0
- package/examples/openapi/cloud-extension-point-list-envelope.json +15 -0
- package/examples/openapi/directory-runtime-status-envelope.json +31 -0
- package/examples/openapi/gateway-manifest-envelope.json +53 -0
- package/examples/openapi/tool-invocation-request.json +14 -0
- package/examples/openapi/tool-invocation-result-envelope.json +23 -0
- package/examples/plugin-manifest/compute-provider.json +27 -0
- package/examples/plugin-manifest/connector.json +76 -0
- package/examples/plugin-manifest/skill-pack.json +47 -0
- package/examples/runner-operation-lifecycle/late-callback.json +27 -0
- package/examples/skill-manifest/k8s-sre.json +22 -0
- package/examples/token-claims/service-account.json +15 -0
- package/fixtures/json-schema/agent-checkpoint/invalid/raw-state.json +1 -0
- package/fixtures/json-schema/agent-checkpoint/valid/minimal.json +1 -0
- package/fixtures/json-schema/agent-observation/invalid/extra-secret.json +1 -0
- package/fixtures/json-schema/agent-observation/valid/tool.json +1 -0
- package/fixtures/json-schema/agent-profile/invalid/missing-scope.json +15 -0
- package/fixtures/json-schema/agent-profile/valid/k8s-sre-readonly.json +35 -0
- package/fixtures/json-schema/agent-protocol/invalid/missing-agent-id.json +3 -0
- package/fixtures/json-schema/agent-protocol/valid/agent-run-callback-legacy.json +9 -0
- package/fixtures/json-schema/agent-protocol/valid/agent-run-callback-with-events.json +39 -0
- package/fixtures/json-schema/agent-protocol/valid/execution-task-claim.json +5 -0
- package/fixtures/json-schema/agent-provider-definition/invalid/missing-command.json +1 -0
- package/fixtures/json-schema/agent-provider-definition/valid/cli.json +1 -0
- package/fixtures/json-schema/agent-provider-registry/invalid/zero-revision.json +1 -0
- package/fixtures/json-schema/agent-provider-registry/valid/minimal.json +1 -0
- package/fixtures/json-schema/agent-provider-runtime-event/invalid/health-without-provider.json +1 -0
- package/fixtures/json-schema/agent-provider-runtime-event/valid/ack.json +1 -0
- package/fixtures/json-schema/agent-run-step/invalid/unknown-state.json +1 -0
- package/fixtures/json-schema/agent-run-step/valid/running.json +1 -0
- package/fixtures/json-schema/approval-request/invalid/missing-status.json +12 -0
- package/fixtures/json-schema/approval-request/valid/high-risk-tool.json +56 -0
- package/fixtures/json-schema/audit-log/invalid/extra-field.json +10 -0
- package/fixtures/json-schema/audit-log/valid/tool-denied.json +23 -0
- package/fixtures/json-schema/cluster-capability-matrix/invalid/missing-agent-support.json +16 -0
- package/fixtures/json-schema/cluster-capability-matrix/invalid/partial-without-reason.json +18 -0
- package/fixtures/json-schema/cluster-capability-matrix/valid/runtime-parity.json +59 -0
- package/fixtures/json-schema/conformance-run/invalid/missing.json +1 -0
- package/fixtures/json-schema/conformance-run/valid/passed.json +1 -0
- package/fixtures/json-schema/connector-checkpoint/invalid/missing.json +1 -0
- package/fixtures/json-schema/connector-checkpoint/valid/http.json +1 -0
- package/fixtures/json-schema/connector-definition/invalid/missing.json +1 -0
- package/fixtures/json-schema/connector-definition/valid/http.json +1 -0
- package/fixtures/json-schema/connector-event-envelope/invalid/missing-payload.json +11 -0
- package/fixtures/json-schema/connector-event-envelope/invalid/unknown-top-level-field.json +13 -0
- package/fixtures/json-schema/connector-event-envelope/valid/feishu-message.json +19 -0
- package/fixtures/json-schema/context-envelope/invalid/envelope.json +1 -0
- package/fixtures/json-schema/context-envelope/valid/envelope.json +1 -0
- package/fixtures/json-schema/environment-lease/invalid/unbounded.json +1 -0
- package/fixtures/json-schema/environment-lease/valid/observe.json +1 -0
- package/fixtures/json-schema/environment-snapshot/invalid/negative-usage.json +1 -0
- package/fixtures/json-schema/environment-snapshot/valid/active.json +1 -0
- package/fixtures/json-schema/environment-template/invalid/missing.json +1 -0
- package/fixtures/json-schema/environment-template/valid/container.json +1 -0
- package/fixtures/json-schema/evaluation-dataset/invalid/no-samples.json +1 -0
- package/fixtures/json-schema/evaluation-dataset/valid/minimal.json +1 -0
- package/fixtures/json-schema/evaluation-result/invalid/bad-score.json +1 -0
- package/fixtures/json-schema/evaluation-result/valid/passed.json +1 -0
- package/fixtures/json-schema/evaluation-run/invalid/no-candidate.json +1 -0
- package/fixtures/json-schema/evaluation-run/valid/running.json +1 -0
- package/fixtures/json-schema/event-envelope/invalid/bad-severity.json +7 -0
- package/fixtures/json-schema/event-envelope/valid/minimal.json +14 -0
- package/fixtures/json-schema/executor-profile/invalid/missing.json +1 -0
- package/fixtures/json-schema/executor-profile/valid/readonly.json +1 -0
- package/fixtures/json-schema/feedback-sample/invalid/missing.json +1 -0
- package/fixtures/json-schema/feedback-sample/valid/pending.json +1 -0
- package/fixtures/json-schema/fleet-target/invalid/missing.json +1 -0
- package/fixtures/json-schema/fleet-target/valid/linux.json +1 -0
- package/fixtures/json-schema/gate-decision/invalid/missing.json +1 -0
- package/fixtures/json-schema/gate-decision/valid/pass.json +1 -0
- package/fixtures/json-schema/gate-policy/invalid/missing.json +1 -0
- package/fixtures/json-schema/gate-policy/valid/release.json +1 -0
- package/fixtures/json-schema/gateway-capability-baseline/invalid/missing-owner.json +32 -0
- package/fixtures/json-schema/gateway-capability-baseline/valid/minimal.json +61 -0
- package/fixtures/json-schema/gateway-manifest/invalid/bad-risk-level.json +37 -0
- package/fixtures/json-schema/gateway-manifest/valid/minimal.json +48 -0
- package/fixtures/json-schema/graph-revision/invalid/missing.json +1 -0
- package/fixtures/json-schema/graph-revision/valid/active.json +1 -0
- package/fixtures/json-schema/index-publish/invalid/missing.json +1 -0
- package/fixtures/json-schema/index-publish/valid/publish.json +1 -0
- package/fixtures/json-schema/ingestion-job/invalid/missing.json +1 -0
- package/fixtures/json-schema/ingestion-job/valid/queued.json +1 -0
- package/fixtures/json-schema/ingestion-stage/invalid/missing.json +1 -0
- package/fixtures/json-schema/ingestion-stage/valid/succeeded.json +1 -0
- package/fixtures/json-schema/knowledge-base/invalid/base.json +1 -0
- package/fixtures/json-schema/knowledge-base/valid/base.json +1 -0
- package/fixtures/json-schema/knowledge-search/invalid/search.json +1 -0
- package/fixtures/json-schema/knowledge-search/valid/search.json +1 -0
- package/fixtures/json-schema/knowledge-source/invalid/source.json +1 -0
- package/fixtures/json-schema/knowledge-source/valid/source.json +1 -0
- package/fixtures/json-schema/marketplace-catalog/invalid/missing-source.json +5 -0
- package/fixtures/json-schema/marketplace-catalog/valid/minimal.json +44 -0
- package/fixtures/json-schema/mcp-preset/invalid/bad-risk-level.json +20 -0
- package/fixtures/json-schema/mcp-preset/valid/k8s-readonly.json +40 -0
- package/fixtures/json-schema/memory-policy/invalid/missing.json +1 -0
- package/fixtures/json-schema/memory-policy/valid/explicit.json +1 -0
- package/fixtures/json-schema/memory-record/invalid/missing.json +1 -0
- package/fixtures/json-schema/memory-record/valid/explicit.json +1 -0
- package/fixtures/json-schema/multi-agent-plan/invalid/missing.json +1 -0
- package/fixtures/json-schema/multi-agent-plan/valid/running.json +1 -0
- package/fixtures/json-schema/observability-log-query-v1/invalid/missing-query.json +6 -0
- package/fixtures/json-schema/observability-log-query-v1/valid/request.json +15 -0
- package/fixtures/json-schema/observability-log-query-v1/valid/response.json +13 -0
- package/fixtures/json-schema/plugin-manifest/invalid/bad-type.json +7 -0
- package/fixtures/json-schema/plugin-manifest/invalid/logs-query-without-action.json +28 -0
- package/fixtures/json-schema/plugin-manifest/invalid/manifest-only-observability-provider.json +26 -0
- package/fixtures/json-schema/plugin-manifest/invalid/manifest-only-read-provider.json +23 -0
- package/fixtures/json-schema/plugin-manifest/invalid/write-provider-without-actions.json +23 -0
- package/fixtures/json-schema/plugin-manifest/valid/compute-provider.json +25 -0
- package/fixtures/json-schema/plugin-manifest/valid/minimal.json +14 -0
- package/fixtures/json-schema/plugin-manifest/valid/observability-provider.json +29 -0
- package/fixtures/json-schema/project-manifest/invalid/inline-secret.json +14 -0
- package/fixtures/json-schema/project-manifest/valid/demo.json +21 -0
- package/fixtures/json-schema/provider-rollout/invalid/missing.json +1 -0
- package/fixtures/json-schema/provider-rollout/valid/canary.json +1 -0
- package/fixtures/json-schema/replay-plan/invalid/missing.json +1 -0
- package/fixtures/json-schema/replay-plan/valid/readonly.json +1 -0
- package/fixtures/json-schema/retrieval-trace/invalid/missing.json +1 -0
- package/fixtures/json-schema/retrieval-trace/valid/grounded.json +1 -0
- package/fixtures/json-schema/runner-operation-lifecycle/invalid/bad-state.json +7 -0
- package/fixtures/json-schema/runner-operation-lifecycle/invalid/missing-runner-id.json +6 -0
- package/fixtures/json-schema/runner-operation-lifecycle/valid/final-failed.json +27 -0
- package/fixtures/json-schema/runner-operation-lifecycle/valid/heartbeat.json +19 -0
- package/fixtures/json-schema/sample-attempt/invalid/missing.json +1 -0
- package/fixtures/json-schema/sample-attempt/valid/completed.json +1 -0
- package/fixtures/json-schema/skill-manifest/invalid/bad-id.json +5 -0
- package/fixtures/json-schema/skill-manifest/valid/minimal.json +8 -0
- package/fixtures/json-schema/token-claims/invalid/bad-token-kind.json +9 -0
- package/fixtures/json-schema/token-claims/valid/service-account.json +15 -0
- package/fixtures/openapi/AIGatewayManifestEnvelope/invalid/bad-date.json +28 -0
- package/fixtures/openapi/AIGatewayManifestEnvelope/valid/minimal.json +31 -0
- package/fixtures/openapi/AgentProviderRegistryAcknowledgement/invalid/missing-targeted.json +7 -0
- package/fixtures/openapi/AgentProviderRegistryAcknowledgement/valid/rollout.json +17 -0
- package/fixtures/openapi/AgentRunCallbackRequest/invalid/missing-agent-id.json +6 -0
- package/fixtures/openapi/AgentRunCallbackRequest/valid/succeeded.json +10 -0
- package/fixtures/openapi/AgentRunCallbackRequest/valid/with-events.json +39 -0
- package/fixtures/openapi/AuthResultEnvelope/invalid/missing-tokens.json +13 -0
- package/fixtures/openapi/AuthResultEnvelope/valid/session.json +20 -0
- package/fixtures/openapi/CloudExtensionPointListEnvelope/invalid/missing-exclusions.json +11 -0
- package/fixtures/openapi/CloudExtensionPointListEnvelope/valid/managed-fleet.json +19 -0
- package/fixtures/openapi/ComputeAccessSourceListEnvelope/invalid/bad-source-type.json +15 -0
- package/fixtures/openapi/ComputeAccessSourceListEnvelope/valid/mixed.json +19 -0
- package/fixtures/openapi/ComputeOverviewEnvelope/invalid/bad-section-status.json +9 -0
- package/fixtures/openapi/ComputeOverviewEnvelope/valid/partial.json +33 -0
- package/fixtures/openapi/ComputeProviderListEnvelope/invalid/bad-domain.json +23 -0
- package/fixtures/openapi/ComputeProviderListEnvelope/valid/builtin.json +30 -0
- package/fixtures/openapi/ComputeResourceRelationListEnvelope/invalid/bad-relation.json +29 -0
- package/fixtures/openapi/ComputeResourceRelationListEnvelope/valid/vm-runtime.json +33 -0
- package/fixtures/openapi/ComputeTaskListEnvelope/invalid/missing-source-id.json +19 -0
- package/fixtures/openapi/ComputeTaskListEnvelope/valid/running.json +30 -0
- package/fixtures/openapi/DeliveryDraftInput/invalid/missing-application-key.json +9 -0
- package/fixtures/openapi/DeliveryDraftInput/valid/ai-service.json +25 -0
- package/fixtures/openapi/DirectoryEventListEnvelope/invalid/unknown-status.json +13 -0
- package/fixtures/openapi/DirectoryEventListEnvelope/valid/failed.json +16 -0
- package/fixtures/openapi/DirectoryPersonLifecycle/invalid/unknown-employment-status.json +5 -0
- package/fixtures/openapi/DirectoryPersonLifecycle/valid/departed.json +6 -0
- package/fixtures/openapi/DirectoryRuntimeStatusEnvelope/invalid/negative-event-count.json +11 -0
- package/fixtures/openapi/DirectoryRuntimeStatusEnvelope/valid/verified.json +14 -0
- package/fixtures/openapi/DockerContainerStartInput/invalid/missing-image.json +8 -0
- package/fixtures/openapi/DockerContainerStartInput/valid/git-dockerfile.json +22 -0
- package/fixtures/openapi/DockerOperationCallbackRequest/invalid/logs-not-array.json +7 -0
- package/fixtures/openapi/DockerOperationCallbackRequest/valid/succeeded.json +9 -0
- package/fixtures/openapi/ErrorEnvelope/invalid/extra-field.json +7 -0
- package/fixtures/openapi/ErrorEnvelope/valid/error.json +7 -0
- package/fixtures/openapi/EvaluationGateRequest/invalid/missing-candidate.json +4 -0
- package/fixtures/openapi/EvaluationGateRequest/valid/candidate.json +5 -0
- package/fixtures/openapi/ExecutionCallbackRequest/invalid/extra-field.json +6 -0
- package/fixtures/openapi/ExecutionCallbackRequest/valid/succeeded.json +7 -0
- package/fixtures/openapi/GovernanceStatusEnvelope/invalid/window-hours-string.json +81 -0
- package/fixtures/openapi/GovernanceStatusEnvelope/valid/minimal.json +81 -0
- package/fixtures/openapi/IdentityErrorEnvelope/invalid/raw-assertion.json +7 -0
- package/fixtures/openapi/IdentityErrorEnvelope/valid/invalid-signature.json +7 -0
- package/fixtures/openapi/IdentityOutpostClaimRequest/invalid/missing-protocol-version.json +4 -0
- package/fixtures/openapi/IdentityOutpostClaimRequest/valid/current-version.json +5 -0
- package/fixtures/openapi/IdentityRuntimeCapabilityEnvelope/invalid/missing-runtime-state.json +17 -0
- package/fixtures/openapi/IdentityRuntimeCapabilityEnvelope/valid/available.json +17 -0
- package/fixtures/openapi/KnowledgeIngestionJobInput/invalid/missing-source.json +1 -0
- package/fixtures/openapi/KnowledgeIngestionJobInput/valid/source.json +3 -0
- package/fixtures/openapi/KubernetesResourceAgentCreateRequest/invalid/unresolved-target.json +18 -0
- package/fixtures/openapi/KubernetesResourceAgentCreateRequest/valid/resolved-target.json +25 -0
- package/fixtures/openapi/KubernetesResourceCreateRequest/invalid/unknown-source.json +5 -0
- package/fixtures/openapi/KubernetesResourceCreateRequest/valid/global-multi-document.json +5 -0
- package/fixtures/openapi/KubernetesResourceCreateResultEnvelope/invalid/bad-document-index.json +21 -0
- package/fixtures/openapi/KubernetesResourceCreateResultEnvelope/valid/partial.json +62 -0
- package/fixtures/openapi/KubernetesResourceCreateScopeDecisionEnvelope/invalid/missing-capability.json +12 -0
- package/fixtures/openapi/KubernetesResourceCreateScopeDecisionEnvelope/valid/allowed.json +17 -0
- package/fixtures/openapi/KubernetesResourcePreflightEnvelope/invalid/warning-without-message.json +32 -0
- package/fixtures/openapi/KubernetesResourcePreflightEnvelope/valid/mixed-diagnostics.json +83 -0
- package/fixtures/openapi/LogPage/invalid/missing-entry-source.json +12 -0
- package/fixtures/openapi/LogPage/valid/partial-runtime.json +42 -0
- package/fixtures/openapi/LogQuery/invalid/missing-selector.json +3 -0
- package/fixtures/openapi/LogQuery/invalid/unknown-source-mode.json +6 -0
- package/fixtures/openapi/LogQuery/valid/docker-project.json +12 -0
- package/fixtures/openapi/LogQuery/valid/runtime-workload.json +21 -0
- package/fixtures/openapi/LogStreamEvent/invalid/missing-entry.json +3 -0
- package/fixtures/openapi/LogStreamEvent/invalid/unknown-event-type.json +3 -0
- package/fixtures/openapi/LogStreamEvent/valid/live-entry.json +16 -0
- package/fixtures/openapi/MCPCapabilityListEnvelope/invalid/missing-scopes.json +9 -0
- package/fixtures/openapi/MCPCapabilityListEnvelope/valid/minimal.json +10 -0
- package/fixtures/openapi/MFAAdminResetRequest/invalid/missing-reason.json +3 -0
- package/fixtures/openapi/MFAAdminResetRequest/valid/security-incident.json +4 -0
- package/fixtures/openapi/MFAWebAuthnRequestOptionsEnvelope/invalid/missing-challenge-id.json +9 -0
- package/fixtures/openapi/MFAWebAuthnRequestOptionsEnvelope/valid/step-up.json +11 -0
- package/fixtures/openapi/ManifestDeploymentEnvelope/invalid/bad-condition-status.json +33 -0
- package/fixtures/openapi/ManifestDeploymentEnvelope/valid/converged.json +36 -0
- package/fixtures/openapi/ManifestSourceUpdateInput/invalid/unknown-mode.json +6 -0
- package/fixtures/openapi/ManifestSourceUpdateInput/valid/soha-managed.json +6 -0
- package/fixtures/openapi/ObservabilityDataSource/valid/healthy.json +33 -0
- package/fixtures/openapi/ObservabilityDataSourceInput/invalid/secret-in-config.json +9 -0
- package/fixtures/openapi/ObservabilityDataSourceInput/valid/loki.json +33 -0
- package/fixtures/openapi/ObservabilityDataSourceInput/valid/provider.json +21 -0
- package/fixtures/openapi/PasswordLoginRequest/invalid/extra-field.json +5 -0
- package/fixtures/openapi/PasswordLoginRequest/valid/password-login.json +4 -0
- package/fixtures/openapi/PersonalAccessTokenInput/invalid/extra-field.json +6 -0
- package/fixtures/openapi/PersonalAccessTokenInput/valid/create.json +9 -0
- package/fixtures/openapi/PluginManifest/invalid/bad-type.json +7 -0
- package/fixtures/openapi/PluginManifest/valid/skill-pack.json +12 -0
- package/fixtures/openapi/RepositoryInput/invalid/embedded-token.json +8 -0
- package/fixtures/openapi/RepositoryInput/valid/gitlab.json +11 -0
- package/fixtures/openapi/RuntimeConfigChangeRequest/invalid/missing-version.json +8 -0
- package/fixtures/openapi/RuntimeConfigChangeRequest/valid/feature-flags.json +14 -0
- package/fixtures/openapi/RuntimeConfigSnapshotEnvelope/invalid/editable-secret.json +17 -0
- package/fixtures/openapi/RuntimeConfigSnapshotEnvelope/invalid/exposed-default-secret.json +18 -0
- package/fixtures/openapi/RuntimeConfigSnapshotEnvelope/invalid/exposed-effective-secret.json +18 -0
- package/fixtures/openapi/RuntimeConfigSnapshotEnvelope/valid/effective.json +34 -0
- package/fixtures/openapi/SAMLMetadataInput/invalid/unknown-source.json +4 -0
- package/fixtures/openapi/SAMLMetadataInput/valid/xml.json +4 -0
- package/fixtures/openapi/SecretCreateRequest/invalid/missing-value.json +5 -0
- package/fixtures/openapi/SecretCreateRequest/valid/create.json +13 -0
- package/fixtures/openapi/SecretLeaseRedemptionEnvelope/invalid/invalid-alias.json +9 -0
- package/fixtures/openapi/SecretLeaseRedemptionEnvelope/valid/redeem.json +9 -0
- package/fixtures/openapi/SecretMetadataEnvelope/invalid/plaintext-value.json +15 -0
- package/fixtures/openapi/SecretMetadataEnvelope/valid/metadata.json +20 -0
- package/fixtures/openapi/SecretRotateRequest/invalid/empty-value.json +3 -0
- package/fixtures/openapi/SecretRotateRequest/valid/rotate.json +3 -0
- package/fixtures/openapi/ServiceAccountInput/invalid/missing-status.json +4 -0
- package/fixtures/openapi/ServiceAccountInput/valid/create.json +8 -0
- package/fixtures/openapi/WorkbenchStreamEvent/invalid/extra-field.json +11 -0
- package/fixtures/openapi/WorkbenchStreamEvent/invalid/missing-server-fields.json +5 -0
- package/fixtures/openapi/WorkbenchStreamEvent/valid/message-done.json +13 -0
- package/gen/go/sohaapi/client.go +989 -0
- package/gen/go/sohaapi/client_test.go +2127 -0
- package/gen/go/sohaapi/types.go +21450 -0
- package/gen/ts/sohaapi/index.ts +22869 -0
- package/go.mod +18 -0
- package/go.sum +46 -0
- package/governance/approval-request.schema.json +187 -0
- package/governance/audit-log.schema.json +37 -0
- package/helmrelease/release.go +108 -0
- package/helmrelease/release_test.go +9 -0
- package/knowledge/connector-checkpoint.schema.json +16 -0
- package/knowledge/connector-definition.schema.json +18 -0
- package/knowledge/context-envelope.schema.json +32 -0
- package/knowledge/graph-revision.schema.json +21 -0
- package/knowledge/index-publish.schema.json +17 -0
- package/knowledge/ingestion-job.schema.json +22 -0
- package/knowledge/ingestion-stage.schema.json +19 -0
- package/knowledge/knowledge-base.schema.json +48 -0
- package/knowledge/knowledge-search.schema.json +21 -0
- package/knowledge/knowledge-source.schema.json +28 -0
- package/knowledge/retrieval-trace.schema.json +21 -0
- package/mcp/gateway-capability-baseline.schema.json +290 -0
- package/mcp/gateway-manifest.schema.json +210 -0
- package/memory/memory-policy.schema.json +19 -0
- package/memory/memory-record.schema.json +25 -0
- package/openapi/soha-api.json +42282 -0
- package/openapi/soha-api.yaml +21748 -0
- package/openapi/spec_generated.go +23 -0
- package/openapi/spec_test.go +38 -0
- package/package.json +122 -0
- package/plugins/marketplace-catalog.schema.json +120 -0
- package/plugins/observability-log-query-v1.schema.json +88 -0
- package/plugins/plugin-manifest.schema.json +498 -0
- package/presets/mcp-preset.schema.json +142 -0
- package/profiles/agent-profile.schema.json +154 -0
- package/resource/crd_definition.go +10 -0
- package/resource/gateway_details_test.go +55 -0
- package/resource/models.go +1587 -0
- package/resource/models_test.go +72 -0
- package/runner/operation-lifecycle.schema.json +112 -0
- package/skills/skill-manifest.schema.json +64 -0
- package/streamlimit/limited_buffer.go +58 -0
- package/streamlimit/limited_buffer_test.go +38 -0
package/go.mod
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module github.com/opensoha/soha-contracts
|
|
2
|
+
|
|
3
|
+
go 1.26.5
|
|
4
|
+
|
|
5
|
+
require (
|
|
6
|
+
github.com/oapi-codegen/runtime v1.4.2
|
|
7
|
+
sigs.k8s.io/yaml v1.5.0
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
require (
|
|
11
|
+
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
|
|
12
|
+
github.com/google/go-cmp v0.7.0 // indirect
|
|
13
|
+
github.com/google/uuid v1.6.0 // indirect
|
|
14
|
+
github.com/kr/pretty v0.3.1 // indirect
|
|
15
|
+
github.com/rogpeppe/go-internal v1.13.1 // indirect
|
|
16
|
+
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
|
17
|
+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
|
18
|
+
)
|
package/go.sum
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
|
|
2
|
+
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
|
|
3
|
+
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
|
|
4
|
+
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
|
|
5
|
+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
|
6
|
+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
7
|
+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
8
|
+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
9
|
+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
|
10
|
+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
|
11
|
+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
|
12
|
+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
|
13
|
+
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
|
|
14
|
+
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
|
15
|
+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
|
16
|
+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
|
17
|
+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
18
|
+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|
19
|
+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
|
20
|
+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
|
21
|
+
github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs=
|
|
22
|
+
github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY=
|
|
23
|
+
github.com/oapi-codegen/runtime v1.4.2 h1:GMxFVYLzoYLua+/KvzgSphkyK1lLTReQI9Vf4hvATKE=
|
|
24
|
+
github.com/oapi-codegen/runtime v1.4.2/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU=
|
|
25
|
+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
|
26
|
+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
27
|
+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
|
28
|
+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
|
29
|
+
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
|
30
|
+
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
|
31
|
+
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
|
|
32
|
+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
33
|
+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
|
34
|
+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
|
35
|
+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
|
36
|
+
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
|
|
37
|
+
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
|
|
38
|
+
go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE=
|
|
39
|
+
go.yaml.in/yaml/v3 v3.0.3/go.mod h1:tBHosrYAkRZjRAOREWbDnBXUf08JOwYq++0QNwQiWzI=
|
|
40
|
+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
41
|
+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
|
42
|
+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
|
43
|
+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
|
44
|
+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
45
|
+
sigs.k8s.io/yaml v1.5.0 h1:M10b2U7aEUY6hRtU870n2VTPgR5RZiL/I6Lcc2F4NUQ=
|
|
46
|
+
sigs.k8s.io/yaml v1.5.0/go.mod h1:wZs27Rbxoai4C0f8/9urLZtZtF3avA3gKvGyPdDqTO4=
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://contracts.opensoha.dev/governance/approval-request.schema.json",
|
|
4
|
+
"title": "OpenSoha Approval Request",
|
|
5
|
+
"description": "Public approval request, trace, decision, stage, and timeline event contract for high-risk Gateway and platform operations.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"id",
|
|
10
|
+
"status",
|
|
11
|
+
"strategy",
|
|
12
|
+
"actorType",
|
|
13
|
+
"actorId",
|
|
14
|
+
"toolName",
|
|
15
|
+
"riskLevel",
|
|
16
|
+
"requiresApproval",
|
|
17
|
+
"summary",
|
|
18
|
+
"createdAt",
|
|
19
|
+
"updatedAt"
|
|
20
|
+
],
|
|
21
|
+
"properties": {
|
|
22
|
+
"id": { "type": "string", "minLength": 1 },
|
|
23
|
+
"status": { "type": "string", "minLength": 1 },
|
|
24
|
+
"strategy": { "type": "string", "minLength": 1 },
|
|
25
|
+
"policyId": { "type": "string" },
|
|
26
|
+
"approvalPolicyRef": { "type": "string" },
|
|
27
|
+
"actorType": { "type": "string", "minLength": 1 },
|
|
28
|
+
"actorId": { "type": "string", "minLength": 1 },
|
|
29
|
+
"actorName": { "type": "string" },
|
|
30
|
+
"actorRoles": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": { "type": "string" }
|
|
33
|
+
},
|
|
34
|
+
"actorTeams": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": { "type": "string" }
|
|
37
|
+
},
|
|
38
|
+
"aiClientId": { "type": "string" },
|
|
39
|
+
"aiClientName": { "type": "string" },
|
|
40
|
+
"skillId": { "type": "string" },
|
|
41
|
+
"toolName": { "type": "string", "minLength": 1 },
|
|
42
|
+
"riskLevel": { "$ref": "#/$defs/RiskLevel" },
|
|
43
|
+
"requiresApproval": { "type": "boolean" },
|
|
44
|
+
"resourceScope": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": true
|
|
47
|
+
},
|
|
48
|
+
"toolInput": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": true
|
|
51
|
+
},
|
|
52
|
+
"relatedIds": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": true
|
|
55
|
+
},
|
|
56
|
+
"approvalTrace": { "$ref": "#/$defs/ApprovalTrace" },
|
|
57
|
+
"timelineEvents": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": { "$ref": "#/$defs/ApprovalTimelineEvent" }
|
|
60
|
+
},
|
|
61
|
+
"output": {},
|
|
62
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
63
|
+
"requestId": { "type": "string" },
|
|
64
|
+
"sourceIp": { "type": "string" },
|
|
65
|
+
"decidedBy": { "type": "string" },
|
|
66
|
+
"decidedByName": { "type": "string" },
|
|
67
|
+
"decidedAt": { "type": "string", "format": "date-time" },
|
|
68
|
+
"decisionComment": { "type": "string" },
|
|
69
|
+
"expiresAt": { "type": "string", "format": "date-time" },
|
|
70
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
71
|
+
"updatedAt": { "type": "string", "format": "date-time" }
|
|
72
|
+
},
|
|
73
|
+
"$defs": {
|
|
74
|
+
"RiskLevel": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"enum": ["read", "analyze", "mutate", "execute", "high"]
|
|
77
|
+
},
|
|
78
|
+
"ApprovalTrace": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"properties": {
|
|
82
|
+
"approvalMode": { "type": "string" },
|
|
83
|
+
"currentStageIndex": { "type": "integer" },
|
|
84
|
+
"currentStageName": { "type": "string" },
|
|
85
|
+
"stageCount": { "type": "integer" },
|
|
86
|
+
"approvedCount": { "type": "integer" },
|
|
87
|
+
"requiredApprovals": { "type": "integer" },
|
|
88
|
+
"pendingRequirements": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": { "type": "string" }
|
|
91
|
+
},
|
|
92
|
+
"satisfiedRequirements": {
|
|
93
|
+
"type": "array",
|
|
94
|
+
"items": { "type": "string" }
|
|
95
|
+
},
|
|
96
|
+
"roleApprovedCounts": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": { "type": "integer" }
|
|
99
|
+
},
|
|
100
|
+
"teamApprovedCounts": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": { "type": "integer" }
|
|
103
|
+
},
|
|
104
|
+
"candidateUserIds": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"items": { "type": "string" }
|
|
107
|
+
},
|
|
108
|
+
"candidateRoles": {
|
|
109
|
+
"type": "array",
|
|
110
|
+
"items": { "type": "string" }
|
|
111
|
+
},
|
|
112
|
+
"candidateTeams": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"items": { "type": "string" }
|
|
115
|
+
},
|
|
116
|
+
"onCallCandidateUserIds": {
|
|
117
|
+
"type": "array",
|
|
118
|
+
"items": { "type": "string" }
|
|
119
|
+
},
|
|
120
|
+
"workflowRunId": { "type": "string" },
|
|
121
|
+
"executionTaskId": { "type": "string" },
|
|
122
|
+
"releaseBundleId": { "type": "string" },
|
|
123
|
+
"decisions": {
|
|
124
|
+
"type": "array",
|
|
125
|
+
"items": { "$ref": "#/$defs/ApprovalDecisionTrace" }
|
|
126
|
+
},
|
|
127
|
+
"stageHistory": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": { "$ref": "#/$defs/ApprovalStageTrace" }
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"ApprovalDecisionTrace": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"additionalProperties": false,
|
|
136
|
+
"properties": {
|
|
137
|
+
"userId": { "type": "string" },
|
|
138
|
+
"userName": { "type": "string" },
|
|
139
|
+
"roles": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"items": { "type": "string" }
|
|
142
|
+
},
|
|
143
|
+
"teams": {
|
|
144
|
+
"type": "array",
|
|
145
|
+
"items": { "type": "string" }
|
|
146
|
+
},
|
|
147
|
+
"result": { "type": "string" },
|
|
148
|
+
"comment": { "type": "string" },
|
|
149
|
+
"stageIndex": { "type": "integer" },
|
|
150
|
+
"stageName": { "type": "string" },
|
|
151
|
+
"decidedAt": { "type": "string", "format": "date-time" }
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"ApprovalStageTrace": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"additionalProperties": false,
|
|
157
|
+
"properties": {
|
|
158
|
+
"stageIndex": { "type": "integer" },
|
|
159
|
+
"stageName": { "type": "string" },
|
|
160
|
+
"result": { "type": "string" },
|
|
161
|
+
"completedAt": { "type": "string", "format": "date-time" }
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"ApprovalTimelineEvent": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"required": ["id", "kind", "action", "result", "createdAt"],
|
|
168
|
+
"properties": {
|
|
169
|
+
"id": { "type": "string", "minLength": 1 },
|
|
170
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
171
|
+
"action": { "type": "string", "minLength": 1 },
|
|
172
|
+
"result": { "type": "string", "minLength": 1 },
|
|
173
|
+
"summary": { "type": "string" },
|
|
174
|
+
"actorType": { "type": "string" },
|
|
175
|
+
"actorId": { "type": "string" },
|
|
176
|
+
"actorName": { "type": "string" },
|
|
177
|
+
"stageIndex": { "type": "integer" },
|
|
178
|
+
"stageName": { "type": "string" },
|
|
179
|
+
"metadata": {
|
|
180
|
+
"type": "object",
|
|
181
|
+
"additionalProperties": true
|
|
182
|
+
},
|
|
183
|
+
"createdAt": { "type": "string", "format": "date-time" }
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://contracts.opensoha.dev/governance/audit-log.schema.json",
|
|
4
|
+
"title": "OpenSoha Audit Log",
|
|
5
|
+
"description": "Public audit log contract for Gateway, platform, connector, plugin, skill, and Cloud extension point actions.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["id", "actorType", "actorId", "action", "result", "summary", "createdAt"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": { "type": "string", "minLength": 1 },
|
|
11
|
+
"actorType": { "type": "string", "minLength": 1 },
|
|
12
|
+
"actorId": { "type": "string", "minLength": 1 },
|
|
13
|
+
"actorName": { "type": "string" },
|
|
14
|
+
"aiClientId": { "type": "string" },
|
|
15
|
+
"aiClientName": { "type": "string" },
|
|
16
|
+
"skillId": { "type": "string" },
|
|
17
|
+
"toolName": { "type": "string" },
|
|
18
|
+
"riskLevel": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["read", "analyze", "mutate", "execute", "high"]
|
|
21
|
+
},
|
|
22
|
+
"resourceScope": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": true
|
|
25
|
+
},
|
|
26
|
+
"action": { "type": "string", "minLength": 1 },
|
|
27
|
+
"result": { "type": "string", "minLength": 1 },
|
|
28
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
29
|
+
"requestId": { "type": "string" },
|
|
30
|
+
"sourceIp": { "type": "string" },
|
|
31
|
+
"metadata": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": true
|
|
34
|
+
},
|
|
35
|
+
"createdAt": { "type": "string", "format": "date-time" }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
package helmrelease
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"bytes"
|
|
5
|
+
"compress/gzip"
|
|
6
|
+
"crypto/sha256"
|
|
7
|
+
"encoding/base64"
|
|
8
|
+
"encoding/hex"
|
|
9
|
+
"encoding/json"
|
|
10
|
+
"io"
|
|
11
|
+
"strings"
|
|
12
|
+
"time"
|
|
13
|
+
|
|
14
|
+
"sigs.k8s.io/yaml"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
var gzipMagicHeader = []byte{0x1f, 0x8b, 0x08}
|
|
18
|
+
|
|
19
|
+
type Release struct {
|
|
20
|
+
Name string `json:"name,omitempty"`
|
|
21
|
+
Info *Info `json:"info,omitempty"`
|
|
22
|
+
Chart *Chart `json:"chart,omitempty"`
|
|
23
|
+
Config map[string]any `json:"config,omitempty"`
|
|
24
|
+
Manifest string `json:"manifest,omitempty"`
|
|
25
|
+
Version int `json:"version,omitempty"`
|
|
26
|
+
Namespace string `json:"namespace,omitempty"`
|
|
27
|
+
Labels map[string]string `json:"-"`
|
|
28
|
+
Raw map[string]any `json:"-"`
|
|
29
|
+
Hooks []map[string]any `json:"hooks,omitempty"`
|
|
30
|
+
Meta map[string]interface{} `json:"-"`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type Info struct {
|
|
34
|
+
FirstDeployed time.Time `json:"first_deployed,omitempty"`
|
|
35
|
+
LastDeployed time.Time `json:"last_deployed,omitempty"`
|
|
36
|
+
Deleted time.Time `json:"deleted,omitempty"`
|
|
37
|
+
Description string `json:"description,omitempty"`
|
|
38
|
+
Status string `json:"status,omitempty"`
|
|
39
|
+
Notes string `json:"notes,omitempty"`
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type Chart struct {
|
|
43
|
+
Metadata *ChartMetadata `json:"metadata,omitempty"`
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type ChartMetadata struct {
|
|
47
|
+
Name string `json:"name,omitempty"`
|
|
48
|
+
Version string `json:"version,omitempty"`
|
|
49
|
+
AppVersion string `json:"appVersion,omitempty"`
|
|
50
|
+
Description string `json:"description,omitempty"`
|
|
51
|
+
Annotations map[string]string `json:"annotations,omitempty"`
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
func Decode(encoded string, labels map[string]string) (*Release, error) {
|
|
55
|
+
decodedBytes, err := base64.StdEncoding.DecodeString(encoded)
|
|
56
|
+
if err != nil {
|
|
57
|
+
return nil, err
|
|
58
|
+
}
|
|
59
|
+
if len(decodedBytes) > 3 && bytes.Equal(decodedBytes[:3], gzipMagicHeader) {
|
|
60
|
+
reader, err := gzip.NewReader(bytes.NewReader(decodedBytes))
|
|
61
|
+
if err != nil {
|
|
62
|
+
return nil, err
|
|
63
|
+
}
|
|
64
|
+
defer func() { _ = reader.Close() }()
|
|
65
|
+
uncompressed, err := io.ReadAll(reader)
|
|
66
|
+
if err != nil {
|
|
67
|
+
return nil, err
|
|
68
|
+
}
|
|
69
|
+
decodedBytes = uncompressed
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var release Release
|
|
73
|
+
if err := json.Unmarshal(decodedBytes, &release); err != nil {
|
|
74
|
+
return nil, err
|
|
75
|
+
}
|
|
76
|
+
release.Labels = cloneStringMap(labels)
|
|
77
|
+
return &release, nil
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
func ValuesYAML(release *Release) (string, error) {
|
|
81
|
+
if release == nil || len(release.Config) == 0 {
|
|
82
|
+
return "{}\n", nil
|
|
83
|
+
}
|
|
84
|
+
content, err := yaml.Marshal(release.Config)
|
|
85
|
+
if err != nil {
|
|
86
|
+
return "", err
|
|
87
|
+
}
|
|
88
|
+
return string(content), nil
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
func Digest(content string) string {
|
|
92
|
+
if strings.TrimSpace(content) == "" {
|
|
93
|
+
return ""
|
|
94
|
+
}
|
|
95
|
+
sum := sha256.Sum256([]byte(content))
|
|
96
|
+
return hex.EncodeToString(sum[:])
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
func cloneStringMap(values map[string]string) map[string]string {
|
|
100
|
+
if len(values) == 0 {
|
|
101
|
+
return nil
|
|
102
|
+
}
|
|
103
|
+
cloned := make(map[string]string, len(values))
|
|
104
|
+
for key, value := range values {
|
|
105
|
+
cloned[key] = value
|
|
106
|
+
}
|
|
107
|
+
return cloned
|
|
108
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/connector-checkpoint.schema.json",
|
|
4
|
+
"title": "Knowledge Connector Checkpoint",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "sourceId", "connectorVersion", "cursor", "configHash", "committedAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": "opensoha.dev/knowledge-connector-checkpoint/v1" },
|
|
10
|
+
"sourceId": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
11
|
+
"connectorVersion": { "type": "string", "minLength": 1, "maxLength": 64 },
|
|
12
|
+
"cursor": { "type": "object", "maxProperties": 32, "additionalProperties": true },
|
|
13
|
+
"configHash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
14
|
+
"committedAt": { "type": "string", "format": "date-time" }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/connector-definition.schema.json",
|
|
4
|
+
"title": "Knowledge Connector Definition",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "id", "kind", "version", "configRef", "enabled"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": "opensoha.dev/knowledge-connector-definition/v1" },
|
|
10
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
11
|
+
"kind": { "enum": ["http", "git", "object-store"] },
|
|
12
|
+
"version": { "type": "string", "minLength": 1, "maxLength": 64 },
|
|
13
|
+
"configRef": { "type": "string", "pattern": "^secret:[^\\s]{1,240}$" },
|
|
14
|
+
"allowedHosts": { "type": "array", "maxItems": 64, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 253 } },
|
|
15
|
+
"pathPrefixes": { "type": "array", "maxItems": 64, "uniqueItems": true, "items": { "type": "string", "maxLength": 1024 } },
|
|
16
|
+
"enabled": { "type": "boolean" }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/context-envelope.schema.json",
|
|
4
|
+
"title": "Context Envelope",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["version", "id", "requestId", "principal", "task", "budgets", "budgetUsage", "policySnapshot", "contentHash", "createdAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"version": { "const": "v1" },
|
|
10
|
+
"id": { "type": "string", "minLength": 1 },
|
|
11
|
+
"requestId": { "type": "string", "minLength": 1 },
|
|
12
|
+
"sessionId": { "type": "string" },
|
|
13
|
+
"agentRunId": { "type": "string" },
|
|
14
|
+
"principal": { "type": "object", "additionalProperties": false, "required": ["userId"], "properties": { "userId": { "type": "string", "minLength": 1 } } },
|
|
15
|
+
"task": { "type": "object", "additionalProperties": false, "required": ["goal"], "properties": { "mode": { "type": "string" }, "goal": { "type": "string", "minLength": 1 } } },
|
|
16
|
+
"prompt": { "$ref": "#/$defs/versionRef" },
|
|
17
|
+
"skills": { "type": "array", "items": { "$ref": "#/$defs/versionRef" } },
|
|
18
|
+
"session": { "type": "object" },
|
|
19
|
+
"evidence": { "type": "array", "items": { "type": "object", "required": ["citationId", "content", "tokenCount"], "properties": { "citationId": { "type": "string" }, "content": { "type": "string" }, "tokenCount": { "type": "integer", "minimum": 0 } } } },
|
|
20
|
+
"citations": { "type": "array", "items": { "type": "object" } },
|
|
21
|
+
"tools": { "type": "array", "items": { "type": "object" } },
|
|
22
|
+
"environment": { "type": "object" },
|
|
23
|
+
"budgets": { "type": "object" },
|
|
24
|
+
"budgetUsage": { "type": "object" },
|
|
25
|
+
"policySnapshot": { "$ref": "#/$defs/versionRef" },
|
|
26
|
+
"contentHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
27
|
+
"createdAt": { "type": "string", "format": "date-time" }
|
|
28
|
+
},
|
|
29
|
+
"$defs": {
|
|
30
|
+
"versionRef": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "version": { "type": "string" } } }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/graph-revision.schema.json",
|
|
4
|
+
"title": "Knowledge Graph Revision",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "id", "knowledgeBaseId", "sourceIndexRef", "extractorVersion", "status", "entityCount", "relationCount", "createdAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": "opensoha.dev/knowledge-graph-revision/v1" },
|
|
10
|
+
"id": { "type": "string", "minLength": 1 },
|
|
11
|
+
"knowledgeBaseId": { "type": "string", "minLength": 1 },
|
|
12
|
+
"sourceIndexRef": { "type": "string", "minLength": 1 },
|
|
13
|
+
"extractorVersion": { "type": "string", "minLength": 1 },
|
|
14
|
+
"status": { "enum": ["building", "verified", "active", "failed", "superseded"] },
|
|
15
|
+
"entityCount": { "type": "integer", "minimum": 0 },
|
|
16
|
+
"relationCount": { "type": "integer", "minimum": 0 },
|
|
17
|
+
"provenanceRoot": { "type": "string" },
|
|
18
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
19
|
+
"publishedAt": { "type": "string", "format": "date-time" }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/index-publish.schema.json",
|
|
4
|
+
"title": "Knowledge Index Publish Decision",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "knowledgeBaseId", "revisionId", "expectedActiveRevision", "decision", "decidedAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": "opensoha.dev/knowledge-index-publish/v1" },
|
|
10
|
+
"knowledgeBaseId": { "type": "string", "minLength": 1 },
|
|
11
|
+
"revisionId": { "type": "string", "minLength": 1 },
|
|
12
|
+
"expectedActiveRevision": { "type": "string" },
|
|
13
|
+
"decision": { "enum": ["publish", "reject", "rollback"] },
|
|
14
|
+
"verificationRefs": { "type": "array", "maxItems": 64, "items": { "type": "string" } },
|
|
15
|
+
"decidedAt": { "type": "string", "format": "date-time" }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/ingestion-job.schema.json",
|
|
4
|
+
"title": "Knowledge Ingestion Job",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "id", "sourceId", "targetRevision", "stage", "status", "attempt", "createdAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": "opensoha.dev/knowledge-ingestion-job/v1" },
|
|
10
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
11
|
+
"sourceId": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
12
|
+
"targetRevision": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
13
|
+
"stage": { "enum": ["discovering", "fetching", "scanning", "parsing", "chunking", "embedding", "indexing", "verifying", "publishing"] },
|
|
14
|
+
"status": { "enum": ["queued", "running", "retry_wait", "cancelling", "cancelled", "failed", "succeeded"] },
|
|
15
|
+
"attempt": { "type": "integer", "minimum": 0, "maximum": 20 },
|
|
16
|
+
"leaseOwner": { "type": "string", "maxLength": 160 },
|
|
17
|
+
"leaseExpiresAt": { "type": "string", "format": "date-time" },
|
|
18
|
+
"errorCode": { "type": "string", "maxLength": 128 },
|
|
19
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
20
|
+
"updatedAt": { "type": "string", "format": "date-time" }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/ingestion-stage.schema.json",
|
|
4
|
+
"title": "Knowledge Ingestion Stage Completion",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "jobId", "stage", "attempt", "status", "completedAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": "opensoha.dev/knowledge-ingestion-stage/v1" },
|
|
10
|
+
"jobId": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
11
|
+
"stage": { "type": "string", "minLength": 1, "maxLength": 64 },
|
|
12
|
+
"attempt": { "type": "integer", "minimum": 1, "maximum": 20 },
|
|
13
|
+
"status": { "enum": ["succeeded", "retryable", "failed", "cancelled"] },
|
|
14
|
+
"artifactRefs": { "type": "array", "maxItems": 256, "items": { "type": "string", "maxLength": 512 } },
|
|
15
|
+
"checkpointRef": { "type": "string", "maxLength": 512 },
|
|
16
|
+
"errorCode": { "type": "string", "maxLength": 128 },
|
|
17
|
+
"completedAt": { "type": "string", "format": "date-time" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/knowledge-base.schema.json",
|
|
4
|
+
"title": "Knowledge Base",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["id", "name", "status", "ownerId", "scope", "retrievalPolicy", "createdAt", "updatedAt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"id": { "type": "string", "minLength": 1 },
|
|
10
|
+
"tenantId": { "type": "string" },
|
|
11
|
+
"workspaceId": { "type": "string" },
|
|
12
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 160 },
|
|
13
|
+
"description": { "type": "string", "maxLength": 4000 },
|
|
14
|
+
"status": { "enum": ["active", "disabled"] },
|
|
15
|
+
"ownerId": { "type": "string", "minLength": 1 },
|
|
16
|
+
"scope": { "$ref": "#/$defs/accessScope" },
|
|
17
|
+
"retrievalPolicy": { "$ref": "#/$defs/retrievalPolicy" },
|
|
18
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
19
|
+
"updatedAt": { "type": "string", "format": "date-time" }
|
|
20
|
+
},
|
|
21
|
+
"$defs": {
|
|
22
|
+
"stringSet": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
|
|
23
|
+
"accessScope": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["visibility"],
|
|
27
|
+
"properties": {
|
|
28
|
+
"visibility": { "enum": ["private", "restricted", "public"] },
|
|
29
|
+
"users": { "$ref": "#/$defs/stringSet" },
|
|
30
|
+
"roles": { "$ref": "#/$defs/stringSet" },
|
|
31
|
+
"teams": { "$ref": "#/$defs/stringSet" },
|
|
32
|
+
"projects": { "$ref": "#/$defs/stringSet" }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"retrievalPolicy": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"additionalProperties": false,
|
|
38
|
+
"required": ["defaultTopK", "maxTopK", "lexicalWeight", "vectorWeight", "minScore"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"defaultTopK": { "type": "integer", "minimum": 1, "maximum": 50 },
|
|
41
|
+
"maxTopK": { "type": "integer", "minimum": 1, "maximum": 50 },
|
|
42
|
+
"lexicalWeight": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
43
|
+
"vectorWeight": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
44
|
+
"minScore": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://opensoha.dev/schemas/knowledge/knowledge-search.schema.json",
|
|
4
|
+
"title": "Knowledge Search Request",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["knowledgeBaseIds", "query"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"knowledgeBaseIds": { "type": "array", "minItems": 1, "maxItems": 50, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
|
|
10
|
+
"query": { "type": "string", "minLength": 1, "maxLength": 16000 },
|
|
11
|
+
"topK": { "type": "integer", "minimum": 1, "maximum": 50 },
|
|
12
|
+
"filters": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"properties": {
|
|
16
|
+
"sourceIds": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
|
|
17
|
+
"documentIds": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|