@ateam-ai-mobile/core 0.1.37 → 0.1.38
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.mts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/acs/api.ts +46 -0
- package/src/index.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ateam-ai-mobile/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
4
4
|
"description": "Headless ADAS SDK core — auth bridge, API client, chat/job streaming, MCP calls, theme tokens. No UI, no Expo dependencies.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/acs/api.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* DELETE /api/acs/artifacts/{id} — user-initiated retire (idempotent)
|
|
12
12
|
* PATCH /api/acs/artifacts/{id} — visibility + rename
|
|
13
13
|
* PUT /api/acs/order — drag-reorder
|
|
14
|
+
* GET /api/acs/launcher — where each of my widgets sits in the Apps grid
|
|
14
15
|
* GET /api/acs/home-actions — top-actions feed (+ PATCH/PUT order)
|
|
15
16
|
* WS topics acs.artifacts / acs.home-actions — cross-device sync (see ./ws)
|
|
16
17
|
*/
|
|
@@ -262,6 +263,51 @@ export async function recordEvent(
|
|
|
262
263
|
}
|
|
263
264
|
}
|
|
264
265
|
|
|
266
|
+
/** One of my widgets in the Apps grid: its plugin id (acs:art_… / actor_skills:…) and display name. */
|
|
267
|
+
export interface LauncherPlace {
|
|
268
|
+
id: string;
|
|
269
|
+
name?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** Where each of my widgets sits in the Apps grid. A widget in none of them lives in its chat. */
|
|
273
|
+
export interface LauncherPlaces {
|
|
274
|
+
mine: LauncherPlace[]; // My apps
|
|
275
|
+
resting: LauncherPlace[]; // the folded "Not used lately" row
|
|
276
|
+
hidden: string[]; // taken out of My apps by the person (✕)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Where each of my widgets sits in the Apps grid (GET /api/acs/launcher). The rule is the server's
|
|
281
|
+
* (ACS projection/launcherPlace.js) and the web's Apps panel reads the same answer. null when there
|
|
282
|
+
* is no answer: the picker then keeps its full list, so nothing disappears on a failed read.
|
|
283
|
+
*/
|
|
284
|
+
export async function fetchLauncherPlaces(): Promise<LauncherPlaces | null> {
|
|
285
|
+
try {
|
|
286
|
+
const res = await authedFetch('/api/acs/launcher', { method: 'GET' });
|
|
287
|
+
if (!res.ok) return null;
|
|
288
|
+
const data = await res.json();
|
|
289
|
+
if (!data?.ok) return null;
|
|
290
|
+
return {
|
|
291
|
+
mine: Array.isArray(data.mine) ? data.mine : [],
|
|
292
|
+
resting: Array.isArray(data.resting) ? data.resting : [],
|
|
293
|
+
hidden: Array.isArray(data.hidden) ? data.hidden : [],
|
|
294
|
+
};
|
|
295
|
+
} catch (e: any) {
|
|
296
|
+
console.warn('[acs] /launcher failed:', e?.message || e);
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The person opened one of their own ACS widgets themselves: a tile in the Apps grid ('apps') or
|
|
303
|
+
* its button in a chat ('chat'). That is what keeps it in (or brings it back to) My apps.
|
|
304
|
+
* Fire-and-forget; any other id is ignored (only ACS widgets fold when unused).
|
|
305
|
+
*/
|
|
306
|
+
export function recordWidgetOpen(pluginId: string, surface: 'apps' | 'chat'): void {
|
|
307
|
+
if (typeof pluginId !== 'string' || !pluginId.startsWith('acs:')) return;
|
|
308
|
+
void recordEvent(pluginId.slice(4), 'clicked', surface);
|
|
309
|
+
}
|
|
310
|
+
|
|
265
311
|
// ─── Home Actions (top-actions feed) ────────────────────────────────────
|
|
266
312
|
// Server-managed recommended-actions feed for the home "What's on your mind?"
|
|
267
313
|
// screen. The card universe is open + agent-authored; the only fixed contract
|
package/src/index.ts
CHANGED
|
@@ -228,6 +228,8 @@ export {
|
|
|
228
228
|
patchArtifact,
|
|
229
229
|
setOrder,
|
|
230
230
|
recordEvent,
|
|
231
|
+
fetchLauncherPlaces,
|
|
232
|
+
recordWidgetOpen,
|
|
231
233
|
listHomeActions,
|
|
232
234
|
patchHomeAction,
|
|
233
235
|
setHomeActionOrder,
|
|
@@ -238,6 +240,8 @@ export type {
|
|
|
238
240
|
AcsEvent,
|
|
239
241
|
AcsDeleteReason,
|
|
240
242
|
AcsPatchReason,
|
|
243
|
+
LauncherPlace,
|
|
244
|
+
LauncherPlaces,
|
|
241
245
|
DeleteResult,
|
|
242
246
|
PatchResult,
|
|
243
247
|
HomeAction,
|