@burdenoff/microfe-cosmicintersection 2026.1107.1 → 2026.1108.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cosmicintersection/api/cosmicApi.d.ts +222 -1
- package/dist/cosmicintersection/api/cosmicApi.d.ts.map +1 -1
- package/dist/cosmicintersection/api/cosmicApi.js +332 -133
- package/dist/cosmicintersection/api/cosmicApi.js.map +1 -1
- package/dist/cosmicintersection/components/AiRunAttribution.d.ts +18 -0
- package/dist/cosmicintersection/components/AiRunAttribution.d.ts.map +1 -0
- package/dist/cosmicintersection/components/AiRunAttribution.js +39 -0
- package/dist/cosmicintersection/components/AiRunAttribution.js.map +1 -0
- package/dist/cosmicintersection/components/ReleaseDraftDialog.d.ts +15 -0
- package/dist/cosmicintersection/components/ReleaseDraftDialog.d.ts.map +1 -0
- package/dist/cosmicintersection/components/ReleaseDraftDialog.js +193 -0
- package/dist/cosmicintersection/components/ReleaseDraftDialog.js.map +1 -0
- package/dist/cosmicintersection/components/RunTriageCard.d.ts +15 -0
- package/dist/cosmicintersection/components/RunTriageCard.d.ts.map +1 -0
- package/dist/cosmicintersection/components/RunTriageCard.js +282 -0
- package/dist/cosmicintersection/components/RunTriageCard.js.map +1 -0
- package/dist/cosmicintersection/components/SchemaProposalPanel.d.ts +18 -0
- package/dist/cosmicintersection/components/SchemaProposalPanel.d.ts.map +1 -0
- package/dist/cosmicintersection/components/SchemaProposalPanel.js +277 -0
- package/dist/cosmicintersection/components/SchemaProposalPanel.js.map +1 -0
- package/dist/cosmicintersection/components/index.d.ts +4 -0
- package/dist/cosmicintersection/components/index.d.ts.map +1 -1
- package/dist/cosmicintersection/components/index.js +5 -1
- package/dist/cosmicintersection/pages/access/AccessPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/access/AccessPage.js +348 -326
- package/dist/cosmicintersection/pages/access/AccessPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +732 -543
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js +268 -119
- package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js +322 -307
- package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js +276 -241
- package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js +190 -185
- package/dist/cosmicintersection/pages/runs/RunDetailPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmicApi.js","names":[],"sources":["../../../src/cosmicintersection/api/cosmicApi.ts"],"sourcesContent":["/**\n * cosmicApi — hand-written typed data layer for the CosmicIntersection MFE.\n *\n * Mirrors the pattern in microfe-eventfullymanaged's eventApi.ts: inline `gql`\n * documents + `@apollo/client/react` hooks, with hand-written response/variables\n * types that track the wspace-cosmicintersection-svc subgraph SDL exactly. The\n * Apollo client is provided by the HOST app shell via React context (integrated\n * mode) — this module never constructs a client. Every `cos*` operation runs on\n * the workspace gateway (the default client in context).\n *\n * Scalar mapping: BigInt -> string, JSON -> Record<string, unknown>,\n * DateTime -> string (ISO).\n */\nimport { gql, type ErrorLike } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\n\nimport { notify } from '../lib/toast';\n\n/**\n * Shared mutation error sink. The gateway client runs with `errorPolicy: 'all'`,\n * so in-band GraphQL errors also invoke `onError`; wiring this on every write\n * mutation guarantees a failure is always surfaced to the user even if a caller\n * forgets to inspect the resolved result.\n */\nconst onMutationError = (error: ErrorLike): void => {\n notify.error('Something went wrong', error.message || 'Please try again.');\n};\n\n// ============================================================================\n// ENUMS (string-literal unions — exact SDL values)\n// ============================================================================\n\nexport type CosDatasetStatus = 'DRAFT' | 'INGESTING' | 'AVAILABLE' | 'DEPRECATED' | 'ARCHIVED';\nexport type CosAccessLevel = 'PUBLIC' | 'WORKSPACE' | 'RESTRICTED' | 'EMBARGOED';\nexport type CosSourceType =\n | 'TELESCOPE'\n | 'SATELLITE'\n | 'GROUND_SENSOR'\n | 'ARCHIVE'\n | 'API'\n | 'STREAM'\n | 'FILE_DROP'\n | 'SIMULATION';\nexport type CosSourceStatus =\n 'CONFIGURING' | 'CONNECTED' | 'SYNCING' | 'DEGRADED' | 'ERROR' | 'DISABLED';\nexport type CosFieldType =\n | 'STRING'\n | 'INTEGER'\n | 'FLOAT'\n | 'BOOLEAN'\n | 'TIMESTAMP'\n | 'COORDINATE'\n | 'SPECTRUM'\n | 'GEOMETRY'\n | 'IMAGE_REF'\n | 'JSON';\nexport type CosPipelineStatus = 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';\nexport type CosPipelineTrigger = 'MANUAL' | 'SCHEDULED' | 'ON_INGEST' | 'WEBHOOK';\nexport type CosRunStatus = 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';\n/**\n * Full SDL vocabulary. The four geospatial kinds are recognised values a step\n * can already carry (BOFF-4355) — only RASTER_CALC has an execution backend, so\n * they are readable/renderable but are deliberately not offered as authoring\n * options in the add-step form.\n */\nexport type CosStepKind =\n | 'INGEST'\n | 'CALIBRATE'\n | 'TRANSFORM'\n | 'ANALYZE'\n | 'EXPORT'\n | 'NOTIFY'\n | 'RASTER_CALC'\n | 'REPROJECT'\n | 'TILE'\n | 'ZONAL_STATS';\nexport type CosNotebookStatus = 'DRAFT' | 'RUNNING' | 'PUBLISHED' | 'ARCHIVED';\nexport type CosAnalysisStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';\nexport type CosReleaseStatus = 'DRAFT' | 'UNDER_REVIEW' | 'PUBLISHED' | 'RETRACTED';\nexport type CosGrantStatus = 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'REVOKED';\n\n// ============================================================================\n// ENTITY TYPES\n// ============================================================================\n\n/** Federated wspace-files File stub — only `{ id }` is resolvable in this subgraph. */\nexport interface CosFileRef {\n id: string;\n}\n\n/** An entity selected id-only, where the operation needs its existence, not its body. */\nexport interface CosIdRef {\n id: string;\n}\n\n/**\n * Per-parent cap the subgraph applies to every relation field\n * (`capPerGroup(rows, key, DEFAULT_LIMIT)` in wspace-cosmicintersection-svc's\n * dataloaders — DEFAULT_LIMIT is 50).\n *\n * A relation array of exactly this length means \"at least this many\", NOT an\n * exact total: render it as `50+`, never as a precise count.\n */\nexport const COS_RELATION_PAGE_SIZE = 50;\n\nexport interface CosSchemaField {\n id: string;\n workspaceId: string;\n datasetId: string;\n name: string;\n fieldType: CosFieldType;\n unit?: string | null;\n description?: string | null;\n nullable: boolean;\n position: number;\n provenance?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataset {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n format?: string | null;\n sourceId?: string | null;\n collectionId?: string | null;\n /** BigInt returned as a numeric string. */\n rowCount: string;\n /** BigInt returned as a numeric string. */\n sizeBytes: string;\n version: number;\n lineageCaptured: boolean;\n coverage?: Record<string, unknown> | null;\n ingestedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — only present when the operation selects them (detail queries).\n source?: CosSource | null;\n collection?: CosCollection | null;\n file?: CosFileRef | null;\n schemaFields?: CosSchemaField[];\n}\n\nexport interface CosSource {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n type: CosSourceType;\n status: CosSourceStatus;\n endpoint?: string | null;\n config?: Record<string, unknown> | null;\n lastSyncedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosCollection {\n id: string;\n workspaceId: string;\n name: string;\n slug?: string | null;\n description?: string | null;\n isPublic: boolean;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosPipeline {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosPipelineStatus;\n trigger: CosPipelineTrigger;\n schedule?: string | null;\n definition?: Record<string, unknown> | null;\n version: number;\n lastRunAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n runs?: CosPipelineRun[];\n}\n\nexport interface CosPipelineRun {\n id: string;\n workspaceId: string;\n pipelineId: string;\n runNumber: number;\n status: CosRunStatus;\n datasetId?: string | null;\n params?: Record<string, unknown> | null;\n metrics?: Record<string, unknown> | null;\n triggeredBy?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n pipeline?: CosPipeline | null;\n steps?: CosPipelineStep[];\n}\n\nexport interface CosPipelineStep {\n id: string;\n workspaceId: string;\n runId: string;\n name: string;\n kind: CosStepKind;\n position: number;\n status: CosRunStatus;\n inputs?: Record<string, unknown> | null;\n outputs?: Record<string, unknown> | null;\n logsRef?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosNotebook {\n id: string;\n workspaceId: string;\n title: string;\n description?: string | null;\n status: CosNotebookStatus;\n runtime?: string | null;\n environment?: Record<string, unknown> | null;\n datasetIds: string[];\n isShared: boolean;\n shareSlug?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n file?: CosFileRef | null;\n analyses?: CosAnalysis[];\n releases?: CosRelease[];\n}\n\nexport interface CosAnalysis {\n id: string;\n workspaceId: string;\n title: string;\n status: CosAnalysisStatus;\n method?: string | null;\n aiAssisted: boolean;\n notebookId?: string | null;\n datasetId?: string | null;\n results?: Record<string, unknown> | null;\n outputFile?: CosFileRef | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosRelease {\n id: string;\n workspaceId: string;\n title: string;\n version: string;\n status: CosReleaseStatus;\n abstract?: string | null;\n authors: string[];\n datasetIds: string[];\n notebookId?: string | null;\n doi?: string | null;\n license?: string | null;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataAccessGrant {\n id: string;\n workspaceId: string;\n datasetId: string;\n granteeId: string;\n status: CosGrantStatus;\n scopes: string[];\n reason?: string | null;\n grantedAt?: string | null;\n expiresAt?: string | null;\n revokedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n// ============================================================================\n// PAGINATION / CONNECTIONS\n// ============================================================================\n\nexport interface CosPageInfo {\n hasMore: boolean;\n cursor?: string | null;\n}\n\nexport interface CosConnection<T> {\n items: T[];\n pageInfo: CosPageInfo;\n}\n\n/** Offset-based pagination input (PaginationInput in the SDL; limit defaults to 50). */\nexport interface CosPaginationInput {\n limit?: number;\n offset?: number;\n cursor?: string;\n}\n\n// ============================================================================\n// INPUT TYPES\n// ============================================================================\n\nexport interface CosCreateDatasetInput {\n name: string;\n description?: string;\n status?: CosDatasetStatus;\n accessLevel?: CosAccessLevel;\n format?: string;\n sourceId?: string;\n collectionId?: string;\n fileId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateDatasetInput {\n name?: string;\n description?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosAddSchemaFieldInput {\n datasetId: string;\n name: string;\n fieldType?: CosFieldType;\n unit?: string;\n description?: string;\n nullable?: boolean;\n position?: number;\n provenance?: string;\n}\n\nexport interface CosCreateSourceInput {\n name: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateSourceInput {\n name?: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosCreateCollectionInput {\n name: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\n/** All fields optional — only the provided keys are updated (CosUpdateCollectionInput in the SDL). */\nexport interface CosUpdateCollectionInput {\n name?: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\nexport interface CosCreatePipelineInput {\n name: string;\n description?: string;\n trigger?: CosPipelineTrigger;\n schedule?: string;\n definition?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdatePipelineInput {\n name?: string;\n description?: string;\n status?: CosPipelineStatus;\n trigger?: CosPipelineTrigger;\n schedule?: string;\n definition?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosStartRunInput {\n pipelineId: string;\n datasetId?: string;\n params?: Record<string, unknown>;\n}\n\nexport interface CosAddRunStepInput {\n runId: string;\n name: string;\n kind?: CosStepKind;\n inputs?: Record<string, unknown>;\n position?: number;\n}\n\nexport interface CosCreateNotebookInput {\n title: string;\n description?: string;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n fileId?: string;\n tags?: string[];\n}\n\nexport interface CosUpdateNotebookInput {\n title?: string;\n description?: string;\n status?: CosNotebookStatus;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n isShared?: boolean;\n shareSlug?: string;\n tags?: string[];\n}\n\nexport interface CosRunAnalysisInput {\n title: string;\n method?: string;\n aiAssisted?: boolean;\n notebookId?: string;\n datasetId?: string;\n}\n\nexport interface CosCreateReleaseInput {\n title: string;\n version?: string;\n abstract?: string;\n authors?: string[];\n datasetIds?: string[];\n notebookId?: string;\n license?: string;\n}\n\nexport interface CosGrantAccessInput {\n datasetId: string;\n granteeId: string;\n scopes?: string[];\n reason?: string;\n expiresAt?: string;\n}\n\n// ============================================================================\n// GQL DOCUMENTS — QUERIES\n// ============================================================================\n\nexport const COS_HEALTH_QUERY = gql`\n query CosHealth {\n cosHealth\n }\n`;\n\nexport const COS_DATASETS_QUERY = gql`\n query CosListDatasets(\n $q: String\n $accessLevel: CosAccessLevel\n $format: String\n $collectionId: ID\n $sourceId: ID\n $status: CosDatasetStatus\n $pagination: PaginationInput\n ) {\n cosListDatasets(\n q: $q\n accessLevel: $accessLevel\n format: $format\n collectionId: $collectionId\n sourceId: $sourceId\n status: $status\n pagination: $pagination\n ) {\n items {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n ingestedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_DATASET_QUERY = gql`\n query CosDataset($id: ID!) {\n cosDataset(id: $id) {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n coverage\n ingestedAt\n tags\n createdAt\n updatedAt\n file {\n id\n }\n source {\n id\n name\n type\n status\n }\n collection {\n id\n name\n slug\n }\n schemaFields {\n id\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const COS_SOURCES_QUERY = gql`\n query CosListSources(\n $type: CosSourceType\n $status: CosSourceStatus\n $pagination: PaginationInput\n ) {\n cosListSources(type: $type, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_SOURCE_QUERY = gql`\n query CosSource($id: ID!) {\n cosSource(id: $id) {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n datasets {\n id\n name\n status\n accessLevel\n rowCount\n updatedAt\n }\n }\n }\n`;\n\n/**\n * `datasets` is selected id-only so each card can show how many datasets the\n * collection holds. The subgraph resolves it through `collectionDatasetsLoader`\n * (one batched query for the whole page) and filters to the datasets THIS actor\n * may read, so the length is the caller's visible count — capped at\n * `COS_RELATION_PAGE_SIZE`.\n */\nexport const COS_COLLECTIONS_QUERY = gql`\n query CosListCollections {\n cosListCollections {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n datasets {\n id\n }\n }\n }\n`;\n\nexport const COS_COLLECTION_QUERY = gql`\n query CosCollection($id: ID!) {\n cosCollection(id: $id) {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_SCHEMA_FIELDS_QUERY = gql`\n query CosListSchemaFields($datasetId: ID!) {\n cosListSchemaFields(datasetId: $datasetId) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PIPELINES_QUERY = gql`\n query CosListPipelines($status: CosPipelineStatus, $pagination: PaginationInput) {\n cosListPipelines(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n status\n trigger\n schedule\n version\n lastRunAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_PIPELINE_QUERY = gql`\n query CosPipeline($id: ID!) {\n cosPipeline(id: $id) {\n id\n workspaceId\n name\n description\n status\n trigger\n schedule\n definition\n version\n lastRunAt\n tags\n createdAt\n updatedAt\n runs {\n id\n runNumber\n status\n datasetId\n startedAt\n finishedAt\n durationMs\n createdAt\n }\n }\n }\n`;\n\nexport const COS_RUNS_QUERY = gql`\n query CosListRuns($pipelineId: ID, $status: CosRunStatus, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_RUN_QUERY = gql`\n query CosRun($id: ID!) {\n cosRun(id: $id) {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n params\n metrics\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n pipeline {\n id\n name\n status\n trigger\n schedule\n }\n steps {\n id\n runId\n name\n kind\n position\n status\n startedAt\n finishedAt\n durationMs\n errorMessage\n }\n }\n }\n`;\n\n/**\n * Other FAILED runs of the same pipeline, newest first, each with its steps so\n * the caller can name the step that broke. `steps` resolves through\n * `pipelineRunStepsLoader`, so the whole list costs one extra batched query.\n */\nexport const COS_PIPELINE_FAILED_RUNS_QUERY = gql`\n query CosPipelineFailedRuns($pipelineId: ID!, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: FAILED, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n errorMessage\n startedAt\n finishedAt\n createdAt\n updatedAt\n steps {\n id\n runId\n name\n kind\n position\n status\n errorMessage\n }\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * Minimal dataset lookup — resolves an id held on another entity (e.g.\n * `CosPipelineRun.datasetId`, which the SDL exposes as a bare ID with no\n * relation field) to something a human can read. Returns null when the caller\n * has no read access to that dataset, so callers must fall back to the id.\n */\nexport const COS_DATASET_SUMMARY_QUERY = gql`\n query CosDatasetSummary($id: ID!) {\n cosDataset(id: $id) {\n id\n name\n status\n accessLevel\n }\n }\n`;\n\nexport const COS_RUN_STEPS_QUERY = gql`\n query CosListRunSteps($runId: ID!) {\n cosListRunSteps(runId: $runId) {\n id\n workspaceId\n runId\n name\n kind\n position\n status\n inputs\n outputs\n logsRef\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_NOTEBOOKS_QUERY = gql`\n query CosListNotebooks($status: CosNotebookStatus, $pagination: PaginationInput) {\n cosListNotebooks(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_NOTEBOOK_QUERY = gql`\n query CosNotebook($id: ID!) {\n cosNotebook(id: $id) {\n id\n workspaceId\n title\n description\n status\n runtime\n environment\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n file {\n id\n }\n analyses {\n id\n title\n status\n aiAssisted\n method\n createdAt\n }\n releases {\n id\n title\n version\n status\n publishedAt\n }\n }\n }\n`;\n\nexport const COS_ANALYSES_QUERY = gql`\n query CosListAnalyses($datasetId: ID, $notebookId: ID, $status: CosAnalysisStatus) {\n cosListAnalyses(datasetId: $datasetId, notebookId: $notebookId, status: $status) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\n/**\n * One analysis by id, independent of list paging and filters; the analyses\n * page falls back to it when the `?id=` analysis is not in the loaded list.\n */\nexport const COS_ANALYSIS_QUERY = gql`\n query CosAnalysis($id: ID!) {\n cosAnalysis(id: $id) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_RELEASES_QUERY = gql`\n query CosListReleases($status: CosReleaseStatus, $pagination: PaginationInput) {\n cosListReleases(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * One release by id, independent of list paging and filters. The releases page\n * falls back to it when the `?id=` release is not on the loaded list page, so a\n * deep link or a command-palette Recent entry always reopens the release.\n */\nexport const COS_RELEASE_QUERY = gql`\n query CosRelease($id: ID!) {\n cosRelease(id: $id) {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ACCESS_GRANTS_QUERY = gql`\n query CosListAccessGrants($datasetId: ID, $status: CosGrantStatus) {\n cosListAccessGrants(datasetId: $datasetId, status: $status) {\n id\n workspaceId\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n revokedAt\n createdAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// PLATFORM REUSE — activity feed (wspace-activity-svc, federated on the\n// workspace supergraph). The cos mutation-audit plugin already writes these\n// ActivityLog rows via be-sdk `trackOperation`; this is the read surface,\n// scoped to a single cos entity by `resourceId`. Only scalar fields are\n// selected so no cross-subgraph entity resolution is required.\n// ============================================================================\n\nexport const COS_ACTIVITY_BY_RESOURCE_QUERY = gql`\n query CosResourceActivity($filter: ActivityLogFilter) {\n getActivities(filter: $filter) {\n id\n action\n description\n resourceType\n resourceId\n userId\n timestamp\n }\n }\n`;\n\n// ============================================================================\n// GQL DOCUMENTS — MUTATIONS\n// ============================================================================\n\nexport const COS_CREATE_DATASET_MUTATION = gql`\n mutation CosCreateDataset($input: CosCreateDatasetInput!) {\n cosCreateDataset(input: $input) {\n id\n name\n status\n accessLevel\n sourceId\n collectionId\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_DATASET_MUTATION = gql`\n mutation CosUpdateDataset($id: ID!, $input: CosUpdateDatasetInput!) {\n cosUpdateDataset(id: $id, input: $input) {\n id\n name\n description\n status\n accessLevel\n format\n collectionId\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_DATASET_MUTATION = gql`\n mutation CosPublishDataset($id: ID!) {\n cosPublishDataset(id: $id) {\n id\n status\n ingestedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_DATASET_MUTATION = gql`\n mutation CosArchiveDataset($id: ID!) {\n cosArchiveDataset(id: $id)\n }\n`;\n\nexport const COS_ADD_SCHEMA_FIELD_MUTATION = gql`\n mutation CosAddSchemaField($input: CosAddSchemaFieldInput!) {\n cosAddSchemaField(input: $input) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_SOURCE_MUTATION = gql`\n mutation CosCreateSource($input: CosCreateSourceInput!) {\n cosCreateSource(input: $input) {\n id\n name\n type\n status\n endpoint\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_SOURCE_MUTATION = gql`\n mutation CosUpdateSource($id: ID!, $input: CosUpdateSourceInput!) {\n cosUpdateSource(id: $id, input: $input) {\n id\n name\n description\n type\n status\n endpoint\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_MARK_SOURCE_SYNCED_MUTATION = gql`\n mutation CosMarkSourceSynced($id: ID!) {\n cosMarkSourceSynced(id: $id) {\n id\n status\n lastSyncedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_SOURCE_MUTATION = gql`\n mutation CosArchiveSource($id: ID!) {\n cosArchiveSource(id: $id)\n }\n`;\n\nexport const COS_CREATE_COLLECTION_MUTATION = gql`\n mutation CosCreateCollection($input: CosCreateCollectionInput!) {\n cosCreateCollection(input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_COLLECTION_MUTATION = gql`\n mutation CosUpdateCollection($id: ID!, $input: CosUpdateCollectionInput!) {\n cosUpdateCollection(id: $id, input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_COLLECTION_MUTATION = gql`\n mutation CosArchiveCollection($id: ID!) {\n cosArchiveCollection(id: $id)\n }\n`;\n\nexport const COS_CREATE_PIPELINE_MUTATION = gql`\n mutation CosCreatePipeline($input: CosCreatePipelineInput!) {\n cosCreatePipeline(input: $input) {\n id\n name\n status\n trigger\n schedule\n version\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_PIPELINE_MUTATION = gql`\n mutation CosUpdatePipeline($id: ID!, $input: CosUpdatePipelineInput!) {\n cosUpdatePipeline(id: $id, input: $input) {\n id\n name\n description\n status\n trigger\n schedule\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_PIPELINE_MUTATION = gql`\n mutation CosArchivePipeline($id: ID!) {\n cosArchivePipeline(id: $id)\n }\n`;\n\nexport const COS_START_RUN_MUTATION = gql`\n mutation CosStartRun($input: CosStartRunInput!) {\n cosStartRun(input: $input) {\n id\n pipelineId\n runNumber\n status\n datasetId\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_TRANSITION_RUN_MUTATION = gql`\n mutation CosTransitionRun($id: ID!, $status: CosRunStatus!) {\n cosTransitionRun(id: $id, status: $status) {\n id\n status\n startedAt\n finishedAt\n durationMs\n updatedAt\n }\n }\n`;\n\nexport const COS_ADD_RUN_STEP_MUTATION = gql`\n mutation CosAddRunStep($input: CosAddRunStepInput!) {\n cosAddRunStep(input: $input) {\n id\n runId\n name\n kind\n position\n status\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_NOTEBOOK_MUTATION = gql`\n mutation CosCreateNotebook($input: CosCreateNotebookInput!) {\n cosCreateNotebook(input: $input) {\n id\n title\n status\n runtime\n datasetIds\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_NOTEBOOK_MUTATION = gql`\n mutation CosUpdateNotebook($id: ID!, $input: CosUpdateNotebookInput!) {\n cosUpdateNotebook(id: $id, input: $input) {\n id\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_NOTEBOOK_MUTATION = gql`\n mutation CosArchiveNotebook($id: ID!) {\n cosArchiveNotebook(id: $id)\n }\n`;\n\nexport const COS_RUN_ANALYSIS_MUTATION = gql`\n mutation CosRunAnalysis($input: CosRunAnalysisInput!) {\n cosRunAnalysis(input: $input) {\n id\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_COMPLETE_ANALYSIS_MUTATION = gql`\n mutation CosCompleteAnalysis(\n $id: ID!\n $status: CosAnalysisStatus!\n $results: JSON\n $outputFileId: ID\n ) {\n cosCompleteAnalysis(id: $id, status: $status, results: $results, outputFileId: $outputFileId) {\n id\n status\n results\n finishedAt\n errorMessage\n outputFile {\n id\n }\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_RELEASE_MUTATION = gql`\n mutation CosCreateRelease($input: CosCreateReleaseInput!) {\n cosCreateRelease(input: $input) {\n id\n title\n version\n status\n authors\n datasetIds\n notebookId\n license\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_RELEASE_MUTATION = gql`\n mutation CosPublishRelease($id: ID!, $doi: String) {\n cosPublishRelease(id: $id, doi: $doi) {\n id\n status\n doi\n publishedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_GRANT_ACCESS_MUTATION = gql`\n mutation CosGrantAccess($input: CosGrantAccessInput!) {\n cosGrantAccess(input: $input) {\n id\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_REVOKE_ACCESS_MUTATION = gql`\n mutation CosRevokeAccess($id: ID!) {\n cosRevokeAccess(id: $id) {\n id\n status\n revokedAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// RESPONSE / VARIABLES TYPES\n// ============================================================================\n\nexport interface CosHealthQueryData {\n cosHealth: string;\n}\n\nexport interface CosDatasetsQueryData {\n cosListDatasets: CosConnection<CosDataset>;\n}\nexport interface CosDatasetsQueryVars {\n /** Full-text search across dataset name/description/tags (backend `q` arg). */\n q?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n sourceId?: string;\n status?: CosDatasetStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosDatasetQueryData {\n cosDataset: CosDataset | null;\n}\n\nexport interface CosSourcesQueryData {\n cosListSources: CosConnection<CosSource>;\n}\nexport interface CosSourcesQueryVars {\n type?: CosSourceType;\n status?: CosSourceStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosSourceQueryData {\n cosSource: CosSource | null;\n}\n\n/**\n * Row shape of `cosListCollections` — same as `CosCollection` except `datasets`\n * is the id-only selection COS_COLLECTIONS_QUERY makes, so the list page can\n * size each collection without over-fetching dataset bodies.\n */\nexport interface CosCollectionListItem extends Omit<CosCollection, 'datasets'> {\n datasets: CosIdRef[];\n}\n\nexport interface CosCollectionsQueryData {\n cosListCollections: CosCollectionListItem[];\n}\n\nexport interface CosCollectionQueryData {\n cosCollection: CosCollection | null;\n}\n\nexport interface CosSchemaFieldsQueryData {\n cosListSchemaFields: CosSchemaField[];\n}\n\nexport interface CosPipelinesQueryData {\n cosListPipelines: CosConnection<CosPipeline>;\n}\nexport interface CosPipelinesQueryVars {\n status?: CosPipelineStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosPipelineQueryData {\n cosPipeline: CosPipeline | null;\n}\n\nexport interface CosRunsQueryData {\n cosListRuns: CosConnection<CosPipelineRun>;\n}\nexport interface CosRunsQueryVars {\n pipelineId?: string;\n status?: CosRunStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosRunQueryData {\n cosRun: CosPipelineRun | null;\n}\n\nexport interface CosRunStepsQueryData {\n cosListRunSteps: CosPipelineStep[];\n}\n\n/** Row of COS_PIPELINE_FAILED_RUNS_QUERY — `steps` is always selected. */\nexport interface CosFailedRunListItem extends Omit<CosPipelineRun, 'steps'> {\n steps: CosPipelineStep[];\n}\n\nexport interface CosPipelineFailedRunsQueryData {\n cosListRuns: CosConnection<CosFailedRunListItem>;\n}\nexport interface CosPipelineFailedRunsQueryVars {\n pipelineId: string;\n pagination?: CosPaginationInput;\n}\n\n/** Just enough of a dataset to render its name in place of a bare id. */\nexport interface CosDatasetSummary {\n id: string;\n name: string;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n}\n\nexport interface CosDatasetSummaryQueryData {\n cosDataset: CosDatasetSummary | null;\n}\n\nexport interface CosNotebooksQueryData {\n cosListNotebooks: CosConnection<CosNotebook>;\n}\nexport interface CosNotebooksQueryVars {\n status?: CosNotebookStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosNotebookQueryData {\n cosNotebook: CosNotebook | null;\n}\n\nexport interface CosAnalysesQueryData {\n cosListAnalyses: CosAnalysis[];\n}\nexport interface CosAnalysesQueryVars {\n datasetId?: string;\n notebookId?: string;\n status?: CosAnalysisStatus;\n}\n\nexport interface CosAnalysisQueryData {\n cosAnalysis: CosAnalysis | null;\n}\nexport interface CosReleaseQueryData {\n cosRelease: CosRelease | null;\n}\nexport interface CosReleasesQueryData {\n cosListReleases: CosConnection<CosRelease>;\n}\nexport interface CosReleasesQueryVars {\n status?: CosReleaseStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosAccessGrantsQueryData {\n cosListAccessGrants: CosDataAccessGrant[];\n}\nexport interface CosAccessGrantsQueryVars {\n datasetId?: string;\n status?: CosGrantStatus;\n}\n\n/** A single platform activity record (subset of wspace-activity-svc ActivityLog). */\nexport interface CosActivityEntry {\n id: string;\n action: string;\n description?: string | null;\n resourceType?: string | null;\n resourceId?: string | null;\n userId: string;\n timestamp: string;\n}\n\nexport interface CosActivityQueryData {\n getActivities: CosActivityEntry[];\n}\n\n/** Mirrors ActivityLogFilter — only the fields the cos activity panel needs. */\nexport interface CosActivityFilter {\n workspaceId?: string;\n resourceId?: string;\n resourceType?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface CosActivityQueryVars {\n filter?: CosActivityFilter;\n}\n\n// ============================================================================\n// QUERY HOOKS\n// ============================================================================\n\nexport const useCosHealthQuery = () => useQuery<CosHealthQueryData>(COS_HEALTH_QUERY);\n\nexport const useCosDatasetsQuery = (variables: CosDatasetsQueryVars = {}) =>\n useQuery<CosDatasetsQueryData, CosDatasetsQueryVars>(COS_DATASETS_QUERY, { variables });\n\nexport const useCosDatasetQuery = (id: string) =>\n useQuery<CosDatasetQueryData, { id: string }>(COS_DATASET_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSourcesQuery = (variables: CosSourcesQueryVars = {}) =>\n useQuery<CosSourcesQueryData, CosSourcesQueryVars>(COS_SOURCES_QUERY, { variables });\n\nexport const useCosSourceQuery = (id: string) =>\n useQuery<CosSourceQueryData, { id: string }>(COS_SOURCE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosCollectionsQuery = () =>\n useQuery<CosCollectionsQueryData>(COS_COLLECTIONS_QUERY);\n\nexport const useCosCollectionQuery = (id: string) =>\n useQuery<CosCollectionQueryData, { id: string }>(COS_COLLECTION_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSchemaFieldsQuery = (datasetId: string) =>\n useQuery<CosSchemaFieldsQueryData, { datasetId: string }>(COS_SCHEMA_FIELDS_QUERY, {\n variables: { datasetId },\n skip: !datasetId,\n });\n\nexport const useCosPipelinesQuery = (variables: CosPipelinesQueryVars = {}) =>\n useQuery<CosPipelinesQueryData, CosPipelinesQueryVars>(COS_PIPELINES_QUERY, { variables });\n\nexport const useCosPipelineQuery = (id: string) =>\n useQuery<CosPipelineQueryData, { id: string }>(COS_PIPELINE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunsQuery = (variables: CosRunsQueryVars = {}) =>\n useQuery<CosRunsQueryData, CosRunsQueryVars>(COS_RUNS_QUERY, { variables });\n\nexport const useCosRunQuery = (id: string) =>\n useQuery<CosRunQueryData, { id: string }>(COS_RUN_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunStepsQuery = (runId: string) =>\n useQuery<CosRunStepsQueryData, { runId: string }>(COS_RUN_STEPS_QUERY, {\n variables: { runId },\n skip: !runId,\n });\n\n/**\n * Failed runs of one pipeline. Skipped until a pipelineId is known so the run\n * detail page can call it unconditionally while its own query is still loading.\n */\nexport const useCosPipelineFailedRunsQuery = (\n pipelineId: string | undefined,\n options: { limit?: number; skip?: boolean } = {}\n) =>\n useQuery<CosPipelineFailedRunsQueryData, CosPipelineFailedRunsQueryVars>(\n COS_PIPELINE_FAILED_RUNS_QUERY,\n {\n variables: {\n pipelineId: pipelineId ?? '',\n pagination: { limit: options.limit ?? 20, offset: 0 },\n },\n skip: !pipelineId || options.skip === true,\n }\n );\n\n/** Resolves a dataset id to its name. Returns null data when unreadable. */\nexport const useCosDatasetSummaryQuery = (id: string | null | undefined) =>\n useQuery<CosDatasetSummaryQueryData, { id: string }>(COS_DATASET_SUMMARY_QUERY, {\n variables: { id: id ?? '' },\n skip: !id,\n });\n\nexport const useCosNotebooksQuery = (variables: CosNotebooksQueryVars = {}) =>\n useQuery<CosNotebooksQueryData, CosNotebooksQueryVars>(COS_NOTEBOOKS_QUERY, { variables });\n\nexport const useCosNotebookQuery = (id: string) =>\n useQuery<CosNotebookQueryData, { id: string }>(COS_NOTEBOOK_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosAnalysesQuery = (variables: CosAnalysesQueryVars = {}) =>\n useQuery<CosAnalysesQueryData, CosAnalysesQueryVars>(COS_ANALYSES_QUERY, { variables });\n\nexport const useCosReleasesQuery = (variables: CosReleasesQueryVars = {}) =>\n useQuery<CosReleasesQueryData, CosReleasesQueryVars>(COS_RELEASES_QUERY, { variables });\n\n/** One analysis by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosAnalysisQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosAnalysisQueryData, { id: string }>(COS_ANALYSIS_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\n/** One release by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosReleaseQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosReleaseQueryData, { id: string }>(COS_RELEASE_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\nexport const useCosAccessGrantsQuery = (variables: CosAccessGrantsQueryVars = {}) =>\n useQuery<CosAccessGrantsQueryData, CosAccessGrantsQueryVars>(COS_ACCESS_GRANTS_QUERY, {\n variables,\n });\n\n/**\n * Resource-scoped platform activity for a single cos entity. RBAC on\n * `getActivities` scopes on `filter.workspaceId`, so both a workspaceId and the\n * entity's resourceId are required — the query is skipped until both are known.\n */\nexport const useCosResourceActivityQuery = (params: {\n workspaceId?: string;\n resourceId: string;\n resourceType?: string;\n limit?: number;\n}) => {\n const { workspaceId, resourceId, resourceType, limit = 20 } = params;\n return useQuery<CosActivityQueryData, CosActivityQueryVars>(COS_ACTIVITY_BY_RESOURCE_QUERY, {\n variables: { filter: { workspaceId, resourceId, resourceType, limit } },\n skip: !workspaceId || !resourceId,\n fetchPolicy: 'cache-and-network',\n });\n};\n\n// ============================================================================\n// MUTATION HOOKS\n// ============================================================================\n\nexport const useCosCreateDatasetMutation = () =>\n useMutation<{ cosCreateDataset: CosDataset }, { input: CosCreateDatasetInput }>(\n COS_CREATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosUpdateDatasetMutation = () =>\n useMutation<{ cosUpdateDataset: CosDataset }, { id: string; input: CosUpdateDatasetInput }>(\n COS_UPDATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosPublishDatasetMutation = () =>\n useMutation<{ cosPublishDataset: CosDataset }, { id: string }>(COS_PUBLISH_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosArchiveDatasetMutation = () =>\n useMutation<{ cosArchiveDataset: boolean }, { id: string }>(COS_ARCHIVE_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosAddSchemaFieldMutation = () =>\n useMutation<{ cosAddSchemaField: CosSchemaField }, { input: CosAddSchemaFieldInput }>(\n COS_ADD_SCHEMA_FIELD_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateSourceMutation = () =>\n useMutation<{ cosCreateSource: CosSource }, { input: CosCreateSourceInput }>(\n COS_CREATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosUpdateSourceMutation = () =>\n useMutation<{ cosUpdateSource: CosSource }, { id: string; input: CosUpdateSourceInput }>(\n COS_UPDATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosMarkSourceSyncedMutation = () =>\n useMutation<{ cosMarkSourceSynced: CosSource }, { id: string }>(COS_MARK_SOURCE_SYNCED_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosArchiveSourceMutation = () =>\n useMutation<{ cosArchiveSource: boolean }, { id: string }>(COS_ARCHIVE_SOURCE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosCreateCollectionMutation = () =>\n useMutation<{ cosCreateCollection: CosCollection }, { input: CosCreateCollectionInput }>(\n COS_CREATE_COLLECTION_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n }\n );\n\nexport const useCosUpdateCollectionMutation = () =>\n useMutation<\n { cosUpdateCollection: CosCollection },\n { id: string; input: CosUpdateCollectionInput }\n >(COS_UPDATE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosArchiveCollectionMutation = () =>\n useMutation<{ cosArchiveCollection: boolean }, { id: string }>(COS_ARCHIVE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosCreatePipelineMutation = () =>\n useMutation<{ cosCreatePipeline: CosPipeline }, { input: CosCreatePipelineInput }>(\n COS_CREATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosUpdatePipelineMutation = () =>\n useMutation<{ cosUpdatePipeline: CosPipeline }, { id: string; input: CosUpdatePipelineInput }>(\n COS_UPDATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosArchivePipelineMutation = () =>\n useMutation<{ cosArchivePipeline: boolean }, { id: string }>(COS_ARCHIVE_PIPELINE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n });\n\nexport const useCosStartRunMutation = () =>\n useMutation<{ cosStartRun: CosPipelineRun }, { input: CosStartRunInput }>(\n COS_START_RUN_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RUNS_QUERY }],\n }\n );\n\nexport const useCosTransitionRunMutation = () =>\n useMutation<{ cosTransitionRun: CosPipelineRun }, { id: string; status: CosRunStatus }>(\n COS_TRANSITION_RUN_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_RUNS_QUERY }] }\n );\n\nexport const useCosAddRunStepMutation = () =>\n useMutation<{ cosAddRunStep: CosPipelineStep }, { input: CosAddRunStepInput }>(\n COS_ADD_RUN_STEP_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateNotebookMutation = () =>\n useMutation<{ cosCreateNotebook: CosNotebook }, { input: CosCreateNotebookInput }>(\n COS_CREATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosUpdateNotebookMutation = () =>\n useMutation<{ cosUpdateNotebook: CosNotebook }, { id: string; input: CosUpdateNotebookInput }>(\n COS_UPDATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosArchiveNotebookMutation = () =>\n useMutation<{ cosArchiveNotebook: boolean }, { id: string }>(COS_ARCHIVE_NOTEBOOK_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n });\n\nexport const useCosRunAnalysisMutation = () =>\n useMutation<{ cosRunAnalysis: CosAnalysis }, { input: CosRunAnalysisInput }>(\n COS_RUN_ANALYSIS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n }\n );\n\nexport const useCosCompleteAnalysisMutation = () =>\n useMutation<\n { cosCompleteAnalysis: CosAnalysis },\n {\n id: string;\n status: Extract<CosAnalysisStatus, 'COMPLETED' | 'FAILED'>;\n results?: Record<string, unknown>;\n outputFileId?: string;\n }\n >(COS_COMPLETE_ANALYSIS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n });\n\nexport const useCosCreateReleaseMutation = () =>\n useMutation<{ cosCreateRelease: CosRelease }, { input: CosCreateReleaseInput }>(\n COS_CREATE_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosPublishReleaseMutation = () =>\n useMutation<{ cosPublishRelease: CosRelease }, { id: string; doi?: string }>(\n COS_PUBLISH_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosGrantAccessMutation = () =>\n useMutation<{ cosGrantAccess: CosDataAccessGrant }, { input: CosGrantAccessInput }>(\n COS_GRANT_ACCESS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n }\n );\n\nexport const useCosRevokeAccessMutation = () =>\n useMutation<{ cosRevokeAccess: CosDataAccessGrant }, { id: string }>(COS_REVOKE_ACCESS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n });\n"],"mappings":";;;;AAwBA,IAAM,KAAmB,MAA2B;CAClD,EAAO,MAAM,wBAAwB,EAAM,WAAW,mBAAmB;AAC3E;AAgdgC,CAAG;;;;;AAMnC,IAAa,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CxB,IAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDvB,IAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6B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,CAAC;AAChD,CACF,GAEW,WACX,EACE,GACA;CACE,aAAa;CACb,SAAS;CACT,gBAAgB,CAAC,EAAE,OAAO,EAAwB,CAAC;AACrD,CACF,GAEW,WACX,EAAqE,GAA4B;CAC/F,aAAa;CACb,SAAS;CACT,gBAAgB,CAAC,EAAE,OAAO,EAAwB,CAAC;AACrD,CAAC"}
|
|
1
|
+
{"version":3,"file":"cosmicApi.js","names":[],"sources":["../../../src/cosmicintersection/api/cosmicApi.ts"],"sourcesContent":["/**\n * cosmicApi — hand-written typed data layer for the CosmicIntersection MFE.\n *\n * Mirrors the pattern in microfe-eventfullymanaged's eventApi.ts: inline `gql`\n * documents + `@apollo/client/react` hooks, with hand-written response/variables\n * types that track the wspace-cosmicintersection-svc subgraph SDL exactly. The\n * Apollo client is provided by the HOST app shell via React context (integrated\n * mode) — this module never constructs a client. Every `cos*` operation runs on\n * the workspace gateway (the default client in context).\n *\n * Scalar mapping: BigInt -> string, JSON -> Record<string, unknown>,\n * DateTime -> string (ISO).\n */\nimport { gql, type ErrorLike } from '@apollo/client';\nimport { useLazyQuery, useMutation, useQuery } from '@apollo/client/react';\n\nimport { notify } from '../lib/toast';\n\n/**\n * Shared mutation error sink. The gateway client runs with `errorPolicy: 'all'`,\n * so in-band GraphQL errors also invoke `onError`; wiring this on every write\n * mutation guarantees a failure is always surfaced to the user even if a caller\n * forgets to inspect the resolved result.\n */\nconst onMutationError = (error: ErrorLike): void => {\n notify.error('Something went wrong', error.message || 'Please try again.');\n};\n\n// ============================================================================\n// ENUMS (string-literal unions — exact SDL values)\n// ============================================================================\n\nexport type CosDatasetStatus = 'DRAFT' | 'INGESTING' | 'AVAILABLE' | 'DEPRECATED' | 'ARCHIVED';\nexport type CosAccessLevel = 'PUBLIC' | 'WORKSPACE' | 'RESTRICTED' | 'EMBARGOED';\nexport type CosSourceType =\n | 'TELESCOPE'\n | 'SATELLITE'\n | 'GROUND_SENSOR'\n | 'ARCHIVE'\n | 'API'\n | 'STREAM'\n | 'FILE_DROP'\n | 'SIMULATION';\nexport type CosSourceStatus =\n 'CONFIGURING' | 'CONNECTED' | 'SYNCING' | 'DEGRADED' | 'ERROR' | 'DISABLED';\nexport type CosFieldType =\n | 'STRING'\n | 'INTEGER'\n | 'FLOAT'\n | 'BOOLEAN'\n | 'TIMESTAMP'\n | 'COORDINATE'\n | 'SPECTRUM'\n | 'GEOMETRY'\n | 'IMAGE_REF'\n | 'JSON';\nexport type CosPipelineStatus = 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';\nexport type CosPipelineTrigger = 'MANUAL' | 'SCHEDULED' | 'ON_INGEST' | 'WEBHOOK';\nexport type CosRunStatus = 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';\n/**\n * Full SDL vocabulary. The four geospatial kinds are recognised values a step\n * can already carry (BOFF-4355) — only RASTER_CALC has an execution backend, so\n * they are readable/renderable but are deliberately not offered as authoring\n * options in the add-step form.\n */\nexport type CosStepKind =\n | 'INGEST'\n | 'CALIBRATE'\n | 'TRANSFORM'\n | 'ANALYZE'\n | 'EXPORT'\n | 'NOTIFY'\n | 'RASTER_CALC'\n | 'REPROJECT'\n | 'TILE'\n | 'ZONAL_STATS';\nexport type CosNotebookStatus = 'DRAFT' | 'RUNNING' | 'PUBLISHED' | 'ARCHIVED';\nexport type CosAnalysisStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';\nexport type CosReleaseStatus = 'DRAFT' | 'UNDER_REVIEW' | 'PUBLISHED' | 'RETRACTED';\nexport type CosGrantStatus = 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'REVOKED';\n\n// ============================================================================\n// AI DECISION ENGINE (BOFF-3781 / BOFF-3814) — proposals, never writes.\n// \"AI proposes; scientists review.\" Every cosAi* operation returns a proposal\n// the human accepts through the named domain mutation; nothing here mutates a\n// domain entity. Types mirror wspace-cosmicintersection-svc's ai.gql exactly.\n// ============================================================================\n\nexport type CosTriageAction =\n | 'PROMOTE'\n | 'RERUN_WITH_PARAMS'\n | 'QUARANTINE_DATASET'\n | 'FLAG_SOURCE_DEGRADED'\n | 'INSUFFICIENT_TELEMETRY';\n\nexport type CosTriageSignalSeverity = 'INFO' | 'WARNING' | 'CRITICAL';\nexport type CosTriageEvidenceKind = 'RUN' | 'RUN_METRIC' | 'STEP' | 'SOURCE' | 'BASELINE';\nexport type CosSearchEntityType = 'DATASET' | 'COLLECTION' | 'RELEASE' | 'NOTEBOOK';\nexport type CosSearchEvidenceKind =\n | 'DATASET_TEXT'\n | 'SCHEMA_FIELD'\n | 'SCHEMA_PROVENANCE'\n | 'COVERAGE'\n | 'COVERAGE_WINDOW'\n | 'SOURCE'\n | 'COLLECTION'\n | 'RELEASE_ABSTRACT'\n | 'ANALYSIS_METHOD'\n | 'NOTEBOOK';\nexport type CosSearchLineageKind =\n 'SOURCE' | 'PIPELINE_RUN' | 'PIPELINE_STEP' | 'ANALYSIS' | 'RELEASE';\n\nexport interface CosSchemaFieldSuggestion {\n name: string;\n fieldType: CosFieldType;\n unit?: string | null;\n nullable: boolean;\n position: number;\n description?: string | null;\n /** Drafted provenance note: where the column came from and why it was typed so. */\n provenanceNote: string;\n confidence: number;\n reasons: string[];\n sampledValues: number;\n emptyValues: number;\n /** True when the dataset already defines this name — it is never overwritten. */\n alreadyDefined: boolean;\n existingFieldId?: string | null;\n conflicts: string[];\n}\n\nexport interface CosSchemaFieldProposal {\n datasetId: string;\n sampleOrigin: 'REQUEST' | 'DATASET_CONTEXT' | 'SOURCE_CONFIG';\n sampledRows: number;\n fields: CosSchemaFieldSuggestion[];\n notes: string[];\n /** Id of this run in the shared AI invocation ledger. */\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosTriageSignal {\n code: string;\n severity: CosTriageSignalSeverity;\n message: string;\n}\n\nexport interface CosTriageEvidence {\n kind: CosTriageEvidenceKind;\n refId: string;\n field: string;\n value: string;\n}\n\nexport interface CosRunTriageMetrics {\n rowsIn?: number | null;\n rowsOut?: number | null;\n anomaliesFlagged?: number | null;\n warnings?: number | null;\n anomalyRate?: number | null;\n rowLossRate?: number | null;\n baselineAnomalyRate?: number | null;\n}\n\nexport interface CosTriageProposedAction {\n /** Name of the existing mutation a person would run; triage never runs it. */\n mutation: string;\n targetId: string;\n arguments: Record<string, unknown>;\n description: string;\n}\n\nexport interface CosRunTriage {\n runId: string;\n action: CosTriageAction;\n confidence: number;\n rationale: string;\n signals: CosTriageSignal[];\n evidence: CosTriageEvidence[];\n metrics: CosRunTriageMetrics;\n suggestedParams?: Record<string, unknown> | null;\n proposedAction?: CosTriageProposedAction | null;\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosReleaseAuthorSuggestion {\n actorId: string;\n roles: string[];\n contributions: number;\n}\n\nexport interface CosReleaseDraft {\n notebookId: string;\n title: string;\n abstract: string;\n version: string;\n authors: string[];\n authorSuggestions: CosReleaseAuthorSuggestion[];\n license: string;\n licenseRationale: string;\n datasetIds: string[];\n analysisIds: string[];\n warnings: string[];\n notes: string[];\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosSearchEvidence {\n kind: CosSearchEvidenceKind;\n entityId?: string | null;\n label?: string | null;\n text: string;\n}\n\nexport interface CosSearchLineageNode {\n kind: CosSearchLineageKind;\n id: string;\n label: string;\n relation: string;\n parentId?: string | null;\n}\n\nexport interface CosSearchHit {\n entityType: CosSearchEntityType;\n id: string;\n title: string;\n snippet?: string | null;\n score: number;\n dataset?: CosDataset | null;\n collection?: CosCollection | null;\n release?: CosRelease | null;\n notebook?: CosNotebook | null;\n evidence: CosSearchEvidence[];\n lineage: CosSearchLineageNode[];\n}\n\nexport interface CosSearchResults {\n query: string;\n interpretedTerms: string[];\n expandedTerms: string[];\n timeWindow?: { fromYear: number; toYear: number } | null;\n hits: CosSearchHit[];\n total: number;\n}\n\nexport interface CosSemanticSearchInput {\n query: string;\n entityTypes?: CosSearchEntityType[];\n limit?: number;\n includeLineage?: boolean;\n}\n\nexport interface CosUpdateSchemaFieldInput {\n name?: string;\n fieldType?: CosFieldType;\n unit?: string;\n description?: string;\n nullable?: boolean;\n position?: number;\n provenance?: string;\n}\n\n// ============================================================================\n// ENTITY TYPES\n// ============================================================================\n\n/** Federated wspace-files File stub — only `{ id }` is resolvable in this subgraph. */\nexport interface CosFileRef {\n id: string;\n}\n\n/** An entity selected id-only, where the operation needs its existence, not its body. */\nexport interface CosIdRef {\n id: string;\n}\n\n/**\n * Per-parent cap the subgraph applies to every relation field\n * (`capPerGroup(rows, key, DEFAULT_LIMIT)` in wspace-cosmicintersection-svc's\n * dataloaders — DEFAULT_LIMIT is 50).\n *\n * A relation array of exactly this length means \"at least this many\", NOT an\n * exact total: render it as `50+`, never as a precise count.\n */\nexport const COS_RELATION_PAGE_SIZE = 50;\n\nexport interface CosSchemaField {\n id: string;\n workspaceId: string;\n datasetId: string;\n name: string;\n fieldType: CosFieldType;\n unit?: string | null;\n description?: string | null;\n nullable: boolean;\n position: number;\n provenance?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataset {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n format?: string | null;\n sourceId?: string | null;\n collectionId?: string | null;\n /** BigInt returned as a numeric string. */\n rowCount: string;\n /** BigInt returned as a numeric string. */\n sizeBytes: string;\n version: number;\n lineageCaptured: boolean;\n coverage?: Record<string, unknown> | null;\n ingestedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — only present when the operation selects them (detail queries).\n source?: CosSource | null;\n collection?: CosCollection | null;\n file?: CosFileRef | null;\n schemaFields?: CosSchemaField[];\n}\n\nexport interface CosSource {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n type: CosSourceType;\n status: CosSourceStatus;\n endpoint?: string | null;\n config?: Record<string, unknown> | null;\n lastSyncedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosCollection {\n id: string;\n workspaceId: string;\n name: string;\n slug?: string | null;\n description?: string | null;\n isPublic: boolean;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosPipeline {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosPipelineStatus;\n trigger: CosPipelineTrigger;\n schedule?: string | null;\n definition?: Record<string, unknown> | null;\n version: number;\n lastRunAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n runs?: CosPipelineRun[];\n}\n\nexport interface CosPipelineRun {\n id: string;\n workspaceId: string;\n pipelineId: string;\n runNumber: number;\n status: CosRunStatus;\n datasetId?: string | null;\n params?: Record<string, unknown> | null;\n metrics?: Record<string, unknown> | null;\n triggeredBy?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n pipeline?: CosPipeline | null;\n steps?: CosPipelineStep[];\n}\n\nexport interface CosPipelineStep {\n id: string;\n workspaceId: string;\n runId: string;\n name: string;\n kind: CosStepKind;\n position: number;\n status: CosRunStatus;\n inputs?: Record<string, unknown> | null;\n outputs?: Record<string, unknown> | null;\n logsRef?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosNotebook {\n id: string;\n workspaceId: string;\n title: string;\n description?: string | null;\n status: CosNotebookStatus;\n runtime?: string | null;\n environment?: Record<string, unknown> | null;\n datasetIds: string[];\n isShared: boolean;\n shareSlug?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n file?: CosFileRef | null;\n analyses?: CosAnalysis[];\n releases?: CosRelease[];\n}\n\nexport interface CosAnalysis {\n id: string;\n workspaceId: string;\n title: string;\n status: CosAnalysisStatus;\n method?: string | null;\n aiAssisted: boolean;\n notebookId?: string | null;\n datasetId?: string | null;\n results?: Record<string, unknown> | null;\n outputFile?: CosFileRef | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosRelease {\n id: string;\n workspaceId: string;\n title: string;\n version: string;\n status: CosReleaseStatus;\n abstract?: string | null;\n authors: string[];\n datasetIds: string[];\n notebookId?: string | null;\n doi?: string | null;\n license?: string | null;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataAccessGrant {\n id: string;\n workspaceId: string;\n datasetId: string;\n granteeId: string;\n status: CosGrantStatus;\n scopes: string[];\n reason?: string | null;\n grantedAt?: string | null;\n expiresAt?: string | null;\n revokedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n// ============================================================================\n// PAGINATION / CONNECTIONS\n// ============================================================================\n\nexport interface CosPageInfo {\n hasMore: boolean;\n cursor?: string | null;\n}\n\nexport interface CosConnection<T> {\n items: T[];\n pageInfo: CosPageInfo;\n}\n\n/** Offset-based pagination input (PaginationInput in the SDL; limit defaults to 50). */\nexport interface CosPaginationInput {\n limit?: number;\n offset?: number;\n cursor?: string;\n}\n\n// ============================================================================\n// INPUT TYPES\n// ============================================================================\n\nexport interface CosCreateDatasetInput {\n name: string;\n description?: string;\n status?: CosDatasetStatus;\n accessLevel?: CosAccessLevel;\n format?: string;\n sourceId?: string;\n collectionId?: string;\n fileId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateDatasetInput {\n name?: string;\n description?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosAddSchemaFieldInput {\n datasetId: string;\n name: string;\n fieldType?: CosFieldType;\n unit?: string;\n description?: string;\n nullable?: boolean;\n position?: number;\n provenance?: string;\n}\n\nexport interface CosCreateSourceInput {\n name: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateSourceInput {\n name?: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosCreateCollectionInput {\n name: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\n/** All fields optional — only the provided keys are updated (CosUpdateCollectionInput in the SDL). */\nexport interface CosUpdateCollectionInput {\n name?: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\nexport interface CosCreatePipelineInput {\n name: string;\n description?: string;\n trigger?: CosPipelineTrigger;\n schedule?: string;\n definition?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdatePipelineInput {\n name?: string;\n description?: string;\n status?: CosPipelineStatus;\n trigger?: CosPipelineTrigger;\n schedule?: string;\n definition?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosStartRunInput {\n pipelineId: string;\n datasetId?: string;\n params?: Record<string, unknown>;\n}\n\nexport interface CosAddRunStepInput {\n runId: string;\n name: string;\n kind?: CosStepKind;\n inputs?: Record<string, unknown>;\n position?: number;\n}\n\nexport interface CosCreateNotebookInput {\n title: string;\n description?: string;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n fileId?: string;\n tags?: string[];\n}\n\nexport interface CosUpdateNotebookInput {\n title?: string;\n description?: string;\n status?: CosNotebookStatus;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n isShared?: boolean;\n shareSlug?: string;\n tags?: string[];\n}\n\nexport interface CosRunAnalysisInput {\n title: string;\n method?: string;\n aiAssisted?: boolean;\n notebookId?: string;\n datasetId?: string;\n}\n\nexport interface CosCreateReleaseInput {\n title: string;\n version?: string;\n abstract?: string;\n authors?: string[];\n datasetIds?: string[];\n notebookId?: string;\n license?: string;\n}\n\nexport interface CosGrantAccessInput {\n datasetId: string;\n granteeId: string;\n scopes?: string[];\n reason?: string;\n expiresAt?: string;\n}\n\n// ============================================================================\n// GQL DOCUMENTS — QUERIES\n// ============================================================================\n\nexport const COS_HEALTH_QUERY = gql`\n query CosHealth {\n cosHealth\n }\n`;\n\nexport const COS_DATASETS_QUERY = gql`\n query CosListDatasets(\n $q: String\n $accessLevel: CosAccessLevel\n $format: String\n $collectionId: ID\n $sourceId: ID\n $status: CosDatasetStatus\n $pagination: PaginationInput\n ) {\n cosListDatasets(\n q: $q\n accessLevel: $accessLevel\n format: $format\n collectionId: $collectionId\n sourceId: $sourceId\n status: $status\n pagination: $pagination\n ) {\n items {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n ingestedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_DATASET_QUERY = gql`\n query CosDataset($id: ID!) {\n cosDataset(id: $id) {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n coverage\n ingestedAt\n tags\n createdAt\n updatedAt\n file {\n id\n }\n source {\n id\n name\n type\n status\n }\n collection {\n id\n name\n slug\n }\n schemaFields {\n id\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const COS_SOURCES_QUERY = gql`\n query CosListSources(\n $type: CosSourceType\n $status: CosSourceStatus\n $pagination: PaginationInput\n ) {\n cosListSources(type: $type, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_SOURCE_QUERY = gql`\n query CosSource($id: ID!) {\n cosSource(id: $id) {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n datasets {\n id\n name\n status\n accessLevel\n rowCount\n updatedAt\n }\n }\n }\n`;\n\n/**\n * `datasets` is selected id-only so each card can show how many datasets the\n * collection holds. The subgraph resolves it through `collectionDatasetsLoader`\n * (one batched query for the whole page) and filters to the datasets THIS actor\n * may read, so the length is the caller's visible count — capped at\n * `COS_RELATION_PAGE_SIZE`.\n */\nexport const COS_COLLECTIONS_QUERY = gql`\n query CosListCollections {\n cosListCollections {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n datasets {\n id\n }\n }\n }\n`;\n\nexport const COS_COLLECTION_QUERY = gql`\n query CosCollection($id: ID!) {\n cosCollection(id: $id) {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_SCHEMA_FIELDS_QUERY = gql`\n query CosListSchemaFields($datasetId: ID!) {\n cosListSchemaFields(datasetId: $datasetId) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PIPELINES_QUERY = gql`\n query CosListPipelines($status: CosPipelineStatus, $pagination: PaginationInput) {\n cosListPipelines(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n status\n trigger\n schedule\n version\n lastRunAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_PIPELINE_QUERY = gql`\n query CosPipeline($id: ID!) {\n cosPipeline(id: $id) {\n id\n workspaceId\n name\n description\n status\n trigger\n schedule\n definition\n version\n lastRunAt\n tags\n createdAt\n updatedAt\n runs {\n id\n runNumber\n status\n datasetId\n startedAt\n finishedAt\n durationMs\n createdAt\n }\n }\n }\n`;\n\nexport const COS_RUNS_QUERY = gql`\n query CosListRuns($pipelineId: ID, $status: CosRunStatus, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_RUN_QUERY = gql`\n query CosRun($id: ID!) {\n cosRun(id: $id) {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n params\n metrics\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n pipeline {\n id\n name\n status\n trigger\n schedule\n }\n steps {\n id\n runId\n name\n kind\n position\n status\n startedAt\n finishedAt\n durationMs\n errorMessage\n }\n }\n }\n`;\n\n/**\n * Other FAILED runs of the same pipeline, newest first, each with its steps so\n * the caller can name the step that broke. `steps` resolves through\n * `pipelineRunStepsLoader`, so the whole list costs one extra batched query.\n */\nexport const COS_PIPELINE_FAILED_RUNS_QUERY = gql`\n query CosPipelineFailedRuns($pipelineId: ID!, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: FAILED, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n errorMessage\n startedAt\n finishedAt\n createdAt\n updatedAt\n steps {\n id\n runId\n name\n kind\n position\n status\n errorMessage\n }\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * Minimal dataset lookup — resolves an id held on another entity (e.g.\n * `CosPipelineRun.datasetId`, which the SDL exposes as a bare ID with no\n * relation field) to something a human can read. Returns null when the caller\n * has no read access to that dataset, so callers must fall back to the id.\n */\nexport const COS_DATASET_SUMMARY_QUERY = gql`\n query CosDatasetSummary($id: ID!) {\n cosDataset(id: $id) {\n id\n name\n status\n accessLevel\n }\n }\n`;\n\nexport const COS_RUN_STEPS_QUERY = gql`\n query CosListRunSteps($runId: ID!) {\n cosListRunSteps(runId: $runId) {\n id\n workspaceId\n runId\n name\n kind\n position\n status\n inputs\n outputs\n logsRef\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_NOTEBOOKS_QUERY = gql`\n query CosListNotebooks($status: CosNotebookStatus, $pagination: PaginationInput) {\n cosListNotebooks(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_NOTEBOOK_QUERY = gql`\n query CosNotebook($id: ID!) {\n cosNotebook(id: $id) {\n id\n workspaceId\n title\n description\n status\n runtime\n environment\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n file {\n id\n }\n analyses {\n id\n title\n status\n aiAssisted\n method\n createdAt\n }\n releases {\n id\n title\n version\n status\n publishedAt\n }\n }\n }\n`;\n\nexport const COS_ANALYSES_QUERY = gql`\n query CosListAnalyses($datasetId: ID, $notebookId: ID, $status: CosAnalysisStatus) {\n cosListAnalyses(datasetId: $datasetId, notebookId: $notebookId, status: $status) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\n/**\n * One analysis by id, independent of list paging and filters; the analyses\n * page falls back to it when the `?id=` analysis is not in the loaded list.\n */\nexport const COS_ANALYSIS_QUERY = gql`\n query CosAnalysis($id: ID!) {\n cosAnalysis(id: $id) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_RELEASES_QUERY = gql`\n query CosListReleases($status: CosReleaseStatus, $pagination: PaginationInput) {\n cosListReleases(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * One release by id, independent of list paging and filters. The releases page\n * falls back to it when the `?id=` release is not on the loaded list page, so a\n * deep link or a command-palette Recent entry always reopens the release.\n */\nexport const COS_RELEASE_QUERY = gql`\n query CosRelease($id: ID!) {\n cosRelease(id: $id) {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ACCESS_GRANTS_QUERY = gql`\n query CosListAccessGrants($datasetId: ID, $status: CosGrantStatus) {\n cosListAccessGrants(datasetId: $datasetId, status: $status) {\n id\n workspaceId\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n revokedAt\n createdAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// PLATFORM REUSE — activity feed (wspace-activity-svc, federated on the\n// workspace supergraph). The cos mutation-audit plugin already writes these\n// ActivityLog rows via be-sdk `trackOperation`; this is the read surface,\n// scoped to a single cos entity by `resourceId`. Only scalar fields are\n// selected so no cross-subgraph entity resolution is required.\n// ============================================================================\n\nexport const COS_ACTIVITY_BY_RESOURCE_QUERY = gql`\n query CosResourceActivity($filter: ActivityLogFilter) {\n getActivities(filter: $filter) {\n id\n action\n description\n resourceType\n resourceId\n userId\n timestamp\n }\n }\n`;\n\n// ============================================================================\n// GQL DOCUMENTS — MUTATIONS\n// ============================================================================\n\nexport const COS_CREATE_DATASET_MUTATION = gql`\n mutation CosCreateDataset($input: CosCreateDatasetInput!) {\n cosCreateDataset(input: $input) {\n id\n name\n status\n accessLevel\n sourceId\n collectionId\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_DATASET_MUTATION = gql`\n mutation CosUpdateDataset($id: ID!, $input: CosUpdateDatasetInput!) {\n cosUpdateDataset(id: $id, input: $input) {\n id\n name\n description\n status\n accessLevel\n format\n collectionId\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_DATASET_MUTATION = gql`\n mutation CosPublishDataset($id: ID!) {\n cosPublishDataset(id: $id) {\n id\n status\n ingestedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_DATASET_MUTATION = gql`\n mutation CosArchiveDataset($id: ID!) {\n cosArchiveDataset(id: $id)\n }\n`;\n\nexport const COS_ADD_SCHEMA_FIELD_MUTATION = gql`\n mutation CosAddSchemaField($input: CosAddSchemaFieldInput!) {\n cosAddSchemaField(input: $input) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_SOURCE_MUTATION = gql`\n mutation CosCreateSource($input: CosCreateSourceInput!) {\n cosCreateSource(input: $input) {\n id\n name\n type\n status\n endpoint\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_SOURCE_MUTATION = gql`\n mutation CosUpdateSource($id: ID!, $input: CosUpdateSourceInput!) {\n cosUpdateSource(id: $id, input: $input) {\n id\n name\n description\n type\n status\n endpoint\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_MARK_SOURCE_SYNCED_MUTATION = gql`\n mutation CosMarkSourceSynced($id: ID!) {\n cosMarkSourceSynced(id: $id) {\n id\n status\n lastSyncedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_SOURCE_MUTATION = gql`\n mutation CosArchiveSource($id: ID!) {\n cosArchiveSource(id: $id)\n }\n`;\n\nexport const COS_CREATE_COLLECTION_MUTATION = gql`\n mutation CosCreateCollection($input: CosCreateCollectionInput!) {\n cosCreateCollection(input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_COLLECTION_MUTATION = gql`\n mutation CosUpdateCollection($id: ID!, $input: CosUpdateCollectionInput!) {\n cosUpdateCollection(id: $id, input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_COLLECTION_MUTATION = gql`\n mutation CosArchiveCollection($id: ID!) {\n cosArchiveCollection(id: $id)\n }\n`;\n\nexport const COS_CREATE_PIPELINE_MUTATION = gql`\n mutation CosCreatePipeline($input: CosCreatePipelineInput!) {\n cosCreatePipeline(input: $input) {\n id\n name\n status\n trigger\n schedule\n version\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_PIPELINE_MUTATION = gql`\n mutation CosUpdatePipeline($id: ID!, $input: CosUpdatePipelineInput!) {\n cosUpdatePipeline(id: $id, input: $input) {\n id\n name\n description\n status\n trigger\n schedule\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_PIPELINE_MUTATION = gql`\n mutation CosArchivePipeline($id: ID!) {\n cosArchivePipeline(id: $id)\n }\n`;\n\nexport const COS_START_RUN_MUTATION = gql`\n mutation CosStartRun($input: CosStartRunInput!) {\n cosStartRun(input: $input) {\n id\n pipelineId\n runNumber\n status\n datasetId\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_TRANSITION_RUN_MUTATION = gql`\n mutation CosTransitionRun($id: ID!, $status: CosRunStatus!) {\n cosTransitionRun(id: $id, status: $status) {\n id\n status\n startedAt\n finishedAt\n durationMs\n updatedAt\n }\n }\n`;\n\nexport const COS_ADD_RUN_STEP_MUTATION = gql`\n mutation CosAddRunStep($input: CosAddRunStepInput!) {\n cosAddRunStep(input: $input) {\n id\n runId\n name\n kind\n position\n status\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_NOTEBOOK_MUTATION = gql`\n mutation CosCreateNotebook($input: CosCreateNotebookInput!) {\n cosCreateNotebook(input: $input) {\n id\n title\n status\n runtime\n datasetIds\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_NOTEBOOK_MUTATION = gql`\n mutation CosUpdateNotebook($id: ID!, $input: CosUpdateNotebookInput!) {\n cosUpdateNotebook(id: $id, input: $input) {\n id\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_NOTEBOOK_MUTATION = gql`\n mutation CosArchiveNotebook($id: ID!) {\n cosArchiveNotebook(id: $id)\n }\n`;\n\nexport const COS_RUN_ANALYSIS_MUTATION = gql`\n mutation CosRunAnalysis($input: CosRunAnalysisInput!) {\n cosRunAnalysis(input: $input) {\n id\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_COMPLETE_ANALYSIS_MUTATION = gql`\n mutation CosCompleteAnalysis(\n $id: ID!\n $status: CosAnalysisStatus!\n $results: JSON\n $outputFileId: ID\n ) {\n cosCompleteAnalysis(id: $id, status: $status, results: $results, outputFileId: $outputFileId) {\n id\n status\n results\n finishedAt\n errorMessage\n outputFile {\n id\n }\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_RELEASE_MUTATION = gql`\n mutation CosCreateRelease($input: CosCreateReleaseInput!) {\n cosCreateRelease(input: $input) {\n id\n title\n version\n status\n authors\n datasetIds\n notebookId\n license\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_RELEASE_MUTATION = gql`\n mutation CosPublishRelease($id: ID!, $doi: String, $mintDoi: Boolean) {\n cosPublishRelease(id: $id, doi: $doi, mintDoi: $mintDoi) {\n id\n status\n doi\n publishedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_MINT_DOI_MUTATION = gql`\n mutation CosMintDoi($releaseId: ID!) {\n cosMintDoi(releaseId: $releaseId) {\n id\n doi\n state\n mode\n errorMessage\n mintedAt\n }\n }\n`;\n\nexport const COS_GRANT_ACCESS_MUTATION = gql`\n mutation CosGrantAccess($input: CosGrantAccessInput!) {\n cosGrantAccess(input: $input) {\n id\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_REVOKE_ACCESS_MUTATION = gql`\n mutation CosRevokeAccess($id: ID!) {\n cosRevokeAccess(id: $id) {\n id\n status\n revokedAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// RESPONSE / VARIABLES TYPES\n// ============================================================================\n\nexport interface CosHealthQueryData {\n cosHealth: string;\n}\n\nexport interface CosDatasetsQueryData {\n cosListDatasets: CosConnection<CosDataset>;\n}\nexport interface CosDatasetsQueryVars {\n /** Full-text search across dataset name/description/tags (backend `q` arg). */\n q?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n sourceId?: string;\n status?: CosDatasetStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosDatasetQueryData {\n cosDataset: CosDataset | null;\n}\n\nexport interface CosSourcesQueryData {\n cosListSources: CosConnection<CosSource>;\n}\nexport interface CosSourcesQueryVars {\n type?: CosSourceType;\n status?: CosSourceStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosSourceQueryData {\n cosSource: CosSource | null;\n}\n\n/**\n * Row shape of `cosListCollections` — same as `CosCollection` except `datasets`\n * is the id-only selection COS_COLLECTIONS_QUERY makes, so the list page can\n * size each collection without over-fetching dataset bodies.\n */\nexport interface CosCollectionListItem extends Omit<CosCollection, 'datasets'> {\n datasets: CosIdRef[];\n}\n\nexport interface CosCollectionsQueryData {\n cosListCollections: CosCollectionListItem[];\n}\n\nexport interface CosCollectionQueryData {\n cosCollection: CosCollection | null;\n}\n\nexport interface CosSchemaFieldsQueryData {\n cosListSchemaFields: CosSchemaField[];\n}\n\nexport interface CosPipelinesQueryData {\n cosListPipelines: CosConnection<CosPipeline>;\n}\nexport interface CosPipelinesQueryVars {\n status?: CosPipelineStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosPipelineQueryData {\n cosPipeline: CosPipeline | null;\n}\n\nexport interface CosRunsQueryData {\n cosListRuns: CosConnection<CosPipelineRun>;\n}\nexport interface CosRunsQueryVars {\n pipelineId?: string;\n status?: CosRunStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosRunQueryData {\n cosRun: CosPipelineRun | null;\n}\n\nexport interface CosRunStepsQueryData {\n cosListRunSteps: CosPipelineStep[];\n}\n\n/** Row of COS_PIPELINE_FAILED_RUNS_QUERY — `steps` is always selected. */\nexport interface CosFailedRunListItem extends Omit<CosPipelineRun, 'steps'> {\n steps: CosPipelineStep[];\n}\n\nexport interface CosPipelineFailedRunsQueryData {\n cosListRuns: CosConnection<CosFailedRunListItem>;\n}\nexport interface CosPipelineFailedRunsQueryVars {\n pipelineId: string;\n pagination?: CosPaginationInput;\n}\n\n/** Just enough of a dataset to render its name in place of a bare id. */\nexport interface CosDatasetSummary {\n id: string;\n name: string;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n}\n\nexport interface CosDatasetSummaryQueryData {\n cosDataset: CosDatasetSummary | null;\n}\n\nexport interface CosNotebooksQueryData {\n cosListNotebooks: CosConnection<CosNotebook>;\n}\nexport interface CosNotebooksQueryVars {\n status?: CosNotebookStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosNotebookQueryData {\n cosNotebook: CosNotebook | null;\n}\n\nexport interface CosAnalysesQueryData {\n cosListAnalyses: CosAnalysis[];\n}\nexport interface CosAnalysesQueryVars {\n datasetId?: string;\n notebookId?: string;\n status?: CosAnalysisStatus;\n}\n\nexport interface CosAnalysisQueryData {\n cosAnalysis: CosAnalysis | null;\n}\nexport interface CosReleaseQueryData {\n cosRelease: CosRelease | null;\n}\nexport interface CosReleasesQueryData {\n cosListReleases: CosConnection<CosRelease>;\n}\nexport interface CosReleasesQueryVars {\n status?: CosReleaseStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosAccessGrantsQueryData {\n cosListAccessGrants: CosDataAccessGrant[];\n}\nexport interface CosAccessGrantsQueryVars {\n datasetId?: string;\n status?: CosGrantStatus;\n}\n\n/** A single platform activity record (subset of wspace-activity-svc ActivityLog). */\nexport interface CosActivityEntry {\n id: string;\n action: string;\n description?: string | null;\n resourceType?: string | null;\n resourceId?: string | null;\n userId: string;\n timestamp: string;\n}\n\nexport interface CosActivityQueryData {\n getActivities: CosActivityEntry[];\n}\n\n/** Mirrors ActivityLogFilter — only the fields the cos activity panel needs. */\nexport interface CosActivityFilter {\n workspaceId?: string;\n resourceId?: string;\n resourceType?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface CosActivityQueryVars {\n filter?: CosActivityFilter;\n}\n\n// ============================================================================\n// QUERY HOOKS\n// ============================================================================\n\nexport const useCosHealthQuery = () => useQuery<CosHealthQueryData>(COS_HEALTH_QUERY);\n\nexport const useCosDatasetsQuery = (variables: CosDatasetsQueryVars = {}) =>\n useQuery<CosDatasetsQueryData, CosDatasetsQueryVars>(COS_DATASETS_QUERY, { variables });\n\nexport const useCosDatasetQuery = (id: string) =>\n useQuery<CosDatasetQueryData, { id: string }>(COS_DATASET_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSourcesQuery = (variables: CosSourcesQueryVars = {}) =>\n useQuery<CosSourcesQueryData, CosSourcesQueryVars>(COS_SOURCES_QUERY, { variables });\n\nexport const useCosSourceQuery = (id: string) =>\n useQuery<CosSourceQueryData, { id: string }>(COS_SOURCE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosCollectionsQuery = () =>\n useQuery<CosCollectionsQueryData>(COS_COLLECTIONS_QUERY);\n\nexport const useCosCollectionQuery = (id: string) =>\n useQuery<CosCollectionQueryData, { id: string }>(COS_COLLECTION_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSchemaFieldsQuery = (datasetId: string) =>\n useQuery<CosSchemaFieldsQueryData, { datasetId: string }>(COS_SCHEMA_FIELDS_QUERY, {\n variables: { datasetId },\n skip: !datasetId,\n });\n\nexport const useCosPipelinesQuery = (variables: CosPipelinesQueryVars = {}) =>\n useQuery<CosPipelinesQueryData, CosPipelinesQueryVars>(COS_PIPELINES_QUERY, { variables });\n\nexport const useCosPipelineQuery = (id: string) =>\n useQuery<CosPipelineQueryData, { id: string }>(COS_PIPELINE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunsQuery = (variables: CosRunsQueryVars = {}) =>\n useQuery<CosRunsQueryData, CosRunsQueryVars>(COS_RUNS_QUERY, { variables });\n\nexport const useCosRunQuery = (id: string) =>\n useQuery<CosRunQueryData, { id: string }>(COS_RUN_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunStepsQuery = (runId: string) =>\n useQuery<CosRunStepsQueryData, { runId: string }>(COS_RUN_STEPS_QUERY, {\n variables: { runId },\n skip: !runId,\n });\n\n/**\n * Failed runs of one pipeline. Skipped until a pipelineId is known so the run\n * detail page can call it unconditionally while its own query is still loading.\n */\nexport const useCosPipelineFailedRunsQuery = (\n pipelineId: string | undefined,\n options: { limit?: number; skip?: boolean } = {}\n) =>\n useQuery<CosPipelineFailedRunsQueryData, CosPipelineFailedRunsQueryVars>(\n COS_PIPELINE_FAILED_RUNS_QUERY,\n {\n variables: {\n pipelineId: pipelineId ?? '',\n pagination: { limit: options.limit ?? 20, offset: 0 },\n },\n skip: !pipelineId || options.skip === true,\n }\n );\n\n/** Resolves a dataset id to its name. Returns null data when unreadable. */\nexport const useCosDatasetSummaryQuery = (id: string | null | undefined) =>\n useQuery<CosDatasetSummaryQueryData, { id: string }>(COS_DATASET_SUMMARY_QUERY, {\n variables: { id: id ?? '' },\n skip: !id,\n });\n\nexport const useCosNotebooksQuery = (variables: CosNotebooksQueryVars = {}) =>\n useQuery<CosNotebooksQueryData, CosNotebooksQueryVars>(COS_NOTEBOOKS_QUERY, { variables });\n\nexport const useCosNotebookQuery = (id: string) =>\n useQuery<CosNotebookQueryData, { id: string }>(COS_NOTEBOOK_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosAnalysesQuery = (variables: CosAnalysesQueryVars = {}) =>\n useQuery<CosAnalysesQueryData, CosAnalysesQueryVars>(COS_ANALYSES_QUERY, { variables });\n\nexport const useCosReleasesQuery = (variables: CosReleasesQueryVars = {}) =>\n useQuery<CosReleasesQueryData, CosReleasesQueryVars>(COS_RELEASES_QUERY, { variables });\n\n/** One analysis by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosAnalysisQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosAnalysisQueryData, { id: string }>(COS_ANALYSIS_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\n/** One release by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosReleaseQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosReleaseQueryData, { id: string }>(COS_RELEASE_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\nexport const useCosAccessGrantsQuery = (variables: CosAccessGrantsQueryVars = {}) =>\n useQuery<CosAccessGrantsQueryData, CosAccessGrantsQueryVars>(COS_ACCESS_GRANTS_QUERY, {\n variables,\n });\n\n/**\n * Resource-scoped platform activity for a single cos entity. RBAC on\n * `getActivities` scopes on `filter.workspaceId`, so both a workspaceId and the\n * entity's resourceId are required — the query is skipped until both are known.\n */\nexport const useCosResourceActivityQuery = (params: {\n workspaceId?: string;\n resourceId: string;\n resourceType?: string;\n limit?: number;\n}) => {\n const { workspaceId, resourceId, resourceType, limit = 20 } = params;\n return useQuery<CosActivityQueryData, CosActivityQueryVars>(COS_ACTIVITY_BY_RESOURCE_QUERY, {\n variables: { filter: { workspaceId, resourceId, resourceType, limit } },\n skip: !workspaceId || !resourceId,\n fetchPolicy: 'cache-and-network',\n });\n};\n\n// ============================================================================\n// MUTATION HOOKS\n// ============================================================================\n\nexport const useCosCreateDatasetMutation = () =>\n useMutation<{ cosCreateDataset: CosDataset }, { input: CosCreateDatasetInput }>(\n COS_CREATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosUpdateDatasetMutation = () =>\n useMutation<{ cosUpdateDataset: CosDataset }, { id: string; input: CosUpdateDatasetInput }>(\n COS_UPDATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosPublishDatasetMutation = () =>\n useMutation<{ cosPublishDataset: CosDataset }, { id: string }>(COS_PUBLISH_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosArchiveDatasetMutation = () =>\n useMutation<{ cosArchiveDataset: boolean }, { id: string }>(COS_ARCHIVE_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosAddSchemaFieldMutation = () =>\n useMutation<{ cosAddSchemaField: CosSchemaField }, { input: CosAddSchemaFieldInput }>(\n COS_ADD_SCHEMA_FIELD_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateSourceMutation = () =>\n useMutation<{ cosCreateSource: CosSource }, { input: CosCreateSourceInput }>(\n COS_CREATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosUpdateSourceMutation = () =>\n useMutation<{ cosUpdateSource: CosSource }, { id: string; input: CosUpdateSourceInput }>(\n COS_UPDATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosMarkSourceSyncedMutation = () =>\n useMutation<{ cosMarkSourceSynced: CosSource }, { id: string }>(COS_MARK_SOURCE_SYNCED_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosArchiveSourceMutation = () =>\n useMutation<{ cosArchiveSource: boolean }, { id: string }>(COS_ARCHIVE_SOURCE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosCreateCollectionMutation = () =>\n useMutation<{ cosCreateCollection: CosCollection }, { input: CosCreateCollectionInput }>(\n COS_CREATE_COLLECTION_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n }\n );\n\nexport const useCosUpdateCollectionMutation = () =>\n useMutation<\n { cosUpdateCollection: CosCollection },\n { id: string; input: CosUpdateCollectionInput }\n >(COS_UPDATE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosArchiveCollectionMutation = () =>\n useMutation<{ cosArchiveCollection: boolean }, { id: string }>(COS_ARCHIVE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosCreatePipelineMutation = () =>\n useMutation<{ cosCreatePipeline: CosPipeline }, { input: CosCreatePipelineInput }>(\n COS_CREATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosUpdatePipelineMutation = () =>\n useMutation<{ cosUpdatePipeline: CosPipeline }, { id: string; input: CosUpdatePipelineInput }>(\n COS_UPDATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosArchivePipelineMutation = () =>\n useMutation<{ cosArchivePipeline: boolean }, { id: string }>(COS_ARCHIVE_PIPELINE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n });\n\nexport const useCosStartRunMutation = () =>\n useMutation<{ cosStartRun: CosPipelineRun }, { input: CosStartRunInput }>(\n COS_START_RUN_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RUNS_QUERY }],\n }\n );\n\nexport const useCosTransitionRunMutation = () =>\n useMutation<{ cosTransitionRun: CosPipelineRun }, { id: string; status: CosRunStatus }>(\n COS_TRANSITION_RUN_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_RUNS_QUERY }] }\n );\n\nexport const useCosAddRunStepMutation = () =>\n useMutation<{ cosAddRunStep: CosPipelineStep }, { input: CosAddRunStepInput }>(\n COS_ADD_RUN_STEP_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateNotebookMutation = () =>\n useMutation<{ cosCreateNotebook: CosNotebook }, { input: CosCreateNotebookInput }>(\n COS_CREATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosUpdateNotebookMutation = () =>\n useMutation<{ cosUpdateNotebook: CosNotebook }, { id: string; input: CosUpdateNotebookInput }>(\n COS_UPDATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosArchiveNotebookMutation = () =>\n useMutation<{ cosArchiveNotebook: boolean }, { id: string }>(COS_ARCHIVE_NOTEBOOK_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n });\n\nexport const useCosRunAnalysisMutation = () =>\n useMutation<{ cosRunAnalysis: CosAnalysis }, { input: CosRunAnalysisInput }>(\n COS_RUN_ANALYSIS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n }\n );\n\nexport const useCosCompleteAnalysisMutation = () =>\n useMutation<\n { cosCompleteAnalysis: CosAnalysis },\n {\n id: string;\n status: Extract<CosAnalysisStatus, 'COMPLETED' | 'FAILED'>;\n results?: Record<string, unknown>;\n outputFileId?: string;\n }\n >(COS_COMPLETE_ANALYSIS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n });\n\nexport const useCosCreateReleaseMutation = () =>\n useMutation<{ cosCreateRelease: CosRelease }, { input: CosCreateReleaseInput }>(\n COS_CREATE_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosPublishReleaseMutation = () =>\n useMutation<{ cosPublishRelease: CosRelease }, { id: string; doi?: string; mintDoi?: boolean }>(\n COS_PUBLISH_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosMintDoiMutation = () =>\n useMutation<\n {\n cosMintDoi: {\n id: string;\n doi?: string | null;\n state: string;\n mode: string;\n errorMessage?: string | null;\n mintedAt?: string | null;\n };\n },\n { releaseId: string }\n >(COS_MINT_DOI_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n });\n\nexport const useCosGrantAccessMutation = () =>\n useMutation<{ cosGrantAccess: CosDataAccessGrant }, { input: CosGrantAccessInput }>(\n COS_GRANT_ACCESS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n }\n );\n\nexport const useCosRevokeAccessMutation = () =>\n useMutation<{ cosRevokeAccess: CosDataAccessGrant }, { id: string }>(COS_REVOKE_ACCESS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n });\n\n// ============================================================================\n// AI DECISION ENGINE OPERATIONS (BOFF-3814)\n// ============================================================================\n\n/**\n * Propose one schema field per dataset column. Writes nothing — accepting a\n * suggestion is the separate, human-pressed `cosAddSchemaField` call.\n */\nexport const COS_AI_PROPOSE_SCHEMA_FIELDS_MUTATION = gql`\n mutation CosAiProposeSchemaFields($datasetId: ID!, $sample: CosSchemaSampleInput) {\n cosAiProposeSchemaFields(datasetId: $datasetId, sample: $sample) {\n datasetId\n sampleOrigin\n sampledRows\n fields {\n name\n fieldType\n unit\n nullable\n position\n description\n provenanceNote\n confidence\n reasons\n sampledValues\n emptyValues\n alreadyDefined\n existingFieldId\n conflicts\n }\n notes\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\n/**\n * Recommend what to do with a finished run, with rationale + the telemetry it\n * read as evidence. Writes nothing — applying the recommendation is the\n * human-pressed mutation named in `proposedAction`.\n */\nexport const COS_AI_TRIAGE_RUN_MUTATION = gql`\n mutation CosAiTriageRun($runId: ID!) {\n cosAiTriageRun(runId: $runId) {\n runId\n action\n confidence\n rationale\n signals {\n code\n severity\n message\n }\n evidence {\n kind\n refId\n field\n value\n }\n metrics {\n rowsIn\n rowsOut\n anomaliesFlagged\n warnings\n anomalyRate\n rowLossRate\n baselineAnomalyRate\n }\n suggestedParams\n proposedAction {\n mutation\n targetId\n arguments\n description\n }\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\n/**\n * Draft a release from a notebook. Writes nothing — `cosCreateRelease` and\n * the confirmed `cosPublishRelease` stay human actions.\n */\nexport const COS_AI_DRAFT_RELEASE_MUTATION = gql`\n mutation CosAiDraftRelease($notebookId: ID!) {\n cosAiDraftRelease(notebookId: $notebookId) {\n notebookId\n title\n abstract\n version\n authors\n authorSuggestions {\n actorId\n roles\n contributions\n }\n license\n licenseRationale\n datasetIds\n analysisIds\n warnings\n notes\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_SCHEMA_FIELD_MUTATION = gql`\n mutation CosUpdateSchemaField($id: ID!, $input: CosUpdateSchemaFieldInput!) {\n cosUpdateSchemaField(id: $id, input: $input) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_REMOVE_SCHEMA_FIELD_MUTATION = gql`\n mutation CosRemoveSchemaField($id: ID!) {\n cosRemoveSchemaField(id: $id)\n }\n`;\n\nexport const COS_SEMANTIC_SEARCH_QUERY = gql`\n query CosSemanticSearch($input: CosSemanticSearchInput!) {\n cosSemanticSearch(input: $input) {\n query\n interpretedTerms\n expandedTerms\n timeWindow {\n fromYear\n toYear\n }\n total\n hits {\n entityType\n id\n title\n snippet\n score\n dataset {\n id\n name\n status\n accessLevel\n format\n }\n collection {\n id\n name\n }\n release {\n id\n title\n status\n }\n notebook {\n id\n title\n status\n }\n evidence {\n kind\n entityId\n label\n text\n }\n lineage {\n kind\n id\n label\n relation\n parentId\n }\n }\n }\n }\n`;\n\nexport const useCosAiProposeSchemaFieldsMutation = () =>\n useMutation<\n { cosAiProposeSchemaFields: CosSchemaFieldProposal },\n { datasetId: string; sample?: { columns?: string[]; rows: unknown } }\n >(COS_AI_PROPOSE_SCHEMA_FIELDS_MUTATION, { errorPolicy: 'all', onError: onMutationError });\n\nexport const useCosAiTriageRunMutation = () =>\n useMutation<{ cosAiTriageRun: CosRunTriage }, { runId: string }>(COS_AI_TRIAGE_RUN_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n });\n\nexport const useCosAiDraftReleaseMutation = () =>\n useMutation<{ cosAiDraftRelease: CosReleaseDraft }, { notebookId: string }>(\n COS_AI_DRAFT_RELEASE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosUpdateSchemaFieldMutation = () =>\n useMutation<\n { cosUpdateSchemaField: CosSchemaField },\n { id: string; input: CosUpdateSchemaFieldInput }\n >(COS_UPDATE_SCHEMA_FIELD_MUTATION, { errorPolicy: 'all', onError: onMutationError });\n\nexport const useCosRemoveSchemaFieldMutation = () =>\n useMutation<{ cosRemoveSchemaField: boolean }, { id: string }>(COS_REMOVE_SCHEMA_FIELD_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n });\n\nexport const useCosSemanticSearchLazyQuery = () =>\n useLazyQuery<{ cosSemanticSearch: CosSearchResults }, { input: CosSemanticSearchInput }>(\n COS_SEMANTIC_SEARCH_QUERY\n );\n"],"mappings":";;;;AAwBA,IAAM,KAAmB,MAA2B;CAClD,EAAO,MAAM,wBAAwB,EAAM,WAAW,mBAAmB;AAC3E;AA8oBgC,CAAG;;;;;AAMnC,IAAa,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CxB,IAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDvB,IAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BvB,IAAmB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;GAkCtB,IAAwB,CAAG;;;;;;;;;;;;;;;;;GAmB3B,IAAuB,CAAG;;;;;;;;;;;;;;;AAgBA,CAAG;;;;;;;;;;;;;;;;;;AAmB1C,IAAa,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;;;;GAyBzB,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BxB,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;GA0BpB,IAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CnB,IAAiC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCpC,IAA4B,CAAG;;;;;;;;;GAW/B,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;;GAuBzB,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;;;;GAyBzB,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCxB,IAAqB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwD/B,WACX,EAGE,IAAuC;CAAE,aAAa;CAAO,SAAS;AAAgB,CAAC,GAE9E,WACX,EAAiE,IAA4B;CAC3F,aAAa;CACb,SAAS;AACX,CAAC,GAEU,WACX,EACE,IACA;CAAE,aAAa;CAAO,SAAS;AAAgB,CACjD,GAEW,WACX,EAGE,IAAkC;CAAE,aAAa;CAAO,SAAS;AAAgB,CAAC,GAEzE,WACX,EAA+D,IAAkC;CAC/F,aAAa;CACb,SAAS;AACX,CAAC,GAEU,WACX,EACE,EACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attribution line for every AI-proposal surface (BOFF-3814). ABOUT.md promises
|
|
3
|
+
* AI-assisted output is attributable: every proposal shows which engine method
|
|
4
|
+
* produced it and the shared-ledger run id, so a reader can tell AI output from
|
|
5
|
+
* human output and trace the run that produced it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function AiRunAttribution({ method, agentRunId, generatedAt, }: {
|
|
8
|
+
method: string;
|
|
9
|
+
agentRunId: string;
|
|
10
|
+
generatedAt?: string | null;
|
|
11
|
+
}): import('react').JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Honesty disclaimer carried on generated prose (ABOUT.md: current reality and
|
|
14
|
+
* target experience are never confused). Rendered above release abstracts and
|
|
15
|
+
* other AI-drafted long-form text.
|
|
16
|
+
*/
|
|
17
|
+
export declare function AiGeneratedDisclaimer(): import('react').JSX.Element;
|
|
18
|
+
//# sourceMappingURL=AiRunAttribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiRunAttribution.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/components/AiRunAttribution.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,UAAU,EACV,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,+BAmBA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,gCAOpC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { Sparkles as r } from "lucide-react";
|
|
3
|
+
//#region src/cosmicintersection/components/AiRunAttribution.tsx
|
|
4
|
+
function i({ method: i, agentRunId: a, generatedAt: o }) {
|
|
5
|
+
let s = o ? new Date(o) : null;
|
|
6
|
+
return /* @__PURE__ */ n("p", {
|
|
7
|
+
className: "inline-flex flex-wrap items-center gap-1.5 text-xs text-text-tertiary",
|
|
8
|
+
children: [/* @__PURE__ */ t(r, {
|
|
9
|
+
className: "size-3",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}), /* @__PURE__ */ n("span", { children: [
|
|
12
|
+
"AI-proposed",
|
|
13
|
+
i ? /* @__PURE__ */ n(e, { children: [
|
|
14
|
+
" ",
|
|
15
|
+
"· method ",
|
|
16
|
+
/* @__PURE__ */ t("span", {
|
|
17
|
+
className: "font-medium text-text-secondary",
|
|
18
|
+
children: i
|
|
19
|
+
})
|
|
20
|
+
] }) : null,
|
|
21
|
+
" · run ",
|
|
22
|
+
/* @__PURE__ */ t("span", {
|
|
23
|
+
className: "font-mono",
|
|
24
|
+
children: a
|
|
25
|
+
}),
|
|
26
|
+
s && !Number.isNaN(s.getTime()) ? /* @__PURE__ */ n(e, { children: [" · ", s.toLocaleString()] }) : null
|
|
27
|
+
] })]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function a() {
|
|
31
|
+
return /* @__PURE__ */ t("p", {
|
|
32
|
+
className: "rounded-card border border-border-default bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
33
|
+
children: "This text was drafted by AI from the workspace’s own records. Review every claim before publishing — generated prose can be wrong even when its sources are correct."
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { a as AiGeneratedDisclaimer, i as AiRunAttribution };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=AiRunAttribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiRunAttribution.js","names":[],"sources":["../../../src/cosmicintersection/components/AiRunAttribution.tsx"],"sourcesContent":["import { Sparkles } from 'lucide-react';\n\n/**\n * Attribution line for every AI-proposal surface (BOFF-3814). ABOUT.md promises\n * AI-assisted output is attributable: every proposal shows which engine method\n * produced it and the shared-ledger run id, so a reader can tell AI output from\n * human output and trace the run that produced it.\n */\nexport function AiRunAttribution({\n method,\n agentRunId,\n generatedAt,\n}: {\n method: string;\n agentRunId: string;\n generatedAt?: string | null;\n}) {\n const when = generatedAt ? new Date(generatedAt) : null;\n return (\n <p className=\"inline-flex flex-wrap items-center gap-1.5 text-xs text-text-tertiary\">\n <Sparkles className=\"size-3\" aria-hidden=\"true\" />\n <span>\n AI-proposed\n {method ? (\n <>\n {' '}\n · method <span className=\"font-medium text-text-secondary\">{method}</span>\n </>\n ) : null}\n {' · run '}\n <span className=\"font-mono\">{agentRunId}</span>\n {when && !Number.isNaN(when.getTime()) ? <> · {when.toLocaleString()}</> : null}\n </span>\n </p>\n );\n}\n\n/**\n * Honesty disclaimer carried on generated prose (ABOUT.md: current reality and\n * target experience are never confused). Rendered above release abstracts and\n * other AI-drafted long-form text.\n */\nexport function AiGeneratedDisclaimer() {\n return (\n <p className=\"rounded-card border border-border-default bg-bg-sunken px-3 py-2 text-xs text-text-secondary\">\n This text was drafted by AI from the workspace’s own records. Review every claim before\n publishing — generated prose can be wrong even when its sources are correct.\n </p>\n );\n}\n"],"mappings":";;;AAQA,SAAgB,EAAiB,EAC/B,WACA,eACA,kBAKC;CACD,IAAM,IAAO,IAAc,IAAI,KAAK,CAAW,IAAI;CACnD,OACE,kBAAC,KAAD;EAAG,WAAU;YAAb,CACE,kBAAC,GAAD;GAAU,WAAU;GAAS,eAAY;EAAQ,CAAA,GACjD,kBAAC,QAAD,EAAA,UAAA;GAAM;GAEH,IACC,kBAAA,GAAA,EAAA,UAAA;IACG;IAAI;IACI,kBAAC,QAAD;KAAM,WAAU;eAAmC;IAAa,CAAA;GACzE,EAAA,CAAA,IACA;GACH;GACD,kBAAC,QAAD;IAAM,WAAU;cAAa;GAAiB,CAAA;GAC7C,KAAQ,CAAC,OAAO,MAAM,EAAK,QAAQ,CAAC,IAAI,kBAAA,GAAA,EAAA,UAAA,CAAE,OAAI,EAAK,eAAe,CAAI,EAAA,CAAA,IAAI;EACvE,EAAA,CAAA,CACL;;AAEP;AAOA,SAAgB,IAAwB;CACtC,OACE,kBAAC,KAAD;EAAG,WAAU;YAA+F;CAGzG,CAAA;AAEP"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CosNotebook } from '../api/cosmicApi';
|
|
2
|
+
/**
|
|
3
|
+
* Release draft review (BOFF-3814) — "a citable record is never minted by an
|
|
4
|
+
* agent." `cosAiDraftRelease` drafts title/abstract/authors/license from the
|
|
5
|
+
* notebook's own records and writes nothing. The scientist edits every field,
|
|
6
|
+
* then explicitly creates a DRAFT release (`cosCreateRelease`). Publishing —
|
|
7
|
+
* which mints the persistent identifier — stays on the Releases page behind
|
|
8
|
+
* its own confirmation dialog and is untouched here.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ReleaseDraftDialog({ notebook, open, onOpenChange, }: {
|
|
11
|
+
notebook: CosNotebook;
|
|
12
|
+
open: boolean;
|
|
13
|
+
onOpenChange: (open: boolean) => void;
|
|
14
|
+
}): import('react').JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=ReleaseDraftDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReleaseDraftDialog.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/components/ReleaseDraftDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,WAAW,EAEjB,MAAM,kBAAkB,CAAC;AAK1B;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,IAAI,EACJ,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC,sCA0MA"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { useCosmicIntersection as e } from "../context/CosmicIntersectionContext.js";
|
|
2
|
+
import { notify as t } from "../lib/toast.js";
|
|
3
|
+
import { useCosAiDraftReleaseMutation as n, useCosCreateReleaseMutation as r } from "../api/cosmicApi.js";
|
|
4
|
+
import { AiGeneratedDisclaimer as i, AiRunAttribution as a } from "./AiRunAttribution.js";
|
|
5
|
+
import { useRef as o, useState as s } from "react";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { Sparkles as d } from "lucide-react";
|
|
8
|
+
import { Button as f, Input as p, Label as m, Textarea as h } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
//#region src/cosmicintersection/components/ReleaseDraftDialog.tsx
|
|
10
|
+
function g({ notebook: g, open: _, onOpenChange: v }) {
|
|
11
|
+
let { navigate: y } = e(), [b, { loading: x }] = n(), [S, { loading: C }] = r(), [w, T] = s(null), [E, D] = s(""), [O, k] = s(""), [A, j] = s(""), [M, N] = s(""), [P, F] = s(""), I = o(null), L = x || C, R = (e) => {
|
|
12
|
+
L || (v(e), e || T(null));
|
|
13
|
+
}, z = () => {
|
|
14
|
+
I.current?.abort(), I.current = null;
|
|
15
|
+
}, B = async () => {
|
|
16
|
+
let e = new AbortController();
|
|
17
|
+
I.current = e;
|
|
18
|
+
let t = await b({
|
|
19
|
+
variables: { notebookId: g.id },
|
|
20
|
+
context: { fetchOptions: { signal: e.signal } }
|
|
21
|
+
});
|
|
22
|
+
I.current = null;
|
|
23
|
+
let n = t.data?.cosAiDraftRelease;
|
|
24
|
+
n && (T(n), D(n.title), k(n.abstract), j(n.version), N(n.authors.join(", ")), F(n.license));
|
|
25
|
+
}, V = async () => {
|
|
26
|
+
if (!E.trim()) {
|
|
27
|
+
t.error("Title is required", "A release needs a title before it can be drafted.");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
(await S({ variables: { input: {
|
|
31
|
+
title: E.trim(),
|
|
32
|
+
abstract: O.trim() || void 0,
|
|
33
|
+
version: A.trim() || void 0,
|
|
34
|
+
authors: M.split(",").map((e) => e.trim()).filter(Boolean),
|
|
35
|
+
license: P.trim() || void 0,
|
|
36
|
+
datasetIds: w?.datasetIds ?? g.datasetIds,
|
|
37
|
+
notebookId: g.id
|
|
38
|
+
} } })).data?.cosCreateRelease && (t.success("Draft release created", "Review it on the Releases page before publishing."), R(!1), y("releases"));
|
|
39
|
+
};
|
|
40
|
+
return _ ? /* @__PURE__ */ u("div", {
|
|
41
|
+
className: "space-y-4 rounded-card border border-border-default bg-bg-elevated p-5",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ u("div", {
|
|
44
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
45
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h2", {
|
|
46
|
+
className: "text-lg font-semibold text-text-primary",
|
|
47
|
+
children: "Draft release with AI"
|
|
48
|
+
}), /* @__PURE__ */ u("p", {
|
|
49
|
+
className: "text-sm text-text-secondary",
|
|
50
|
+
children: [
|
|
51
|
+
"Drafted from “",
|
|
52
|
+
g.title,
|
|
53
|
+
"” and its completed analyses. Nothing is created until you confirm, and publishing always stays a separate, explicit step."
|
|
54
|
+
]
|
|
55
|
+
})] }), w ? null : x ? /* @__PURE__ */ l(f, {
|
|
56
|
+
type: "button",
|
|
57
|
+
variant: "outline",
|
|
58
|
+
size: "sm",
|
|
59
|
+
onClick: z,
|
|
60
|
+
children: "Cancel"
|
|
61
|
+
}) : /* @__PURE__ */ u(f, {
|
|
62
|
+
type: "button",
|
|
63
|
+
variant: "outline",
|
|
64
|
+
size: "sm",
|
|
65
|
+
onClick: () => void B(),
|
|
66
|
+
children: [/* @__PURE__ */ l(d, { className: "size-4" }), "Draft from notebook"]
|
|
67
|
+
})]
|
|
68
|
+
}),
|
|
69
|
+
x ? /* @__PURE__ */ l("p", {
|
|
70
|
+
role: "status",
|
|
71
|
+
className: "text-sm text-text-secondary",
|
|
72
|
+
children: "Reading the notebook, its analyses and its lineage…"
|
|
73
|
+
}) : null,
|
|
74
|
+
w ? /* @__PURE__ */ u(c, { children: [
|
|
75
|
+
w.warnings.length > 0 ? /* @__PURE__ */ l("ul", {
|
|
76
|
+
className: "space-y-1 rounded-card border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-sm text-status-warning-text",
|
|
77
|
+
children: w.warnings.map((e) => /* @__PURE__ */ l("li", { children: e }, e))
|
|
78
|
+
}) : null,
|
|
79
|
+
w.authorSuggestions.length > 0 ? /* @__PURE__ */ u("p", {
|
|
80
|
+
className: "text-xs text-text-tertiary",
|
|
81
|
+
children: [
|
|
82
|
+
"Contribution hints:",
|
|
83
|
+
" ",
|
|
84
|
+
w.authorSuggestions.map((e) => `${e.actorId} (${e.contributions})`).join(", "),
|
|
85
|
+
". Edit the author list below to change who is credited."
|
|
86
|
+
]
|
|
87
|
+
}) : null,
|
|
88
|
+
/* @__PURE__ */ l(i, {}),
|
|
89
|
+
/* @__PURE__ */ u("div", {
|
|
90
|
+
className: "space-y-3",
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ u("div", {
|
|
93
|
+
className: "space-y-1.5",
|
|
94
|
+
children: [/* @__PURE__ */ l(m, {
|
|
95
|
+
htmlFor: "cos-draft-title",
|
|
96
|
+
children: "Title"
|
|
97
|
+
}), /* @__PURE__ */ l(p, {
|
|
98
|
+
id: "cos-draft-title",
|
|
99
|
+
value: E,
|
|
100
|
+
onChange: (e) => D(e.target.value)
|
|
101
|
+
})]
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ u("div", {
|
|
104
|
+
className: "space-y-1.5",
|
|
105
|
+
children: [/* @__PURE__ */ l(m, {
|
|
106
|
+
htmlFor: "cos-draft-abstract",
|
|
107
|
+
children: "Abstract"
|
|
108
|
+
}), /* @__PURE__ */ l(h, {
|
|
109
|
+
id: "cos-draft-abstract",
|
|
110
|
+
value: O,
|
|
111
|
+
onChange: (e) => k(e.target.value),
|
|
112
|
+
rows: 6
|
|
113
|
+
})]
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ u("div", {
|
|
116
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ u("div", {
|
|
119
|
+
className: "space-y-1.5",
|
|
120
|
+
children: [/* @__PURE__ */ l(m, {
|
|
121
|
+
htmlFor: "cos-draft-version",
|
|
122
|
+
children: "Version"
|
|
123
|
+
}), /* @__PURE__ */ l(p, {
|
|
124
|
+
id: "cos-draft-version",
|
|
125
|
+
value: A,
|
|
126
|
+
onChange: (e) => j(e.target.value)
|
|
127
|
+
})]
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ u("div", {
|
|
130
|
+
className: "space-y-1.5",
|
|
131
|
+
children: [/* @__PURE__ */ l(m, {
|
|
132
|
+
htmlFor: "cos-draft-license",
|
|
133
|
+
children: "License"
|
|
134
|
+
}), /* @__PURE__ */ l(p, {
|
|
135
|
+
id: "cos-draft-license",
|
|
136
|
+
value: P,
|
|
137
|
+
onChange: (e) => F(e.target.value)
|
|
138
|
+
})]
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ u("div", {
|
|
141
|
+
className: "space-y-1.5",
|
|
142
|
+
children: [/* @__PURE__ */ l(m, {
|
|
143
|
+
htmlFor: "cos-draft-authors",
|
|
144
|
+
children: "Authors (comma-separated)"
|
|
145
|
+
}), /* @__PURE__ */ l(p, {
|
|
146
|
+
id: "cos-draft-authors",
|
|
147
|
+
value: M,
|
|
148
|
+
onChange: (e) => N(e.target.value)
|
|
149
|
+
})]
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
w.licenseRationale ? /* @__PURE__ */ u("p", {
|
|
154
|
+
className: "text-xs text-text-tertiary",
|
|
155
|
+
children: ["License rationale: ", w.licenseRationale]
|
|
156
|
+
}) : null
|
|
157
|
+
]
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ l(a, {
|
|
160
|
+
method: w.method,
|
|
161
|
+
agentRunId: w.agentRunId,
|
|
162
|
+
generatedAt: w.generatedAt
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ u("div", {
|
|
165
|
+
className: "flex flex-wrap items-center gap-2 border-t border-border-default pt-4",
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ l(f, {
|
|
168
|
+
type: "button",
|
|
169
|
+
onClick: () => void V(),
|
|
170
|
+
disabled: L,
|
|
171
|
+
children: C ? "Creating draft…" : "Create draft release"
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ l(f, {
|
|
174
|
+
type: "button",
|
|
175
|
+
variant: "outline",
|
|
176
|
+
onClick: () => R(!1),
|
|
177
|
+
disabled: L,
|
|
178
|
+
children: "Discard"
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ l("span", {
|
|
181
|
+
className: "text-xs text-text-tertiary",
|
|
182
|
+
children: "Creates a DRAFT release only — publishing mints the persistent identifier and asks again."
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
})
|
|
186
|
+
] }) : null
|
|
187
|
+
]
|
|
188
|
+
}) : null;
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
export { g as ReleaseDraftDialog };
|
|
192
|
+
|
|
193
|
+
//# sourceMappingURL=ReleaseDraftDialog.js.map
|