@sanity/ailf-studio 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -556,13 +556,13 @@ interface ScoreItem {
556
556
  ceilingScore?: number;
557
557
  }
558
558
  /**
559
- * A single row in `ArtifactRef.entries[]`. W0051 adds optional `preview` +
559
+ * A single row in `StudioArtifactRef.entries[]`. W0051 adds optional `preview` +
560
560
  * `association` + `truncated` so list-view renderers can consume the
561
561
  * descriptor-extracted preview without fetching the external payload.
562
562
  * Older manifests (pre-W0051) carry only `{ key, bytes }`; readers treat
563
563
  * missing fields as absent data, not as errors.
564
564
  */
565
- interface ArtifactRefEntry {
565
+ interface StudioArtifactRefEntry {
566
566
  key: string;
567
567
  bytes: number;
568
568
  association?: Record<string, string | number>;
@@ -570,7 +570,7 @@ interface ArtifactRefEntry {
570
570
  preview?: unknown;
571
571
  }
572
572
  /** Reference to an artifact stored in an external object store. */
573
- interface ArtifactRef {
573
+ interface StudioArtifactRef {
574
574
  store: "gcs" | "local";
575
575
  bucket: string;
576
576
  path: string;
@@ -582,7 +582,7 @@ interface ArtifactRef {
582
582
  */
583
583
  layout?: "bulk" | "per-entry";
584
584
  /** Per-entry index (populated for `layout: "per-entry"` refs only). */
585
- entries?: ArtifactRefEntry[];
585
+ entries?: StudioArtifactRefEntry[];
586
586
  truncated?: boolean;
587
587
  preview?: unknown;
588
588
  /**
@@ -720,12 +720,12 @@ interface SummaryData {
720
720
  agentBehavior?: FeatureAgentBehaviorData[] | null;
721
721
  /** External artifact references — present when pipeline uploads to GCS (D0032) */
722
722
  artifactManifest?: {
723
- testOutputs?: ArtifactRef;
724
- renderedPrompts?: ArtifactRef;
725
- rawResults?: ArtifactRef;
726
- graderPrompts?: ArtifactRef;
727
- traces?: ArtifactRef;
728
- pipelineContext?: ArtifactRef;
723
+ testOutputs?: StudioArtifactRef;
724
+ renderedPrompts?: StudioArtifactRef;
725
+ rawResults?: StudioArtifactRef;
726
+ graderPrompts?: StudioArtifactRef;
727
+ traces?: StudioArtifactRef;
728
+ pipelineContext?: StudioArtifactRef;
729
729
  };
730
730
  belowCritical: string[];
731
731
  /** All Sanity documents used across the entire evaluation */
package/dist/index.js CHANGED
@@ -11,6 +11,9 @@ import { useClient } from "sanity";
11
11
  var API_VERSION = "2026-03-11";
12
12
  var isProduction = process.env.NODE_ENV === "production";
13
13
  var ARTIFACT_API_BASE_URL = isProduction ? "https://ailf-api.sanity.build/v1" : "http://localhost:3000/v1";
14
+ var ENV = globalThis.process?.env ?? {};
15
+ var REFERENCE_DATASET = ENV.SANITY_STUDIO_AILF_REF_DATASET ?? "next";
16
+ var REFERENCE_WORKSPACE = ENV.SANITY_STUDIO_AILF_REF_WORKSPACE ?? "editorial";
14
17
 
15
18
  // src/actions/ArchiveTaskAction.tsx
16
19
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -2634,6 +2637,11 @@ function ReleasePicker(props) {
2634
2637
  }
2635
2638
 
2636
2639
  // src/schema/task.ts
2640
+ function articleStudioUrl(document2) {
2641
+ const origin = typeof window !== "undefined" && window.location?.origin ? window.location.origin : "";
2642
+ const typePart = document2.type ? `;type=${document2.type}` : "";
2643
+ return `${origin}/${REFERENCE_WORKSPACE}/intent/edit/id=${document2.id}${typePart}/`;
2644
+ }
2637
2645
  var ASSERTION_TYPES = [
2638
2646
  { title: "LLM Rubric", value: "llm-rubric" },
2639
2647
  { title: "Contains", value: "contains" },
@@ -2811,13 +2819,30 @@ var taskSchema = defineType5({
2811
2819
  validation: (rule) => rule.required()
2812
2820
  }),
2813
2821
  // --- Article reference (Document mode) ---
2822
+ // Cross-dataset reference — `ailf.task` lives in the AILF private
2823
+ // dataset; `article` lives in the editorial dataset (REFERENCE_DATASET,
2824
+ // default `next`). See D0043.
2825
+ //
2826
+ // `weak: true` keeps AILF tasks publishable when the referenced
2827
+ // editorial article is retired or deleted — AILF's lifecycle is
2828
+ // independent of editorial content (D0043, spike Finding 16).
2814
2829
  defineField5({
2830
+ dataset: REFERENCE_DATASET,
2815
2831
  description: "The article this canonical doc entry points to. The pipeline resolves the slug, path, and _id from this reference.",
2816
2832
  hidden: ({ parent }) => parent?.refType === "perspective",
2817
2833
  name: "doc",
2834
+ studioUrl: articleStudioUrl,
2818
2835
  title: "Document",
2819
- to: [{ type: "article" }],
2820
- type: "reference"
2836
+ to: [
2837
+ {
2838
+ preview: {
2839
+ select: { subtitle: "slug.current", title: "title" }
2840
+ },
2841
+ type: "article"
2842
+ }
2843
+ ],
2844
+ type: "crossDatasetReference",
2845
+ weak: true
2821
2846
  }),
2822
2847
  // --- Path (hidden — only populated by mirrored YAML tasks) ---
2823
2848
  defineField5({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ailf-studio",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "AI Literacy Framework — Sanity Studio dashboard plugin",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -39,6 +39,7 @@
39
39
  "README.md"
40
40
  ],
41
41
  "devDependencies": {
42
+ "@sanity/client": "^7.3.0",
42
43
  "@sanity/icons": "^3.7.4",
43
44
  "@sanity/ui": "^3.1.13",
44
45
  "@testing-library/dom": "^10.4.1",