@happyvertical/smrt-content 0.43.9 → 0.43.10

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.
Files changed (46) hide show
  1. package/agents/content-list.md +69 -0
  2. package/dist/chunks/content-corrections-BxfA3tW1.js +107 -0
  3. package/dist/chunks/content-corrections-BxfA3tW1.js.map +1 -0
  4. package/dist/chunks/content-query-4w62u5_0.js +4092 -0
  5. package/dist/chunks/content-query-4w62u5_0.js.map +1 -0
  6. package/dist/chunks/content-reviews-BWrYEQc6.js +124 -0
  7. package/dist/chunks/content-reviews-BWrYEQc6.js.map +1 -0
  8. package/dist/chunks/content-versions-Di3vcTgb.js +284 -0
  9. package/dist/chunks/content-versions-Di3vcTgb.js.map +1 -0
  10. package/dist/chunks/contents-BV8RoP_R.js +612 -0
  11. package/dist/chunks/contents-BV8RoP_R.js.map +1 -0
  12. package/dist/chunks/rolldown-runtime-D7D4PA-g.js +13 -0
  13. package/dist/content-chat-handlers.d.ts +1 -1
  14. package/dist/content-chat-handlers.d.ts.map +1 -1
  15. package/dist/content-governance.d.ts +2 -0
  16. package/dist/content-governance.d.ts.map +1 -1
  17. package/dist/content.d.ts +2 -2
  18. package/dist/content.d.ts.map +1 -1
  19. package/dist/index.js +142 -4717
  20. package/dist/index.js.map +1 -1
  21. package/dist/manifest.json +142 -5
  22. package/dist/server/content-list-actions.d.ts +123 -0
  23. package/dist/server/content-list-actions.d.ts.map +1 -0
  24. package/dist/server.d.ts +6 -0
  25. package/dist/server.d.ts.map +1 -0
  26. package/dist/server.js +874 -0
  27. package/dist/server.js.map +1 -0
  28. package/dist/smrt-knowledge.json +96 -9
  29. package/dist/svelte/components/ContentList.svelte +1028 -24
  30. package/dist/svelte/components/ContentList.svelte.d.ts +3 -0
  31. package/dist/svelte/components/ContentList.svelte.d.ts.map +1 -1
  32. package/dist/svelte/content-list-controller.d.ts +3 -1
  33. package/dist/svelte/content-list-controller.d.ts.map +1 -1
  34. package/dist/svelte/content-list-controller.js +15 -1
  35. package/dist/svelte/content-list-workflows.d.ts +87 -0
  36. package/dist/svelte/content-list-workflows.d.ts.map +1 -0
  37. package/dist/svelte/content-list-workflows.js +199 -0
  38. package/dist/svelte/i18n.contribution.d.ts +109 -0
  39. package/dist/svelte/i18n.contribution.d.ts.map +1 -1
  40. package/dist/svelte/i18n.contribution.js +109 -0
  41. package/dist/svelte/index.d.ts +1 -0
  42. package/dist/svelte/index.d.ts.map +1 -1
  43. package/dist/svelte/index.js +2 -0
  44. package/package.json +19 -14
  45. package/dist/chunks/content-transparency-Bh6axaZj.js +0 -606
  46. package/dist/chunks/content-transparency-Bh6axaZj.js.map +0 -1
@@ -29,6 +29,7 @@ import { type ContentListDataSurface, type ContentListViewMode } from '../conten
29
29
  import { type ContentListQuerySource } from '../content-list-query.js';
30
30
  import { type ContentListJobBinding } from '../content-list-runtime.js';
31
31
  import { type ContentListSavedViewStore } from '../content-list-saved-views.js';
32
+ import { type ContentListWorkflowBinding } from '../content-list-workflows.js';
32
33
  interface Props {
33
34
  apiBaseUrl?: string;
34
35
  /**
@@ -65,6 +66,8 @@ interface Props {
65
66
  savedViews?: ContentListSavedViewStore;
66
67
  /** Shared background-workflow state. The same binding guards submissions. */
67
68
  jobs?: ContentListJobBinding;
69
+ /** Opt-in, authenticated preview/apply client for bulk workflows (#2453). */
70
+ workflows?: ContentListWorkflowBinding;
68
71
  }
69
72
  declare const ContentList: import("svelte").Component<Props, {}, "">;
70
73
  type ContentList = ReturnType<typeof ContentList>;
@@ -1 +1 @@
1
- {"version":3,"file":"ContentList.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentList.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,IAAI,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AACvG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACz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,7 @@ import type { ContentData } from '../mock-smrt-client.js';
20
20
  /** Stable surface identity for the default mounted content list. */
21
21
  export declare const CONTENT_LIST_SURFACE_ID = "content-list";
22
22
  /** Descriptor and view-state schema version owned by this adapter. */
23
- export declare const CONTENT_LIST_SCHEMA_VERSION = 1;
23
+ export declare const CONTENT_LIST_SCHEMA_VERSION = 2;
24
24
  /** Row identity column. Selection and expansion address rows by this value. */
25
25
  export declare const CONTENT_LIST_ROW_KEY = "id";
26
26
  /** Stable filter ids dispatched by the toolbar and accepted from a surface. */
@@ -103,6 +103,8 @@ export interface ContentListSurfaceDescriptorOptions {
103
103
  columnLabels?: ContentListColumnLabels;
104
104
  actionLabels?: ContentListActionLabels;
105
105
  limits?: Partial<DataSurfaceLimits>;
106
+ /** Publish bulk workflow actions only when the mounted list can execute them. */
107
+ includeWorkflows?: boolean;
106
108
  }
107
109
  /**
108
110
  * Opt-in agent addressability for the compact table. The host owns the
@@ -1 +1 @@
1
- {"version":3,"file":"content-list-controller.d.ts","sourceRoot":"","sources":["../../src/svelte/content-list-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAGxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,oEAAoE;AACpE,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAEtD,sEAAsE;AACtE,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,+EAA+E;AAC/E,eAAO,MAAM,2BAA2B,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AAG,IAAI,GACnB,IAAI,CAgBN;AAED,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,4BAAiC,GACzC,mBAAmB,CAkBrB;AAoOD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,cAAc,EAAE,EAC/B,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,eAAe,CAAC,cAAc,CAAC,EAA8B,GACrE,cAAc,EAAE,CAkDlB;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,SAAS,cAAc,EAAE,EAC/B,KAAK,EAAE,kBAAkB,GACxB,cAAc,EAAE,CAIlB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,GAAG,IAAI,GACpD,MAAM,GAAG,IAAI,CAQf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,cAAc,EACnB,OAAO,GAAE,wBAA6B,GACrC,mBAAmB,EAAE,CAOvB;AA2BD;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,mCAAwC,GAChD,qBAAqB,CAmEvB"}
1
+ {"version":3,"file":"content-list-controller.d.ts","sourceRoot":"","sources":["../../src/svelte/content-list-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAGxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,oEAAoE;AACpE,eAAO,MAAM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AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAST;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,mBAAmB,EAC/B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,IAAI,CAgBN;AAED,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,4BAAiC,GACzC,mBAAmB,CAkBrB;AAoOD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,cAAc,EAAE,EAC/B,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,eAAe,CAAC,cAAc,CAAC,EAA8B,GACrE,cAAc,EAAE,CAkDlB;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,SAAS,cAAc,EAAE,EAC/B,KAAK,EAAE,kBAAkB,GACxB,cAAc,EAAE,CAIlB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,GAAG,IAAI,GACpD,MAAM,GAAG,IAAI,CAQf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,cAAc,EACnB,OAAO,GAAE,wBAA6B,GACrC,mBAAmB,EAAE,CAOvB;AA2BD;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,mCAAwC,GAChD,qBAAqB,CAgFvB"}
@@ -16,10 +16,11 @@
16
16
  * that transform with a server query behind the same contract.
17
17
  */
18
18
  import { compareDataTableRowIds, createDataTableController, defaultSort, getNestedValue, } from '@happyvertical/smrt-ui/data';
19
+ import { CONTENT_LIST_WORKFLOW_OPTIONS } from './content-list-workflows.js';
19
20
  /** Stable surface identity for the default mounted content list. */
20
21
  export const CONTENT_LIST_SURFACE_ID = 'content-list';
21
22
  /** Descriptor and view-state schema version owned by this adapter. */
22
- export const CONTENT_LIST_SCHEMA_VERSION = 1;
23
+ export const CONTENT_LIST_SCHEMA_VERSION = 2;
23
24
  /** Row identity column. Selection and expansion address rows by this value. */
24
25
  export const CONTENT_LIST_ROW_KEY = 'id';
25
26
  /** Stable filter ids dispatched by the toolbar and accepted from a surface. */
@@ -894,6 +895,19 @@ export function buildContentListSurfaceDescriptor(options = {}) {
894
895
  selectionScopes: ['explicit-ids', 'current-page'],
895
896
  requiresConfirmation: true,
896
897
  },
898
+ ...(options.includeWorkflows
899
+ ? CONTENT_LIST_WORKFLOW_OPTIONS.map((workflow) => ({
900
+ id: workflow.id,
901
+ label: workflow.label,
902
+ sensitivity: workflow.sensitivity,
903
+ selectionScopes: [
904
+ 'current-page',
905
+ 'explicit-ids',
906
+ 'all-matching',
907
+ ],
908
+ requiresConfirmation: true,
909
+ }))
910
+ : []),
897
911
  ];
898
912
  return {
899
913
  version: 1,
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Browser contract for ContentList bulk workflows (#2453).
3
+ *
4
+ * The server implementation lives behind an application-owned route. This
5
+ * module deliberately mirrors its JSON contract without importing the Node
6
+ * adapter, so importing `@happyvertical/smrt-content/svelte` remains safe in a
7
+ * browser bundle.
8
+ */
9
+ import type { DataSurfaceActionResult, DataSurfaceIdentity, DataSurfaceJsonValue, DataSurfaceSelectionReference } from '@happyvertical/smrt-ui/data';
10
+ import type { ContentListDataQueryRequest } from './content-list-query.js';
11
+ export declare const CONTENT_LIST_WORKFLOW_IDS: readonly ["move-to-trash", "mark-draft", "submit-review", "publish", "archive", "restore", "automated-review", "format-body", "categorize", "optimize"];
12
+ export type ContentListWorkflowId = (typeof CONTENT_LIST_WORKFLOW_IDS)[number];
13
+ export interface ContentListWorkflowOption {
14
+ id: ContentListWorkflowId;
15
+ label: string;
16
+ execution: 'foreground' | 'background';
17
+ sensitivity: 'public' | 'sensitive';
18
+ }
19
+ /**
20
+ * Workflow choices with default English descriptor labels. ContentList maps
21
+ * their stable ids through its i18n catalog before rendering them.
22
+ */
23
+ export declare const CONTENT_LIST_WORKFLOW_OPTIONS: readonly ContentListWorkflowOption[];
24
+ export interface ContentListWorkflowRequest {
25
+ version: 1;
26
+ requestId: string;
27
+ identity: DataSurfaceIdentity;
28
+ actionId: ContentListWorkflowId;
29
+ phase: 'preview' | 'apply';
30
+ selection: DataSurfaceSelectionReference;
31
+ payload?: DataSurfaceJsonValue;
32
+ expectedRevision: number;
33
+ target: {
34
+ query?: ContentListDataQueryRequest;
35
+ expectedCount: number;
36
+ };
37
+ confirmationToken?: string;
38
+ idempotencyKey?: string;
39
+ }
40
+ export interface ContentListWorkflowClient {
41
+ preview(request: ContentListWorkflowRequest): Promise<DataSurfaceActionResult>;
42
+ apply(request: ContentListWorkflowRequest): Promise<DataSurfaceActionResult>;
43
+ /** Resolve a background job through the host's authenticated job runner. */
44
+ status?(jobId: string): Promise<ContentListWorkflowJobStatus>;
45
+ }
46
+ export interface ContentListWorkflowJobStatus {
47
+ jobId: string;
48
+ status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
49
+ /** Terminal row outcomes use the same partial-result contract as apply. */
50
+ result?: DataSurfaceActionResult;
51
+ reason?: string;
52
+ }
53
+ /** Opt-in workflow binding supplied to ContentList by an authenticated host. */
54
+ export interface ContentListWorkflowBinding {
55
+ client: ContentListWorkflowClient;
56
+ /** Server-owned surface revision expected by preview/apply. Defaults to zero. */
57
+ revision?: number;
58
+ /** Server action-selection cap used to gate all-matching UI. Defaults to 200. */
59
+ maxSelectionSize?: number;
60
+ /** Override the default mounted identity when the host uses another surface. */
61
+ identity?: DataSurfaceIdentity;
62
+ }
63
+ export interface ContentListWorkflowTransportOptions {
64
+ apiBaseUrl?: string;
65
+ /** Host route that dispatches the request by its `phase`. */
66
+ path?: string;
67
+ /** Optional authenticated job-status path. `{jobId}` is URL encoded. */
68
+ jobStatusPath?: string;
69
+ fetch?: typeof globalThis.fetch;
70
+ headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
71
+ credentials?: RequestCredentials;
72
+ }
73
+ export type ContentListWorkflowErrorReason = 'network_failure' | 'invalid_json' | 'http_error' | 'invalid_result' | 'invalid_job_status' | 'invalid_job_result';
74
+ export declare class ContentListWorkflowError extends Error {
75
+ readonly status?: number;
76
+ readonly reason: ContentListWorkflowErrorReason;
77
+ constructor(message: string, status?: number, reason?: ContentListWorkflowErrorReason);
78
+ }
79
+ /** Creates the shared human/agent preview/apply transport for a host route. */
80
+ export declare function createContentListWorkflowTransport(options?: ContentListWorkflowTransportOptions): ContentListWorkflowClient;
81
+ /** Reads an array-shaped row outcome list from a preview/apply result. */
82
+ export declare function contentListWorkflowOutcomes(result: DataSurfaceActionResult | null): Array<{
83
+ rowId: string | number;
84
+ status: 'accepted' | 'skipped' | 'failed';
85
+ reason?: string;
86
+ }>;
87
+ //# sourceMappingURL=content-list-workflows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-list-workflows.d.ts","sourceRoot":"","sources":["../../src/svelte/content-list-workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAE3E,eAAO,MAAM,yBAAyB,yJAW5B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,qBAAqB,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,YAAY,GAAG,YAAY,CAAC;IACvC,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC;CACrC;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS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AE,mBAAmB,CAAC;CAChC;AAED,MAAM,WAAW,mCAAmC;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,OAAO,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IACnE,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED,MAAM,MAAM,8BAA8B,GACtC,iBAAiB,GACjB,cAAc,GACd,YAAY,GACZ,gBAAgB,GAChB,oBAAoB,GACpB,oBAAoB,CAAC;AAEzB,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,8BAA8B,CAAC;gBAG9C,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,GAAE,8BAA6C;CAOxD;AA0BD,+EAA+E;AAC/E,wBAAgB,kCAAkC,CAChD,OAAO,GAAE,mCAAwC,GAChD,yBAAyB,CAqK3B;AAED,0EAA0E;AAC1E,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,uBAAuB,GAAG,IAAI,GACrC,KAAK,CAAC;IACP,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAmBD"}
@@ -0,0 +1,199 @@
1
+ /**
2
+ * Browser contract for ContentList bulk workflows (#2453).
3
+ *
4
+ * The server implementation lives behind an application-owned route. This
5
+ * module deliberately mirrors its JSON contract without importing the Node
6
+ * adapter, so importing `@happyvertical/smrt-content/svelte` remains safe in a
7
+ * browser bundle.
8
+ */
9
+ export const CONTENT_LIST_WORKFLOW_IDS = [
10
+ 'move-to-trash',
11
+ 'mark-draft',
12
+ 'submit-review',
13
+ 'publish',
14
+ 'archive',
15
+ 'restore',
16
+ 'automated-review',
17
+ 'format-body',
18
+ 'categorize',
19
+ 'optimize',
20
+ ];
21
+ /**
22
+ * Workflow choices with default English descriptor labels. ContentList maps
23
+ * their stable ids through its i18n catalog before rendering them.
24
+ */
25
+ export const CONTENT_LIST_WORKFLOW_OPTIONS = Object.freeze([
26
+ option('move-to-trash', 'Move to trash', 'foreground', 'sensitive'),
27
+ option('mark-draft', 'Mark draft'),
28
+ option('submit-review', 'Submit for review'),
29
+ option('publish', 'Publish', 'foreground', 'sensitive'),
30
+ option('archive', 'Archive'),
31
+ option('restore', 'Restore'),
32
+ option('automated-review', 'Automated review', 'background'),
33
+ option('format-body', 'Format body', 'background'),
34
+ option('categorize', 'Categorize'),
35
+ option('optimize', 'Optimize / complete', 'background'),
36
+ ]);
37
+ function option(id, label, execution = 'foreground', sensitivity = 'public') {
38
+ return { id, label, execution, sensitivity };
39
+ }
40
+ export class ContentListWorkflowError extends Error {
41
+ status;
42
+ reason;
43
+ constructor(message, status, reason = 'http_error') {
44
+ super(message);
45
+ this.name = 'ContentListWorkflowError';
46
+ this.status = status;
47
+ this.reason = reason;
48
+ }
49
+ }
50
+ function isRecord(value) {
51
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
52
+ }
53
+ function matchesIdentity(value, expected) {
54
+ if (!isRecord(value))
55
+ return false;
56
+ const subject = isRecord(value.subject) ? value.subject : undefined;
57
+ return (value.surfaceId === expected.surfaceId &&
58
+ value.kind === expected.kind &&
59
+ (expected.subject
60
+ ? subject?.type === expected.subject.type &&
61
+ subject.id === expected.subject.id
62
+ : value.subject === undefined));
63
+ }
64
+ function joinUrl(base, path) {
65
+ return `${base.replace(/\/+$/, '')}/${path.replace(/^\/+/, '')}`;
66
+ }
67
+ /** Creates the shared human/agent preview/apply transport for a host route. */
68
+ export function createContentListWorkflowTransport(options = {}) {
69
+ const fetchImpl = options.fetch ?? globalThis.fetch;
70
+ if (typeof fetchImpl !== 'function') {
71
+ throw new TypeError('createContentListWorkflowTransport requires a fetch implementation');
72
+ }
73
+ const url = joinUrl(options.apiBaseUrl ?? '/api/v1', options.path ?? 'contents/actions');
74
+ async function fetchJson(url, init) {
75
+ let response;
76
+ try {
77
+ response = await fetchImpl(url, init);
78
+ }
79
+ catch (error) {
80
+ throw new ContentListWorkflowError('The content workflow request failed.', undefined, 'network_failure');
81
+ }
82
+ let text;
83
+ try {
84
+ text = await response.text();
85
+ }
86
+ catch {
87
+ throw new ContentListWorkflowError('The content workflow response could not be read.', response.status, 'network_failure');
88
+ }
89
+ let payload;
90
+ try {
91
+ payload = text ? JSON.parse(text) : undefined;
92
+ }
93
+ catch {
94
+ throw new ContentListWorkflowError('The content workflow returned invalid JSON.', response.status, 'invalid_json');
95
+ }
96
+ if (!response.ok) {
97
+ const error = isRecord(payload) && isRecord(payload.error)
98
+ ? payload.error
99
+ : undefined;
100
+ throw new ContentListWorkflowError(typeof error?.message === 'string'
101
+ ? error.message
102
+ : `The content workflow failed with HTTP ${response.status}.`, response.status, 'http_error');
103
+ }
104
+ return payload;
105
+ }
106
+ async function buildHeaders(includeContentType) {
107
+ try {
108
+ const extraHeaders = typeof options.headers === 'function'
109
+ ? await options.headers()
110
+ : options.headers;
111
+ const headers = new Headers(extraHeaders);
112
+ if (includeContentType)
113
+ headers.set('content-type', 'application/json');
114
+ if (!headers.has('accept'))
115
+ headers.set('accept', 'application/json');
116
+ return headers;
117
+ }
118
+ catch {
119
+ throw new ContentListWorkflowError('The content workflow request could not be prepared.', undefined, 'network_failure');
120
+ }
121
+ }
122
+ async function invoke(request) {
123
+ const headers = await buildHeaders(true);
124
+ const payload = await fetchJson(url, {
125
+ method: 'POST',
126
+ headers,
127
+ body: JSON.stringify(request),
128
+ ...(options.credentials ? { credentials: options.credentials } : {}),
129
+ });
130
+ const result = isRecord(payload) && Object.hasOwn(payload, 'result')
131
+ ? payload.result
132
+ : payload;
133
+ if (!isRecord(result) ||
134
+ result.version !== 1 ||
135
+ typeof result.ok !== 'boolean' ||
136
+ result.requestId !== request.requestId ||
137
+ result.phase !== request.phase ||
138
+ result.actionId !== request.actionId ||
139
+ !matchesIdentity(result.identity, request.identity)) {
140
+ throw new ContentListWorkflowError('The content workflow returned an invalid result.', undefined, 'invalid_result');
141
+ }
142
+ return result;
143
+ }
144
+ const client = {
145
+ preview: invoke,
146
+ apply: invoke,
147
+ };
148
+ if (options.jobStatusPath) {
149
+ client.status = async (jobId) => {
150
+ const headers = await buildHeaders(false);
151
+ const path = options.jobStatusPath?.replace('{jobId}', encodeURIComponent(jobId));
152
+ const payload = await fetchJson(joinUrl(options.apiBaseUrl ?? '/api/v1', path ?? ''), {
153
+ method: 'GET',
154
+ headers,
155
+ ...(options.credentials ? { credentials: options.credentials } : {}),
156
+ });
157
+ const status = isRecord(payload) && isRecord(payload.job) ? payload.job : payload;
158
+ if (!isRecord(status) ||
159
+ typeof status.jobId !== 'string' ||
160
+ status.jobId !== jobId ||
161
+ !['queued', 'running', 'succeeded', 'failed', 'cancelled'].includes(String(status.status))) {
162
+ throw new ContentListWorkflowError('The content workflow returned an invalid job status.', undefined, 'invalid_job_status');
163
+ }
164
+ if (status.result !== undefined &&
165
+ (!isRecord(status.result) ||
166
+ status.result.version !== 1 ||
167
+ typeof status.result.ok !== 'boolean' ||
168
+ status.result.phase !== 'apply' ||
169
+ typeof status.result.requestId !== 'string' ||
170
+ typeof status.result.actionId !== 'string' ||
171
+ !isRecord(status.result.identity))) {
172
+ throw new ContentListWorkflowError('The content workflow returned an invalid job result.', undefined, 'invalid_job_result');
173
+ }
174
+ return status;
175
+ };
176
+ }
177
+ return client;
178
+ }
179
+ /** Reads an array-shaped row outcome list from a preview/apply result. */
180
+ export function contentListWorkflowOutcomes(result) {
181
+ const outcomes = result?.details?.outcomes;
182
+ if (!Array.isArray(outcomes))
183
+ return [];
184
+ return outcomes.flatMap((entry) => {
185
+ if (!isRecord(entry))
186
+ return [];
187
+ if ((typeof entry.rowId !== 'string' && typeof entry.rowId !== 'number') ||
188
+ !['accepted', 'skipped', 'failed'].includes(String(entry.status))) {
189
+ return [];
190
+ }
191
+ return [
192
+ {
193
+ rowId: entry.rowId,
194
+ status: entry.status,
195
+ ...(typeof entry.reason === 'string' ? { reason: entry.reason } : {}),
196
+ },
197
+ ];
198
+ });
199
+ }
@@ -85,6 +85,115 @@ export declare const M: {
85
85
  readonly 'content.content_list.job_failed': "content.content_list.job_failed";
86
86
  readonly 'content.content_list.job_progress': "content.content_list.job_progress";
87
87
  readonly 'content.content_list.retry_job': "content.content_list.retry_job";
88
+ readonly 'content.content_list.check_job': "content.content_list.check_job";
89
+ readonly 'content.content_list.select_all_matching': "content.content_list.select_all_matching";
90
+ readonly 'content.content_list.bulk_workflows': "content.content_list.bulk_workflows";
91
+ readonly 'content.content_list.bulk_workflow': "content.content_list.bulk_workflow";
92
+ readonly 'content.content_list.category_path': "content.content_list.category_path";
93
+ readonly 'content.content_list.restore_status': "content.content_list.restore_status";
94
+ readonly 'content.content_list.body_format': "content.content_list.body_format";
95
+ readonly 'content.content_list.review_kind': "content.content_list.review_kind";
96
+ readonly 'content.content_list.default_review_kind': "content.content_list.default_review_kind";
97
+ readonly 'content.content_list.review_policy_key': "content.content_list.review_policy_key";
98
+ readonly 'content.content_list.policy_key_optional': "content.content_list.policy_key_optional";
99
+ readonly 'content.content_list.optimization_instructions': "content.content_list.optimization_instructions";
100
+ readonly 'content.content_list.optimization_instructions_optional': "content.content_list.optimization_instructions_optional";
101
+ readonly 'content.content_list.job_queued_progress': "content.content_list.job_queued_progress";
102
+ readonly 'content.content_list.workflow_move_to_trash': "content.content_list.workflow_move_to_trash";
103
+ readonly 'content.content_list.workflow_mark_draft': "content.content_list.workflow_mark_draft";
104
+ readonly 'content.content_list.workflow_submit_review': "content.content_list.workflow_submit_review";
105
+ readonly 'content.content_list.workflow_publish': "content.content_list.workflow_publish";
106
+ readonly 'content.content_list.workflow_archive': "content.content_list.workflow_archive";
107
+ readonly 'content.content_list.workflow_restore': "content.content_list.workflow_restore";
108
+ readonly 'content.content_list.workflow_automated_review': "content.content_list.workflow_automated_review";
109
+ readonly 'content.content_list.workflow_format_body': "content.content_list.workflow_format_body";
110
+ readonly 'content.content_list.workflow_categorize': "content.content_list.workflow_categorize";
111
+ readonly 'content.content_list.workflow_optimize': "content.content_list.workflow_optimize";
112
+ readonly 'content.content_list.workflow_result_background': "content.content_list.workflow_result_background";
113
+ readonly 'content.content_list.workflow_result_summary': "content.content_list.workflow_result_summary";
114
+ readonly 'content.content_list.workflow_incomplete_outcomes': "content.content_list.workflow_incomplete_outcomes";
115
+ readonly 'content.content_list.workflow_preview_scope': "content.content_list.workflow_preview_scope";
116
+ readonly 'content.content_list.workflow_preview_count_one': "content.content_list.workflow_preview_count_one";
117
+ readonly 'content.content_list.workflow_preview_count_many': "content.content_list.workflow_preview_count_many";
118
+ readonly 'content.content_list.workflow_preview_examples': "content.content_list.workflow_preview_examples";
119
+ readonly 'content.content_list.workflow_preview_ineligible_count': "content.content_list.workflow_preview_ineligible_count";
120
+ readonly 'content.content_list.workflow_preview_ineligible': "content.content_list.workflow_preview_ineligible";
121
+ readonly 'content.content_list.workflow_consequence_trash': "content.content_list.workflow_consequence_trash";
122
+ readonly 'content.content_list.workflow_consequence_unpublished': "content.content_list.workflow_consequence_unpublished";
123
+ readonly 'content.content_list.workflow_consequence_review_queue': "content.content_list.workflow_consequence_review_queue";
124
+ readonly 'content.content_list.workflow_consequence_published': "content.content_list.workflow_consequence_published";
125
+ readonly 'content.content_list.workflow_consequence_leave_trash': "content.content_list.workflow_consequence_leave_trash";
126
+ readonly 'content.content_list.workflow_consequence_restore_published': "content.content_list.workflow_consequence_restore_published";
127
+ readonly 'content.content_list.workflow_consequence_review_result': "content.content_list.workflow_consequence_review_result";
128
+ readonly 'content.content_list.workflow_consequence_body_change': "content.content_list.workflow_consequence_body_change";
129
+ readonly 'content.content_list.workflow_consequence_category_change': "content.content_list.workflow_consequence_category_change";
130
+ readonly 'content.content_list.workflow_consequence_fields_change': "content.content_list.workflow_consequence_fields_change";
131
+ readonly 'content.content_list.workflow_consequence_unknown': "content.content_list.workflow_consequence_unknown";
132
+ readonly 'content.content_list.workflow_reason_not_deleted': "content.content_list.workflow_reason_not_deleted";
133
+ readonly 'content.content_list.workflow_reason_publish_readiness_failed': "content.content_list.workflow_reason_publish_readiness_failed";
134
+ readonly 'content.content_list.workflow_reason_deleted': "content.content_list.workflow_reason_deleted";
135
+ readonly 'content.content_list.workflow_reason_already_draft': "content.content_list.workflow_reason_already_draft";
136
+ readonly 'content.content_list.workflow_reason_requires_draft': "content.content_list.workflow_reason_requires_draft";
137
+ readonly 'content.content_list.workflow_reason_invalid_status': "content.content_list.workflow_reason_invalid_status";
138
+ readonly 'content.content_list.workflow_reason_already_archived': "content.content_list.workflow_reason_already_archived";
139
+ readonly 'content.content_list.workflow_reason_governance_unavailable': "content.content_list.workflow_reason_governance_unavailable";
140
+ readonly 'content.content_list.workflow_reason_review_policy_unavailable': "content.content_list.workflow_reason_review_policy_unavailable";
141
+ readonly 'content.content_list.workflow_reason_review_kind_mismatch': "content.content_list.workflow_reason_review_kind_mismatch";
142
+ readonly 'content.content_list.workflow_reason_handler_unavailable': "content.content_list.workflow_reason_handler_unavailable";
143
+ readonly 'content.content_list.workflow_reason_requires_draft_or_review': "content.content_list.workflow_reason_requires_draft_or_review";
144
+ readonly 'content.content_list.workflow_reason_not_found_or_denied': "content.content_list.workflow_reason_not_found_or_denied";
145
+ readonly 'content.content_list.workflow_reason_row_revision_drifted': "content.content_list.workflow_reason_row_revision_drifted";
146
+ readonly 'content.content_list.workflow_reason_permission_denied': "content.content_list.workflow_reason_permission_denied";
147
+ readonly 'content.content_list.workflow_reason_not_found': "content.content_list.workflow_reason_not_found";
148
+ readonly 'content.content_list.workflow_reason_stale_query_fingerprint': "content.content_list.workflow_reason_stale_query_fingerprint";
149
+ readonly 'content.content_list.workflow_reason_matching_count_drifted': "content.content_list.workflow_reason_matching_count_drifted";
150
+ readonly 'content.content_list.workflow_reason_limit_exceeded': "content.content_list.workflow_reason_limit_exceeded";
151
+ readonly 'content.content_list.workflow_reason_invalid_request': "content.content_list.workflow_reason_invalid_request";
152
+ readonly 'content.content_list.workflow_reason_invalid_payload': "content.content_list.workflow_reason_invalid_payload";
153
+ readonly 'content.content_list.workflow_reason_confirmation_required': "content.content_list.workflow_reason_confirmation_required";
154
+ readonly 'content.content_list.workflow_reason_stale_preview': "content.content_list.workflow_reason_stale_preview";
155
+ readonly 'content.content_list.workflow_reason_denied': "content.content_list.workflow_reason_denied";
156
+ readonly 'content.content_list.workflow_reason_unknown_permission': "content.content_list.workflow_reason_unknown_permission";
157
+ readonly 'content.content_list.workflow_reason_execution_failed': "content.content_list.workflow_reason_execution_failed";
158
+ readonly 'content.content_list.workflow_reason_idempotency_conflict': "content.content_list.workflow_reason_idempotency_conflict";
159
+ readonly 'content.content_list.workflow_reason_unknown': "content.content_list.workflow_reason_unknown";
160
+ readonly 'content.content_list.workflow_transport_network_failure': "content.content_list.workflow_transport_network_failure";
161
+ readonly 'content.content_list.workflow_transport_invalid_json': "content.content_list.workflow_transport_invalid_json";
162
+ readonly 'content.content_list.workflow_transport_http_error': "content.content_list.workflow_transport_http_error";
163
+ readonly 'content.content_list.workflow_transport_invalid_result': "content.content_list.workflow_transport_invalid_result";
164
+ readonly 'content.content_list.workflow_transport_invalid_job_status': "content.content_list.workflow_transport_invalid_job_status";
165
+ readonly 'content.content_list.workflow_transport_invalid_job_result': "content.content_list.workflow_transport_invalid_job_result";
166
+ readonly 'content.content_list.workflow_preview_mismatch': "content.content_list.workflow_preview_mismatch";
167
+ readonly 'content.content_list.workflow_preview_failed': "content.content_list.workflow_preview_failed";
168
+ readonly 'content.content_list.workflow_selection_changed': "content.content_list.workflow_selection_changed";
169
+ readonly 'content.content_list.workflow_apply_mismatch': "content.content_list.workflow_apply_mismatch";
170
+ readonly 'content.content_list.workflow_changed_applying': "content.content_list.workflow_changed_applying";
171
+ readonly 'content.content_list.workflow_failed': "content.content_list.workflow_failed";
172
+ readonly 'content.content_list.workflow_changed_checking_job': "content.content_list.workflow_changed_checking_job";
173
+ readonly 'content.content_list.workflow_job_still': "content.content_list.workflow_job_still";
174
+ readonly 'content.content_list.workflow_job_missing_result': "content.content_list.workflow_job_missing_result";
175
+ readonly 'content.content_list.workflow_job_wrong_workflow': "content.content_list.workflow_job_wrong_workflow";
176
+ readonly 'content.content_list.workflow_job_failed': "content.content_list.workflow_job_failed";
177
+ readonly 'content.content_list.workflow_job_status': "content.content_list.workflow_job_status";
178
+ readonly 'content.content_list.workflow_scope_explicit_ids': "content.content_list.workflow_scope_explicit_ids";
179
+ readonly 'content.content_list.workflow_scope_current_page': "content.content_list.workflow_scope_current_page";
180
+ readonly 'content.content_list.workflow_scope_all_matching': "content.content_list.workflow_scope_all_matching";
181
+ readonly 'content.content_list.workflow_status_cancelled': "content.content_list.workflow_status_cancelled";
182
+ readonly 'content.content_list.workflow_draft': "content.content_list.workflow_draft";
183
+ readonly 'content.content_list.workflow_review': "content.content_list.workflow_review";
184
+ readonly 'content.content_list.workflow_published': "content.content_list.workflow_published";
185
+ readonly 'content.content_list.workflow_markdown': "content.content_list.workflow_markdown";
186
+ readonly 'content.content_list.workflow_html': "content.content_list.workflow_html";
187
+ readonly 'content.content_list.workflow_facts': "content.content_list.workflow_facts";
188
+ readonly 'content.content_list.workflow_safety': "content.content_list.workflow_safety";
189
+ readonly 'content.content_list.workflow_custom': "content.content_list.workflow_custom";
190
+ readonly 'content.content_list.workflow_working': "content.content_list.workflow_working";
191
+ readonly 'content.content_list.workflow_job_queued': "content.content_list.workflow_job_queued";
192
+ readonly 'content.content_list.workflow_preview': "content.content_list.workflow_preview";
193
+ readonly 'content.content_list.workflow_confirm': "content.content_list.workflow_confirm";
194
+ readonly 'content.content_list.workflow_applying': "content.content_list.workflow_applying";
195
+ readonly 'content.content_list.workflow_apply': "content.content_list.workflow_apply";
196
+ readonly 'content.content_list.workflow_noun': "content.content_list.workflow_noun";
88
197
  readonly 'content.content_list.pagination': "content.content_list.pagination";
89
198
  readonly 'content.content_list.error_title': "content.content_list.error_title";
90
199
  readonly 'content.content_list.retry': "content.content_list.retry";
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.contribution.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.contribution.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+KZ,CAAC"}
1
+ {"version":3,"file":"i18n.contribution.d.ts","sourceRoot":"","sources":["../../src/svelte/i18n.contribution.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4UZ,CAAC"}