@agent-native/core 0.0.0-beta-20260819175717 → 0.0.0-beta-20260819181349

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/corpus/README.md CHANGED
@@ -31,4 +31,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
31
31
 
32
32
  ## Generated Counts
33
33
 
34
- - template files: 8457
34
+ - template files: 8458
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: added
3
+ date: 2026-08-19
4
+ ---
5
+
6
+ Clips Nightly builds are available for trying the latest updates.
@@ -2,4 +2,5 @@
2
2
  type: fixed
3
3
  date: 2026-08-19
4
4
  ---
5
+
5
6
  Shared clips now show a video frame in social previews when no thumbnail is stored.
@@ -79,13 +79,28 @@ Clips registers itself to open at login by default, then runs quietly in the men
79
79
 
80
80
  ## Releases + auto-update
81
81
 
82
- Clips Desktop ships on its own release channel — tag prefix `clips-v*`, separate from the main `v*` tags used by `packages/desktop-app` (Electron). The in-app updater pulls its manifest from the hosted Clips endpoint (`/api/clips-updater.json`), which proxies the stable pointer release (`clips-latest`) when a signed manifest exists and otherwise returns a no-update manifest so end users do not see release-channel setup errors.
82
+ Clips Desktop has separate stable and Nightly lanes. The stable app keeps the
83
+ `Clips` name, `Clips` binary, `clips://` scheme, and `com.clips.tray` identifier;
84
+ its releases use `clips-v*` tags, the `clips-latest` updater pointer, and
85
+ `/api/clips-updater.json`. Nightly builds are named `Clips Nightly`, use the
86
+ `Clips-Nightly` binary, the `clips-nightly://` scheme, and
87
+ `com.clips.tray.nightly`. They use the `clips-nightly-v*` tags,
88
+ `clips-nightly-latest` pointer, and `/api/clips-updater.json?channel=nightly`.
89
+ The in-app updater only sees the pointer for the channel that produced the
90
+ installed app, and the separate native binary/desktop entry keeps both lanes
91
+ installable at once.
83
92
 
84
93
  ### Shipping a release
85
94
 
86
- 1. Bump `templates/clips/desktop/package.json` version (or pass it via workflow input).
87
- 2. Trigger **Clips Desktop Release** in GitHub Actions (`.github/workflows/clips-desktop-release.yml`). It builds macOS (universal), Windows, and Linux x86_64 installers, signs updater artifacts, and uploads them to `clips-v{version}`.
88
- 3. After all three platforms finish, the `publish-release` job flips the versioned release out of draft and refreshes the `clips-latest` pointer release with the new manifest. Installed macOS, Windows, and Linux AppImage copies auto-download it in the background on their next hourly or app-focus update check.
95
+ 1. For a stable release, dispatch **Clips Desktop Release** in GitHub Actions
96
+ with `channel: production` and an explicit version. Stable releases are
97
+ deliberate workflow runs; pushes to `main` never replace the stable lane.
98
+ 2. Pushes to `main` automatically build the Nightly lane. A Nightly run can
99
+ also be dispatched explicitly with `channel: nightly`.
100
+ 3. The workflow builds macOS (universal), Windows, and Linux x86_64 installers,
101
+ signs updater artifacts, and publishes the versioned release plus that
102
+ channel's pointer manifest. Installed copies auto-download only updates
103
+ from their own lane on the next hourly or app-focus check.
89
104
 
90
105
  ### Auto-update flow (inside the app)
91
106
 
@@ -15,8 +15,9 @@ crate-type = ["lib", "cdylib", "staticlib"]
15
15
 
16
16
  # Force the dev binary name so macOS shows "Clips" in the Dock / app switcher
17
17
  # (macOS derives the display name from the executable filename when the app
18
- # is unbundled — e.g. during `tauri dev`). Bundled .app builds read the name
19
- # from `productName` in tauri.conf.json instead.
18
+ # is unbundled — e.g. during `tauri dev`). The Nightly release workflow
19
+ # rewrites this target and tauri.conf.json's mainBinaryName to
20
+ # `Clips-Nightly` before packaging so both lanes can coexist.
20
21
  [[bin]]
21
22
  name = "Clips"
22
23
  path = "src/main.rs"
@@ -2,6 +2,7 @@
2
2
  "$schema": "https://schema.tauri.app/config/2",
3
3
  "productName": "Clips",
4
4
  "version": "0.1.1",
5
+ "mainBinaryName": "Clips",
5
6
  "identifier": "com.clips.tray",
6
7
  "build": {
7
8
  "beforeDevCommand": "pnpm vite:dev",
@@ -1,17 +1,23 @@
1
- import { defineEventHandler, setResponseHeaders } from "h3";
1
+ import { defineEventHandler, getQuery, setResponseHeaders } from "h3";
2
2
 
3
3
  /**
4
4
  * Tauri updater manifest endpoint for the Clips desktop app.
5
5
  *
6
6
  * The installed app only needs this endpoint to be valid JSON when no signed
7
- * updater bundle is available. If the `clips-latest` GitHub pointer release
8
- * exists, we proxy its signed manifest. If it does not, return a deliberately
9
- * old no-update manifest so the desktop UI stays quiet instead of surfacing a
7
+ * updater bundle is available. If the channel's GitHub pointer release exists,
8
+ * we proxy its signed manifest. If it does not, return a deliberately old
9
+ * no-update manifest so the desktop UI stays quiet instead of surfacing a
10
10
  * release-channel setup error to end users.
11
11
  */
12
12
 
13
- const GITHUB_MANIFEST_URL =
14
- "https://github.com/BuilderIO/agent-native/releases/download/clips-latest/clips-latest.json";
13
+ type ClipsUpdateChannel = "production" | "nightly";
14
+
15
+ const GITHUB_MANIFEST_URL: Record<ClipsUpdateChannel, string> = {
16
+ production:
17
+ "https://github.com/BuilderIO/agent-native/releases/download/clips-latest/clips-latest.json",
18
+ nightly:
19
+ "https://github.com/BuilderIO/agent-native/releases/download/clips-nightly-latest/clips-nightly-latest.json",
20
+ };
15
21
  const CACHE_TTL_MS = 5 * 60_000;
16
22
 
17
23
  // Tauri throws a red-banner error if the requesting client's target triple is
@@ -48,8 +54,8 @@ export const INERT_MANIFEST = {
48
54
  },
49
55
  };
50
56
 
51
- let cache: { data: unknown; ts: number } | null = null;
52
- let inFlight: Promise<unknown> | null = null;
57
+ const cache = new Map<ClipsUpdateChannel, { data: unknown; ts: number }>();
58
+ const inFlight = new Map<ClipsUpdateChannel, Promise<unknown>>();
53
59
 
54
60
  function isManifestLike(value: unknown): value is Record<string, unknown> {
55
61
  if (!value || typeof value !== "object") return false;
@@ -72,8 +78,10 @@ export function hasAllRequiredPlatforms(value: unknown): boolean {
72
78
  return REQUIRED_PLATFORM_KEYS.every((k) => k in platforms);
73
79
  }
74
80
 
75
- async function fetchSignedManifest(): Promise<unknown> {
76
- const res = await fetch(GITHUB_MANIFEST_URL, {
81
+ async function fetchSignedManifest(
82
+ channel: ClipsUpdateChannel,
83
+ ): Promise<unknown> {
84
+ const res = await fetch(GITHUB_MANIFEST_URL[channel], {
77
85
  headers: {
78
86
  accept: "application/json",
79
87
  "user-agent": "clips-updater-manifest",
@@ -94,38 +102,49 @@ async function fetchSignedManifest(): Promise<unknown> {
94
102
  return json;
95
103
  }
96
104
 
97
- async function getManifest(): Promise<unknown> {
105
+ function normalizeChannel(value: unknown): ClipsUpdateChannel {
106
+ return value === "nightly" ? "nightly" : "production";
107
+ }
108
+
109
+ async function getManifest(
110
+ channel: ClipsUpdateChannel = "production",
111
+ ): Promise<unknown> {
98
112
  const now = Date.now();
99
- if (cache && now - cache.ts < CACHE_TTL_MS) return cache.data;
100
- if (inFlight) return inFlight;
101
- inFlight = (async () => {
113
+ const cached = cache.get(channel);
114
+ if (cached && now - cached.ts < CACHE_TTL_MS) return cached.data;
115
+ const pending = inFlight.get(channel);
116
+ if (pending) return pending;
117
+ const request = (async () => {
102
118
  try {
103
- const data = await fetchSignedManifest();
104
- cache = { data, ts: Date.now() };
119
+ const data = await fetchSignedManifest(channel);
120
+ cache.set(channel, { data, ts: Date.now() });
105
121
  return data;
106
122
  } catch {
107
123
  // A validation or network failure may serve the last good manifest (or
108
124
  // inert fallback), but it must not make that fallback fresh again.
109
125
  // Otherwise an incomplete release manifest can indefinitely extend the
110
126
  // stale cache window on every failed refresh.
111
- return cache?.data ?? INERT_MANIFEST;
127
+ return cache.get(channel)?.data ?? INERT_MANIFEST;
112
128
  } finally {
113
- inFlight = null;
129
+ inFlight.delete(channel);
114
130
  }
115
131
  })();
116
- return inFlight;
132
+ inFlight.set(channel, request);
133
+ return request;
117
134
  }
118
135
 
119
136
  export const __clipsUpdaterTest = {
120
137
  getManifest,
121
138
  reset() {
122
- cache = null;
123
- inFlight = null;
139
+ cache.clear();
140
+ inFlight.clear();
124
141
  },
125
142
  };
126
143
 
127
144
  export default defineEventHandler(async (event) => {
128
- const manifest = await getManifest();
145
+ const query = getQuery(event);
146
+ const channel = normalizeChannel(query.channel);
147
+ const manifest = await getManifest(channel);
129
148
  setResponseHeaders(event, {
130
149
  "content-type": "application/json; charset=utf-8",
131
150
  "cache-control": "public, max-age=60",
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
62
62
  error: string;
63
63
  states?: undefined;
64
64
  } | {
65
+ error?: undefined;
65
66
  states: {
66
67
  clientId: number;
67
68
  state: string;
68
69
  }[];
69
- error?: undefined;
70
70
  }>>;
71
71
  /**
72
72
  * GET /_agent-native/collab/:docId/users
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
77
77
  error: string;
78
78
  users?: undefined;
79
79
  } | {
80
+ error?: undefined;
80
81
  users: {
81
82
  clientId: number;
82
83
  lastSeen: number;
83
84
  }[];
84
- error?: undefined;
85
85
  }>>;
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
26
26
  * Body: { update: string (base64), requestSource?: string }
27
27
  */
28
28
  export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
29
- ok?: undefined;
30
29
  error: string;
30
+ ok?: undefined;
31
31
  } | {
32
32
  error?: undefined;
33
33
  ok: boolean;
@@ -13,8 +13,8 @@
13
13
  * Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
14
14
  */
15
15
  export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
16
- error: string;
17
16
  ok?: undefined;
17
+ error: string;
18
18
  } | {
19
19
  error?: undefined;
20
20
  ok: boolean;
@@ -11,14 +11,14 @@
11
11
  * DELETE /_agent-native/notifications/:id — delete
12
12
  */
13
13
  export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
14
+ error?: undefined;
14
15
  count: number;
15
16
  updated?: undefined;
16
- error?: undefined;
17
17
  ok?: undefined;
18
18
  } | {
19
+ error?: undefined;
19
20
  count?: undefined;
20
21
  updated: number;
21
- error?: undefined;
22
22
  ok?: undefined;
23
23
  } | {
24
24
  count?: undefined;
@@ -26,8 +26,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
26
26
  error: string;
27
27
  ok?: undefined;
28
28
  } | {
29
+ error?: undefined;
29
30
  count?: undefined;
30
31
  updated?: undefined;
31
- error?: undefined;
32
32
  ok: boolean;
33
33
  }>>;
@@ -62,6 +62,6 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
62
62
  summary?: undefined;
63
63
  spans?: undefined;
64
64
  id?: undefined;
65
- error?: undefined;
66
65
  ok: boolean;
66
+ error?: undefined;
67
67
  }>>;
@@ -15,6 +15,6 @@ export declare function createProgressHandler(): import("h3").EventHandlerWithFe
15
15
  error: string;
16
16
  ok?: undefined;
17
17
  } | {
18
- ok: boolean;
19
18
  error?: undefined;
19
+ ok: boolean;
20
20
  }>>;
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
48
48
  }>;
49
49
  /** DELETE /_agent-native/resources/:id — delete a resource */
50
50
  export declare function handleDeleteResource(event: any): Promise<{
51
- error: string;
52
51
  ok?: undefined;
52
+ error: string;
53
53
  } | {
54
54
  error?: undefined;
55
55
  ok: boolean;
@@ -34,37 +34,37 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
34
34
  /** POST /_agent-native/secrets/:key — write a secret. */
35
35
  export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
36
36
  error: string;
37
- status?: undefined;
38
37
  ok?: undefined;
38
+ status?: undefined;
39
39
  } | {
40
+ error?: undefined;
40
41
  ok: boolean;
41
42
  status: string;
42
- error?: undefined;
43
43
  } | {
44
+ ok?: undefined;
44
45
  error: string;
45
46
  removed?: undefined;
46
- ok?: undefined;
47
47
  } | {
48
+ error?: undefined;
48
49
  ok: boolean;
49
50
  removed: boolean;
50
- error?: undefined;
51
51
  }>>;
52
52
  /**
53
53
  * POST /_agent-native/secrets/:key/test — validate an optional candidate value
54
54
  * or the current stored value without changing anything.
55
55
  */
56
56
  export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
57
+ ok?: undefined;
57
58
  error: string;
58
59
  note?: undefined;
59
- ok?: undefined;
60
60
  } | {
61
+ error?: undefined;
61
62
  ok: boolean;
62
63
  note?: undefined;
63
- error?: undefined;
64
64
  } | {
65
+ error?: undefined;
65
66
  ok: boolean;
66
67
  note: string;
67
- error?: undefined;
68
68
  } | {
69
69
  note?: undefined;
70
70
  ok: boolean;
@@ -95,11 +95,11 @@ export interface AdHocSecretPayload {
95
95
  export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
96
96
  error: string;
97
97
  } | {
98
+ error?: undefined;
98
99
  ok: boolean;
99
100
  key: string;
100
- error?: undefined;
101
101
  } | {
102
+ error?: undefined;
102
103
  ok: boolean;
103
104
  removed: boolean;
104
- error?: undefined;
105
105
  }>>;
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
26
26
  expiresAt?: undefined;
27
27
  ttlSeconds?: undefined;
28
28
  } | {
29
+ error?: undefined;
29
30
  token: string;
30
31
  expiresAt: string;
31
32
  ttlSeconds: number;
32
- error?: undefined;
33
33
  }>>;
@@ -20,6 +20,6 @@ export declare function createTranscribeVoiceHandler(): import("h3").EventHandle
20
20
  error: string;
21
21
  text?: undefined;
22
22
  } | {
23
- text: string;
24
23
  error?: undefined;
24
+ text: string;
25
25
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.0.0-beta-20260819175717",
3
+ "version": "0.0.0-beta-20260819181349",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {