@openspecui/core 2.1.3 → 2.1.5

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.
@@ -0,0 +1,11 @@
1
+ //#region src/dashboard-display.d.ts
2
+ declare const DASHBOARD_RECENT_LIST_LIMIT = 10;
3
+ interface DashboardRecentListItem {
4
+ id: string;
5
+ updatedAt: number;
6
+ }
7
+ declare function compareDashboardItemsByUpdatedAt<T extends DashboardRecentListItem>(left: T, right: T): number;
8
+ declare function sortDashboardItemsByUpdatedAt<T extends DashboardRecentListItem>(items: readonly T[]): T[];
9
+ declare function selectRecentDashboardItems<T extends DashboardRecentListItem>(items: readonly T[], limit?: number): T[];
10
+ //#endregion
11
+ export { DASHBOARD_RECENT_LIST_LIMIT, DashboardRecentListItem, compareDashboardItemsByUpdatedAt, selectRecentDashboardItems, sortDashboardItemsByUpdatedAt };
@@ -0,0 +1,14 @@
1
+ //#region src/dashboard-display.ts
2
+ const DASHBOARD_RECENT_LIST_LIMIT = 10;
3
+ function compareDashboardItemsByUpdatedAt(left, right) {
4
+ return right.updatedAt - left.updatedAt || left.id.localeCompare(right.id);
5
+ }
6
+ function sortDashboardItemsByUpdatedAt(items) {
7
+ return [...items].sort(compareDashboardItemsByUpdatedAt);
8
+ }
9
+ function selectRecentDashboardItems(items, limit = DASHBOARD_RECENT_LIST_LIMIT) {
10
+ return sortDashboardItemsByUpdatedAt(items).slice(0, Math.max(0, Math.trunc(limit)));
11
+ }
12
+
13
+ //#endregion
14
+ export { DASHBOARD_RECENT_LIST_LIMIT, compareDashboardItemsByUpdatedAt, selectRecentDashboardItems, sortDashboardItemsByUpdatedAt };
@@ -1,2 +1,2 @@
1
- import { a as HostedBackendHealthResponse, c as buildHostedVersionManifestUrl, d as normalizeHostedAppBaseUrl, f as resolveHostedAppBaseUrl, i as HostedAppVersionManifest, l as isHostedAppVersionManifest, n as HostedAppChannelManifest, o as OFFICIAL_APP_BASE_URL, p as resolveHostedChannelForVersion, r as HostedAppCompatibilityEntry, s as buildHostedLaunchUrl, t as HostedAppChannelKind, u as isHostedBackendHealthResponse } from "./hosted-app-CY1XHUcf.mjs";
1
+ import { a as HostedBackendHealthResponse, c as buildHostedVersionManifestUrl, d as normalizeHostedAppBaseUrl, f as resolveHostedAppBaseUrl, i as HostedAppVersionManifest, l as isHostedAppVersionManifest, n as HostedAppChannelManifest, o as OFFICIAL_APP_BASE_URL, p as resolveHostedChannelForVersion, r as HostedAppCompatibilityEntry, s as buildHostedLaunchUrl, t as HostedAppChannelKind, u as isHostedBackendHealthResponse } from "./hosted-app-BP6Xje0B.mjs";
2
2
  export { HostedAppChannelKind, HostedAppChannelManifest, HostedAppCompatibilityEntry, HostedAppVersionManifest, HostedBackendHealthResponse, OFFICIAL_APP_BASE_URL, buildHostedLaunchUrl, buildHostedVersionManifestUrl, isHostedAppVersionManifest, isHostedBackendHealthResponse, normalizeHostedAppBaseUrl, resolveHostedAppBaseUrl, resolveHostedChannelForVersion };
@@ -1,3 +1,3 @@
1
- import { a as isHostedBackendHealthResponse, c as resolveHostedChannelForVersion, i as isHostedAppVersionManifest, n as buildHostedLaunchUrl, o as normalizeHostedAppBaseUrl, r as buildHostedVersionManifestUrl, s as resolveHostedAppBaseUrl, t as OFFICIAL_APP_BASE_URL } from "./hosted-app-Bn-MNDZ0.mjs";
1
+ import { a as isHostedBackendHealthResponse, c as resolveHostedChannelForVersion, i as isHostedAppVersionManifest, n as buildHostedLaunchUrl, o as normalizeHostedAppBaseUrl, r as buildHostedVersionManifestUrl, s as resolveHostedAppBaseUrl, t as OFFICIAL_APP_BASE_URL } from "./hosted-app-C1JDznip.mjs";
2
2
 
3
3
  export { OFFICIAL_APP_BASE_URL, buildHostedLaunchUrl, buildHostedVersionManifestUrl, isHostedAppVersionManifest, isHostedBackendHealthResponse, normalizeHostedAppBaseUrl, resolveHostedAppBaseUrl, resolveHostedChannelForVersion };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as HostedBackendHealthResponse, c as buildHostedVersionManifestUrl, d as normalizeHostedAppBaseUrl, f as resolveHostedAppBaseUrl, i as HostedAppVersionManifest, l as isHostedAppVersionManifest, n as HostedAppChannelManifest, o as OFFICIAL_APP_BASE_URL, p as resolveHostedChannelForVersion, r as HostedAppCompatibilityEntry, s as buildHostedLaunchUrl, t as HostedAppChannelKind, u as isHostedBackendHealthResponse } from "./hosted-app-CY1XHUcf.mjs";
2
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-k65bc8bW.mjs";
1
+ import { a as HostedBackendHealthResponse, c as buildHostedVersionManifestUrl, d as normalizeHostedAppBaseUrl, f as resolveHostedAppBaseUrl, i as HostedAppVersionManifest, l as isHostedAppVersionManifest, n as HostedAppChannelManifest, o as OFFICIAL_APP_BASE_URL, p as resolveHostedChannelForVersion, r as HostedAppCompatibilityEntry, s as buildHostedLaunchUrl, t as HostedAppChannelKind, u as isHostedBackendHealthResponse } from "./hosted-app-BP6Xje0B.mjs";
2
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-Cb-CVa6h.mjs";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { z } from "zod";
5
5
  import { EventEmitter } from "events";
@@ -306,11 +306,11 @@ declare const DeltaSpecSchema: z.ZodObject<{
306
306
  /** Raw markdown content of the delta spec */
307
307
  content: z.ZodString;
308
308
  }, "strip", z.ZodTypeAny, {
309
- specId: string;
310
309
  content: string;
311
- }, {
312
310
  specId: string;
311
+ }, {
313
312
  content: string;
313
+ specId: string;
314
314
  }>;
315
315
  type DeltaSpec = z.infer<typeof DeltaSpecSchema>;
316
316
  /**
@@ -488,11 +488,11 @@ declare const ChangeSchema: z.ZodObject<{
488
488
  /** Raw markdown content of the delta spec */
489
489
  content: z.ZodString;
490
490
  }, "strip", z.ZodTypeAny, {
491
- specId: string;
492
491
  content: string;
493
- }, {
494
492
  specId: string;
493
+ }, {
495
494
  content: string;
495
+ specId: string;
496
496
  }>, "many">>;
497
497
  /** Optional metadata */
498
498
  metadata: z.ZodOptional<z.ZodObject<{
@@ -549,8 +549,8 @@ declare const ChangeSchema: z.ZodObject<{
549
549
  } | undefined;
550
550
  design?: string | undefined;
551
551
  deltaSpecs?: {
552
- specId: string;
553
552
  content: string;
553
+ specId: string;
554
554
  }[] | undefined;
555
555
  }, {
556
556
  id: string;
@@ -596,8 +596,8 @@ declare const ChangeSchema: z.ZodObject<{
596
596
  } | undefined;
597
597
  design?: string | undefined;
598
598
  deltaSpecs?: {
599
- specId: string;
600
599
  content: string;
600
+ specId: string;
601
601
  }[] | undefined;
602
602
  }>;
603
603
  type Change = z.infer<typeof ChangeSchema>;
@@ -803,8 +803,8 @@ declare class OpenSpecAdapter {
803
803
  } | undefined;
804
804
  design?: string | undefined;
805
805
  deltaSpecs?: {
806
- specId: string;
807
806
  content: string;
807
+ specId: string;
808
808
  }[] | undefined;
809
809
  }[];
810
810
  archivedCount: number;
@@ -1906,14 +1906,14 @@ declare const ArtifactStatusSchema: z.ZodObject<{
1906
1906
  missingDeps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1907
1907
  relativePath: z.ZodOptional<z.ZodString>;
1908
1908
  }, "strip", z.ZodTypeAny, {
1909
- id: string;
1910
1909
  status: "done" | "ready" | "blocked";
1910
+ id: string;
1911
1911
  outputPath: string;
1912
1912
  missingDeps?: string[] | undefined;
1913
1913
  relativePath?: string | undefined;
1914
1914
  }, {
1915
- id: string;
1916
1915
  status: "done" | "ready" | "blocked";
1916
+ id: string;
1917
1917
  outputPath: string;
1918
1918
  missingDeps?: string[] | undefined;
1919
1919
  relativePath?: string | undefined;
@@ -1931,14 +1931,14 @@ declare const ChangeStatusSchema: z.ZodObject<{
1931
1931
  missingDeps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1932
1932
  relativePath: z.ZodOptional<z.ZodString>;
1933
1933
  }, "strip", z.ZodTypeAny, {
1934
- id: string;
1935
1934
  status: "done" | "ready" | "blocked";
1935
+ id: string;
1936
1936
  outputPath: string;
1937
1937
  missingDeps?: string[] | undefined;
1938
1938
  relativePath?: string | undefined;
1939
1939
  }, {
1940
- id: string;
1941
1940
  status: "done" | "ready" | "blocked";
1941
+ id: string;
1942
1942
  outputPath: string;
1943
1943
  missingDeps?: string[] | undefined;
1944
1944
  relativePath?: string | undefined;
@@ -1949,8 +1949,8 @@ declare const ChangeStatusSchema: z.ZodObject<{
1949
1949
  isComplete: boolean;
1950
1950
  applyRequires: string[];
1951
1951
  artifacts: {
1952
- id: string;
1953
1952
  status: "done" | "ready" | "blocked";
1953
+ id: string;
1954
1954
  outputPath: string;
1955
1955
  missingDeps?: string[] | undefined;
1956
1956
  relativePath?: string | undefined;
@@ -1961,8 +1961,8 @@ declare const ChangeStatusSchema: z.ZodObject<{
1961
1961
  isComplete: boolean;
1962
1962
  applyRequires: string[];
1963
1963
  artifacts: {
1964
- id: string;
1965
1964
  status: "done" | "ready" | "blocked";
1965
+ id: string;
1966
1966
  outputPath: string;
1967
1967
  missingDeps?: string[] | undefined;
1968
1968
  relativePath?: string | undefined;
@@ -1975,13 +1975,13 @@ declare const DependencyInfoSchema: z.ZodObject<{
1975
1975
  path: z.ZodString;
1976
1976
  description: z.ZodString;
1977
1977
  }, "strip", z.ZodTypeAny, {
1978
- id: string;
1979
1978
  path: string;
1979
+ id: string;
1980
1980
  description: string;
1981
1981
  done: boolean;
1982
1982
  }, {
1983
- id: string;
1984
1983
  path: string;
1984
+ id: string;
1985
1985
  description: string;
1986
1986
  done: boolean;
1987
1987
  }>;
@@ -2089,13 +2089,13 @@ declare const ArtifactInstructionsSchema: z.ZodObject<{
2089
2089
  path: z.ZodString;
2090
2090
  description: z.ZodString;
2091
2091
  }, "strip", z.ZodTypeAny, {
2092
- id: string;
2093
2092
  path: string;
2093
+ id: string;
2094
2094
  description: string;
2095
2095
  done: boolean;
2096
2096
  }, {
2097
- id: string;
2098
2097
  path: string;
2098
+ id: string;
2099
2099
  description: string;
2100
2100
  done: boolean;
2101
2101
  }>, "many">;
@@ -2109,8 +2109,8 @@ declare const ArtifactInstructionsSchema: z.ZodObject<{
2109
2109
  artifactId: string;
2110
2110
  template: string;
2111
2111
  dependencies: {
2112
- id: string;
2113
2112
  path: string;
2113
+ id: string;
2114
2114
  description: string;
2115
2115
  done: boolean;
2116
2116
  }[];
@@ -2127,8 +2127,8 @@ declare const ArtifactInstructionsSchema: z.ZodObject<{
2127
2127
  artifactId: string;
2128
2128
  template: string;
2129
2129
  dependencies: {
2130
- id: string;
2131
2130
  path: string;
2131
+ id: string;
2132
2132
  description: string;
2133
2133
  done: boolean;
2134
2134
  }[];
@@ -2174,8 +2174,8 @@ declare const SchemaResolutionSchema: z.ZodObject<{
2174
2174
  displayPath?: string | undefined;
2175
2175
  }>, "many">;
2176
2176
  }, "strip", z.ZodTypeAny, {
2177
- name: string;
2178
2177
  path: string;
2178
+ name: string;
2179
2179
  source: "project" | "user" | "package";
2180
2180
  shadows: {
2181
2181
  path: string;
@@ -2184,8 +2184,8 @@ declare const SchemaResolutionSchema: z.ZodObject<{
2184
2184
  }[];
2185
2185
  displayPath?: string | undefined;
2186
2186
  }, {
2187
- name: string;
2188
2187
  path: string;
2188
+ name: string;
2189
2189
  source: "project" | "user" | "package";
2190
2190
  shadows: {
2191
2191
  path: string;
@@ -2853,14 +2853,14 @@ declare const PtyErrorResponseSchema: z.ZodObject<{
2853
2853
  message: z.ZodString;
2854
2854
  sessionId: z.ZodOptional<z.ZodString>;
2855
2855
  }, "strip", z.ZodTypeAny, {
2856
+ type: "error";
2856
2857
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
2857
2858
  message: string;
2858
- type: "error";
2859
2859
  sessionId?: string | undefined;
2860
2860
  }, {
2861
+ type: "error";
2861
2862
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
2862
2863
  message: string;
2863
- type: "error";
2864
2864
  sessionId?: string | undefined;
2865
2865
  }>;
2866
2866
  declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -2991,14 +2991,14 @@ declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2991
2991
  message: z.ZodString;
2992
2992
  sessionId: z.ZodOptional<z.ZodString>;
2993
2993
  }, "strip", z.ZodTypeAny, {
2994
+ type: "error";
2994
2995
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
2995
2996
  message: string;
2996
- type: "error";
2997
2997
  sessionId?: string | undefined;
2998
2998
  }, {
2999
+ type: "error";
2999
3000
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
3000
3001
  message: string;
3001
- type: "error";
3002
3002
  sessionId?: string | undefined;
3003
3003
  }>]>;
3004
3004
  type PtyClientMessage = z.infer<typeof PtyClientMessageSchema>;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as isHostedBackendHealthResponse, c as resolveHostedChannelForVersion, i as isHostedAppVersionManifest, n as buildHostedLaunchUrl, o as normalizeHostedAppBaseUrl, r as buildHostedVersionManifestUrl, s as resolveHostedAppBaseUrl, t as OFFICIAL_APP_BASE_URL } from "./hosted-app-Bn-MNDZ0.mjs";
2
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-D-YbNUvQ.mjs";
1
+ import { a as isHostedBackendHealthResponse, c as resolveHostedChannelForVersion, i as isHostedAppVersionManifest, n as buildHostedLaunchUrl, o as normalizeHostedAppBaseUrl, r as buildHostedVersionManifestUrl, s as resolveHostedAppBaseUrl, t as OFFICIAL_APP_BASE_URL } from "./hosted-app-C1JDznip.mjs";
2
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-DDK7QA5y.mjs";
3
3
  import { mkdir, readFile, rename, writeFile } from "fs/promises";
4
4
  import { dirname, join } from "path";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1,2 +1,2 @@
1
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-k65bc8bW.mjs";
1
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-Cb-CVa6h.mjs";
2
2
  export { VIRTUAL_PROJECT_DIRNAME, toOpsxDisplayPath };
@@ -1,3 +1,3 @@
1
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-D-YbNUvQ.mjs";
1
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-DDK7QA5y.mjs";
2
2
 
3
3
  export { VIRTUAL_PROJECT_DIRNAME, toOpsxDisplayPath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openspecui/core",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Core OpenSpec adapter and parser",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -10,6 +10,10 @@
10
10
  "import": "./dist/index.mjs",
11
11
  "types": "./dist/index.d.mts"
12
12
  },
13
+ "./dashboard-display": {
14
+ "import": "./dist/dashboard-display.mjs",
15
+ "types": "./dist/dashboard-display.d.mts"
16
+ },
13
17
  "./hosted-app": {
14
18
  "import": "./dist/hosted-app.mjs",
15
19
  "types": "./dist/hosted-app.d.mts"
@@ -23,8 +27,8 @@
23
27
  "dist"
24
28
  ],
25
29
  "scripts": {
26
- "build": "tsdown src/index.ts src/opsx-display-path.ts src/hosted-app.ts --format esm --dts",
27
- "dev": "tsdown src/index.ts src/opsx-display-path.ts src/hosted-app.ts --format esm --dts --watch",
30
+ "build": "tsdown src/index.ts src/dashboard-display.ts src/opsx-display-path.ts src/hosted-app.ts --format esm --dts",
31
+ "dev": "tsdown src/index.ts src/dashboard-display.ts src/opsx-display-path.ts src/hosted-app.ts --format esm --dts --watch",
28
32
  "test": "vitest run",
29
33
  "test:watch": "vitest",
30
34
  "typecheck": "tsc --noEmit"