@skaile/workspaces 0.33.0 → 0.35.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/CHANGELOG.md +62 -0
- package/dist/{asset-feeds-DX5JPM76.js → asset-feeds-PCLTE2W5.js} +20 -12
- package/dist/asset-feeds-PCLTE2W5.js.map +1 -0
- package/dist/asset-manager/index.js +8 -8
- package/dist/asset-manager/installer.js +7 -7
- package/dist/{chunk-PKPUVQJP.js → chunk-2Q6OY3SU.js} +3 -3
- package/dist/{chunk-PKPUVQJP.js.map → chunk-2Q6OY3SU.js.map} +1 -1
- package/dist/{chunk-LRFZNLB2.js → chunk-52HINMW4.js} +3 -3
- package/dist/{chunk-LRFZNLB2.js.map → chunk-52HINMW4.js.map} +1 -1
- package/dist/{chunk-AZODLVKH.js → chunk-56YT6CWS.js} +5 -5
- package/dist/{chunk-AZODLVKH.js.map → chunk-56YT6CWS.js.map} +1 -1
- package/dist/{chunk-RQG5TXIR.js → chunk-5DPQ766L.js} +4 -4
- package/dist/{chunk-RQG5TXIR.js.map → chunk-5DPQ766L.js.map} +1 -1
- package/dist/{chunk-BUMDC3R2.js → chunk-6422UOMQ.js} +5 -5
- package/dist/{chunk-BUMDC3R2.js.map → chunk-6422UOMQ.js.map} +1 -1
- package/dist/{chunk-XQRAXAL5.js → chunk-7B3CL5JT.js} +7 -7
- package/dist/{chunk-XQRAXAL5.js.map → chunk-7B3CL5JT.js.map} +1 -1
- package/dist/{chunk-LFDZYCEO.js → chunk-BM7XANVN.js} +2 -2
- package/dist/chunk-BM7XANVN.js.map +1 -0
- package/dist/{chunk-QUWXW2N3.js → chunk-EOCKR5TN.js} +3 -3
- package/dist/{chunk-QUWXW2N3.js.map → chunk-EOCKR5TN.js.map} +1 -1
- package/dist/{chunk-EJZFQCQG.js → chunk-I3TERDTR.js} +2 -2
- package/dist/{chunk-EJZFQCQG.js.map → chunk-I3TERDTR.js.map} +1 -1
- package/dist/{chunk-N74UQJPN.js → chunk-KYC6JH75.js} +3 -3
- package/dist/{chunk-N74UQJPN.js.map → chunk-KYC6JH75.js.map} +1 -1
- package/dist/{chunk-4AGIEU7V.js → chunk-MAPRKFBD.js} +3 -3
- package/dist/{chunk-4AGIEU7V.js.map → chunk-MAPRKFBD.js.map} +1 -1
- package/dist/{chunk-362QBS57.js → chunk-NAMD4AIK.js} +235 -13
- package/dist/chunk-NAMD4AIK.js.map +1 -0
- package/dist/{chunk-KKERAIPQ.js → chunk-O2OHGE4S.js} +4 -4
- package/dist/{chunk-KKERAIPQ.js.map → chunk-O2OHGE4S.js.map} +1 -1
- package/dist/{chunk-7MANNJ3U.js → chunk-O4PANZI2.js} +5 -5
- package/dist/{chunk-7MANNJ3U.js.map → chunk-O4PANZI2.js.map} +1 -1
- package/dist/{chunk-H5YXL4KI.js → chunk-SAXDHVJZ.js} +3 -3
- package/dist/{chunk-H5YXL4KI.js.map → chunk-SAXDHVJZ.js.map} +1 -1
- package/dist/{chunk-R2I7RHT7.js → chunk-SKVUDDHE.js} +191 -23
- package/dist/chunk-SKVUDDHE.js.map +1 -0
- package/dist/{chunk-PWXN2KHV.js → chunk-UAYAK7N4.js} +5 -5
- package/dist/{chunk-PWXN2KHV.js.map → chunk-UAYAK7N4.js.map} +1 -1
- package/dist/{chunk-PTDVTMQL.js → chunk-WEQN6EWW.js} +4 -4
- package/dist/{chunk-PTDVTMQL.js.map → chunk-WEQN6EWW.js.map} +1 -1
- package/dist/{chunk-VXW2K4YH.js → chunk-XOBPOVFT.js} +3 -3
- package/dist/{chunk-VXW2K4YH.js.map → chunk-XOBPOVFT.js.map} +1 -1
- package/dist/{chunk-4ZVS6KV4.js → chunk-ZGJE4ZDP.js} +2 -2
- package/dist/{chunk-4ZVS6KV4.js.map → chunk-ZGJE4ZDP.js.map} +1 -1
- package/dist/cli/index.js +196 -101
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/asset-feeds.d.ts +8 -1
- package/dist/cli/src/asset-feeds.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.d.ts +33 -22
- package/dist/cli/src/commands/manage.d.ts.map +1 -1
- package/dist/connectors/config.js +7 -7
- package/dist/connectors/index.js +8 -8
- package/dist/connectors/src/connector-manager.d.ts +56 -3
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/fleet-health-gate.d.ts +86 -0
- package/dist/connectors/src/fleet-health-gate.d.ts.map +1 -0
- package/dist/connectors/src/fleet-utils.d.ts +16 -0
- package/dist/connectors/src/fleet-utils.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +4 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors/src/mount-placeholder.d.ts +8 -0
- package/dist/connectors/src/mount-placeholder.d.ts.map +1 -1
- package/dist/core/index.js +6 -6
- package/dist/core/manifest.js +2 -2
- package/dist/core/models.js +1 -1
- package/dist/core/publish-manifest.js +2 -2
- package/dist/core/runtime-assets.js +5 -5
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/models.d.ts +28 -0
- package/dist/core/src/models.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +13 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +4 -4
- package/dist/deploy/index.js +6 -6
- package/dist/discovery/index.js +4 -4
- package/dist/{ensure-sources-O6RMWP6C.js → ensure-sources-HMMEQEZC.js} +11 -11
- package/dist/{ensure-sources-O6RMWP6C.js.map → ensure-sources-HMMEQEZC.js.map} +1 -1
- package/dist/factory-assets/connectors/deploy.js +8 -8
- package/dist/factory-assets/connectors/devserver.js +8 -8
- package/dist/factory-assets/connectors/flow/adapter.js +8 -8
- package/dist/factory-assets/connectors/flow/engine.js +6 -6
- package/dist/factory-assets/connectors/flow/run-flow.js +9 -9
- package/dist/factory-assets/connectors/flow.js +8 -8
- package/dist/factory-assets/connectors/git.js +8 -8
- package/dist/factory-assets/connectors/gmail.js +8 -8
- package/dist/factory-assets/connectors/googledrive.js +8 -8
- package/dist/factory-assets/connectors/local.js +8 -8
- package/dist/factory-assets/connectors/mattermost.js +8 -8
- package/dist/factory-assets/connectors/memory.js +8 -8
- package/dist/factory-assets/connectors/minio.js +8 -8
- package/dist/factory-assets/connectors/postgres.js +8 -8
- package/dist/factory-assets/connectors/s3.js +8 -8
- package/dist/factory-assets/connectors/sharepoint.js +8 -8
- package/dist/factory-assets/connectors/sqlite.js +8 -8
- package/dist/factory-assets/connectors/static-server.js +8 -8
- package/dist/factory-assets/connectors/tunnel.js +8 -8
- package/dist/factory-assets/connectors/webdav.js +8 -8
- package/dist/factory-assets/connectors/xstate-store.js +8 -8
- package/dist/factory-assets/connectors/xstate.js +8 -8
- package/dist/{flows-QWYIUDA2.js → flows-O7OXGFIY.js} +3 -3
- package/dist/{flows-QWYIUDA2.js.map → flows-O7OXGFIY.js.map} +1 -1
- package/dist/library/index.js +9 -9
- package/dist/library/install.js +7 -7
- package/dist/open-library-5WWTBHQD.js +23 -0
- package/dist/{open-library-B7BLYXYK.js.map → open-library-5WWTBHQD.js.map} +1 -1
- package/dist/paths-UC3ZHLKC.js +15 -0
- package/dist/{paths-5IUR235S.js.map → paths-UC3ZHLKC.js.map} +1 -1
- package/dist/{plugin-store-WWOJXWG7.js → plugin-store-R2WLXRT3.js} +8 -8
- package/dist/{plugin-store-WWOJXWG7.js.map → plugin-store-R2WLXRT3.js.map} +1 -1
- package/dist/runner/index.js +10 -10
- package/dist/runner/src/external-mcp.d.ts +45 -4
- package/dist/runner/src/external-mcp.d.ts.map +1 -1
- package/dist/runner/src/fleet-health-flag-dispatcher.d.ts +40 -0
- package/dist/runner/src/fleet-health-flag-dispatcher.d.ts.map +1 -0
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +8 -8
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +6 -6
- package/dist/sdk/index.js +10 -10
- package/dist/sdk/runner.js +10 -10
- package/dist/{setup-2RD6EDBZ.js → setup-BSDHVMR6.js} +8 -8
- package/dist/{setup-2RD6EDBZ.js.map → setup-BSDHVMR6.js.map} +1 -1
- package/dist/store-client-4GKV4LOD.js +15 -0
- package/dist/{store-client-XQQRHYDW.js.map → store-client-4GKV4LOD.js.map} +1 -1
- package/dist/tui/index.js +10 -10
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/asset-feeds-DX5JPM76.js.map +0 -1
- package/dist/chunk-362QBS57.js.map +0 -1
- package/dist/chunk-LFDZYCEO.js.map +0 -1
- package/dist/chunk-R2I7RHT7.js.map +0 -1
- package/dist/open-library-B7BLYXYK.js +0 -23
- package/dist/paths-5IUR235S.js +0 -15
- package/dist/store-client-XQQRHYDW.js +0 -15
package/dist/tui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createAgentSession } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { createAgentSession } from '../chunk-SKVUDDHE.js';
|
|
2
|
+
import '../chunk-ZGJE4ZDP.js';
|
|
3
3
|
import '../chunk-X5YPJV4N.js';
|
|
4
4
|
import '../chunk-O7SG5PC2.js';
|
|
5
5
|
import '../chunk-7QBNJTTQ.js';
|
|
@@ -14,20 +14,20 @@ import '../chunk-BMQKMOQY.js';
|
|
|
14
14
|
import '../chunk-NGJ6E344.js';
|
|
15
15
|
import '../chunk-CIFTUSBV.js';
|
|
16
16
|
import '../chunk-LV2HPH3C.js';
|
|
17
|
-
import '../chunk-
|
|
17
|
+
import '../chunk-NAMD4AIK.js';
|
|
18
18
|
import '../chunk-OVRSNIKJ.js';
|
|
19
|
-
import { loadConnectorDeclarations } from '../chunk-
|
|
19
|
+
import { loadConnectorDeclarations } from '../chunk-52HINMW4.js';
|
|
20
20
|
import '../chunk-XT6AZWK3.js';
|
|
21
21
|
import '../chunk-6E6PKKAD.js';
|
|
22
22
|
import '../chunk-X46FY45B.js';
|
|
23
23
|
import '../chunk-DEYYRFQU.js';
|
|
24
24
|
import '../chunk-IFGTRL2I.js';
|
|
25
|
-
import { resolveSettings } from '../chunk-
|
|
26
|
-
import '../chunk-
|
|
27
|
-
import { resolveAgentDir } from '../chunk-
|
|
28
|
-
import '../chunk-
|
|
29
|
-
import '../chunk-
|
|
30
|
-
import '../chunk-
|
|
25
|
+
import { resolveSettings } from '../chunk-2Q6OY3SU.js';
|
|
26
|
+
import '../chunk-5DPQ766L.js';
|
|
27
|
+
import { resolveAgentDir } from '../chunk-56YT6CWS.js';
|
|
28
|
+
import '../chunk-SAXDHVJZ.js';
|
|
29
|
+
import '../chunk-MAPRKFBD.js';
|
|
30
|
+
import '../chunk-BM7XANVN.js';
|
|
31
31
|
import '../chunk-XGCXFX7X.js';
|
|
32
32
|
import '../chunk-O4JH3KUE.js';
|
|
33
33
|
import '../chunk-K5GBV4SA.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flowList, flowShow, flowListSessions, flowGetSession, flowFindFlowForSession } from '../../chunk-
|
|
1
|
+
import { flowList, flowShow, flowListSessions, flowGetSession, flowFindFlowForSession } from '../../chunk-I3TERDTR.js';
|
|
2
2
|
import { skillList, skillListDomains, skillShow, skillSearch, skillCheckRequirements, skillGetPreamble } from '../../chunk-KY5NY7LB.js';
|
|
3
3
|
import '../../chunk-XCBG2KDC.js';
|
|
4
4
|
import { workspaceValidate, workspaceInfo, workspaceTestSecret, workspaceReload } from '../../chunk-ACXLKNIM.js';
|
|
@@ -74,7 +74,7 @@ function buildOmpToolSet(plugin) {
|
|
|
74
74
|
description: "List all available flow definitions from ai-assets.",
|
|
75
75
|
parameters: {},
|
|
76
76
|
handler: async () => {
|
|
77
|
-
const { flowList } = await import('../../flows-
|
|
77
|
+
const { flowList } = await import('../../flows-O7OXGFIY.js');
|
|
78
78
|
return (await flowList(plugin.projectDir)).content[0].text;
|
|
79
79
|
}
|
|
80
80
|
},
|
|
@@ -83,7 +83,7 @@ function buildOmpToolSet(plugin) {
|
|
|
83
83
|
description: "List past flow run sessions for this workspace.",
|
|
84
84
|
parameters: {},
|
|
85
85
|
handler: async () => {
|
|
86
|
-
const { flowListSessions } = await import('../../flows-
|
|
86
|
+
const { flowListSessions } = await import('../../flows-O7OXGFIY.js');
|
|
87
87
|
return (await flowListSessions(plugin.projectDir)).content[0].text;
|
|
88
88
|
}
|
|
89
89
|
},
|
|
@@ -201,7 +201,7 @@ async function handleSlashCommand(plugin, group, args) {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
async function handleFlowCommand(plugin, sub, rest) {
|
|
204
|
-
const { flowList, flowShow, flowListSessions, flowGetSession } = await import('../../flows-
|
|
204
|
+
const { flowList, flowShow, flowListSessions, flowGetSession } = await import('../../flows-O7OXGFIY.js');
|
|
205
205
|
if (!sub || sub === "list") return (await flowList(plugin.projectDir)).content[0].text;
|
|
206
206
|
if (sub === "show" && rest[0])
|
|
207
207
|
return (await flowShow(plugin.projectDir, rest[0])).content[0].text;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-
|
|
1
|
+
export { PluginStore, WorkspacePlugin, buildClaudePluginFiles, resolveProjectDir } from '../chunk-ZGJE4ZDP.js';
|
|
2
2
|
export { err, ok, okJson } from '../chunk-X5YPJV4N.js';
|
|
3
3
|
import '../chunk-JB35MVBN.js';
|
|
4
4
|
import '../chunk-NSBPE2FW.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skaile/workspaces",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Skaile workspaces runtime — types, core, bridge, runner, store, connectors, and supporting layers as one publishable package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "bun@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AI,CAAC,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA,EAAG;AACvB,MAAA,KAAA,CAAM,KAAK,EAAE,IAAA,EAAM,OAAA,EAAS,OAAA,EAAS,KAAK,CAAA;AAAA,IAC5C;AACA,IAAA,OAAO,EAAE,OAAA,EAAS,EAAC,EAAG,KAAA,EAAM;AAAA,EAC9B;AACF;AAQA,SAAS,aAAa,EAAA,EAAsD;AAC1E,EAAA,OAAO,GAAG,MAAA,EAAO;AACnB;AAGA,SAAS,GAAA,CAAI,QAAqB,OAAA,EAAwC;AACxE,EAAA,OAAO,QAAQ,GAAA,CAAI,CAAC,WAAW,EAAE,MAAA,EAAQ,OAAM,CAAE,CAAA;AACnD;AAQA,eAAsB,gBAAA,CACpB,IACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,CAAC,IAAA,EAAM,KAAK,CAAA,GAAI,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,GAAA,CAAI,QAAA,EAAU,YAAA,CAAa,EAAE,CAAC,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,SAAA,EAAW,IAAA,CAAK,OAAO,CAAA;AAAA,MAC9B,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;AAAA,KAC/B;AAAA,IACA,OAAO,CAAC,GAAG,KAAK,KAAA,EAAO,GAAG,MAAM,KAAK;AAAA,GACvC;AACF","file":"asset-feeds-DX5JPM76.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Three feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport { type AssetKind, type CatalogEntry, scanRepo } from \"@skaile/workspaces/core\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n notes: FeedNote[];\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and tagged with\n * `repository = \"library:<name>\"` so the manage TUI groups them into their\n * own headers.\n */\nasync function libraryAssets(): Promise<{ entries: CatalogEntry[]; notes: FeedNote[] }> {\n const notes: FeedNote[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n const sourcesDir = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter((l) => !l.path.startsWith(sourcesDir));\n const entries: CatalogEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n for (const e of scanRepo(lib.path, `library:${lib.name}`)) {\n entries.push(e);\n }\n }\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n return { entries, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], notes };\n }\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map. Provided as a\n * function rather than an inline call so the caller can supply a fresh\n * `AssetManager` instance.\n */\nfunction sourceAssets(am: { search: () => CatalogEntry[] }): CatalogEntry[] {\n return am.search();\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all three feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk.\n */\nexport async function gatherAssetFeeds(\n am: { search: () => CatalogEntry[] },\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n return {\n entries: [\n ...tag(\"source\", sourceAssets(am)),\n ...tag(\"library\", libs.entries),\n ...tag(\"store\", store.entries),\n ],\n notes: [...libs.notes, ...store.notes],\n };\n}\n"]}
|