@slycode/slycode 0.2.5 → 0.2.7
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/messaging/index.js +9 -2
- package/dist/messaging/index.js.map +1 -1
- package/dist/messaging/stt.d.ts +3 -1
- package/dist/messaging/stt.js +76 -0
- package/dist/messaging/stt.js.map +1 -1
- package/dist/messaging/types.d.ts +3 -1
- package/dist/scripts/scaffold.js +3 -2
- package/dist/web/.next/BUILD_ID +1 -1
- package/dist/web/.next/build-manifest.json +4 -4
- package/dist/web/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/dist/web/.next/server/app/_global-error/page.js +1 -1
- package/dist/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/_global-error.html +2 -2
- package/dist/web/.next/server/app/_global-error.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/dist/web/.next/server/app/_not-found/page.js +1 -1
- package/dist/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/_not-found.html +1 -1
- package/dist/web/.next/server/app/_not-found.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/web/.next/server/app/api/cli-assets/fix/route.js +1 -1
- package/dist/web/.next/server/app/api/cli-assets/fix/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/cli-assets/import/route.js +1 -1
- package/dist/web/.next/server/app/api/cli-assets/import/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/cli-assets/route.js +1 -1
- package/dist/web/.next/server/app/api/cli-assets/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/cli-assets/store/preview/route.js +1 -1
- package/dist/web/.next/server/app/api/cli-assets/store/preview/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/cli-assets/store/route.js +1 -1
- package/dist/web/.next/server/app/api/cli-assets/store/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/cli-assets/sync/route.js +1 -1
- package/dist/web/.next/server/app/api/cli-assets/sync/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/cli-assets/updates/route.js +1 -1
- package/dist/web/.next/server/app/api/cli-assets/updates/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/dashboard/route.js +1 -1
- package/dist/web/.next/server/app/api/dashboard/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/file/route.js +1 -1
- package/dist/web/.next/server/app/api/file/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/git-status/route.js +1 -1
- package/dist/web/.next/server/app/api/git-status/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/kanban/route.js +1 -1
- package/dist/web/.next/server/app/api/kanban/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/kanban/stream/route.js +1 -1
- package/dist/web/.next/server/app/api/kanban/stream/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/projects/[id]/route.js +1 -1
- package/dist/web/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/projects/reorder/route.js +1 -1
- package/dist/web/.next/server/app/api/projects/reorder/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/projects/route.js +1 -1
- package/dist/web/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/scheduler/route.js +1 -1
- package/dist/web/.next/server/app/api/scheduler/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/search/route.js +1 -1
- package/dist/web/.next/server/app/api/search/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/sly-actions/invalidate/route.js +1 -1
- package/dist/web/.next/server/app/api/sly-actions/invalidate/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/sly-actions/route.js +1 -1
- package/dist/web/.next/server/app/api/sly-actions/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/sly-actions/stream/route.js +1 -1
- package/dist/web/.next/server/app/api/sly-actions/stream/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/api/transcribe/route.js +5 -2
- package/dist/web/.next/server/app/api/transcribe/route.js.nft.json +1 -1
- package/dist/web/.next/server/app/page/build-manifest.json +2 -2
- package/dist/web/.next/server/app/page.js +2 -2
- package/dist/web/.next/server/app/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/app/project/[id]/page/build-manifest.json +2 -2
- package/dist/web/.next/server/app/project/[id]/page.js +2 -2
- package/dist/web/.next/server/app/project/[id]/page.js.nft.json +1 -1
- package/dist/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
- package/dist/web/.next/server/chunks/[externals]__c6831f39._.js +3 -0
- package/dist/web/.next/server/chunks/[externals]_node:async_hooks_b485b2a4._.js +3 -0
- package/dist/web/.next/server/chunks/[externals]_node:http_c3a9e25f._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__0234f869._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__0f8687da._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__104b2da3._.js +4 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__12f6cd6f._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__15fc9266._.js +18 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__1cdc76ef._.js +3 -0
- package/dist/web/.next/server/chunks/{[root-of-the-server]__933e6077._.js → [root-of-the-server]__1ec21ccc._.js} +2 -2
- package/dist/web/.next/server/chunks/[root-of-the-server]__279e9bf3._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__2d1f0ed9._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__3998d59e._.js +19 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__3c5ef8ec._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__3dc5531f._.js +5 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__403750fd._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__41df0777._.js +3 -0
- package/dist/web/.next/server/chunks/{[root-of-the-server]__b9e7d34c._.js → [root-of-the-server]__4244617a._.js} +2 -2
- package/dist/web/.next/server/chunks/[root-of-the-server]__47dd878e._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__5e08b942._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__71bb3374._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__7603305e._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__7c476ad6._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__846ca56f._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__934c9bb4._.js +5 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__98d88050._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__b273cc05._.js +3 -0
- package/dist/web/.next/server/chunks/{[root-of-the-server]__bc55c42a._.js → [root-of-the-server]__d0f4efec._.js} +2 -2
- package/dist/web/.next/server/chunks/[root-of-the-server]__d6362272._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__de1277ee._.js +27 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__e00fb85f._.js +9 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__e4988941._.js +4 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__f3e501b6._.js +3 -0
- package/dist/web/.next/server/chunks/[root-of-the-server]__f97e93fa._.js +6 -0
- package/dist/web/.next/server/chunks/a9bf9_@aws-sdk_core_dist-es_submodules_protocols_json_AwsRestJsonProtocol_764d7a83.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_@aws-sdk_credential-provider-env_dist-es_index_55d96139.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_6712dec9.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_@aws-sdk_nested-clients_dist-es_submodules_sso-oidc_index_df09d547.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_@aws-sdk_nested-clients_dist-es_submodules_sts_index_c78619b3.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_@smithy_core_dist-es_submodules_event-streams_index_73e35402.js +3 -0
- package/dist/web/.next/server/chunks/node_modules_ec9ae6c4._.js +18 -0
- package/dist/web/.next/server/chunks/src_677020aa._.js +1 -1
- package/dist/web/.next/server/chunks/ssr/[root-of-the-server]__077f472c._.js +3 -0
- package/dist/web/.next/server/chunks/ssr/{[root-of-the-server]__977b1a68._.js → [root-of-the-server]__0841f0b5._.js} +2 -2
- package/dist/web/.next/server/chunks/ssr/[root-of-the-server]__1f5fc489._.js +9 -0
- package/dist/web/.next/server/chunks/ssr/[root-of-the-server]__2f64210a._.js +3 -0
- package/dist/web/.next/server/chunks/ssr/{[root-of-the-server]__d57c94e0._.js → [root-of-the-server]__92021d33._.js} +2 -2
- package/dist/web/.next/server/chunks/ssr/{[root-of-the-server]__e0032864._.js → [root-of-the-server]__9ac6ea25._.js} +2 -2
- package/dist/web/.next/server/chunks/ssr/{[root-of-the-server]__677b7660._.js → [root-of-the-server]__bcbe4bf2._.js} +2 -2
- package/dist/web/.next/server/chunks/ssr/{[root-of-the-server]__6db27fe1._.js → [root-of-the-server]__dfe2728c._.js} +2 -2
- package/dist/web/.next/server/chunks/ssr/src_lib_registry_ts_2fc87c9c._.js +1 -1
- package/dist/web/.next/server/middleware-build-manifest.js +2 -2
- package/dist/web/.next/server/pages/404.html +1 -1
- package/dist/web/.next/server/pages/500.html +2 -2
- package/dist/web/.next/static/chunks/0bab8c7c82cef548.js +4 -0
- package/dist/web/.next/static/chunks/{b694f741bb34ac84.js → 1b46e836090e130b.js} +1 -1
- package/dist/web/.next/static/chunks/{ef0dc6461e9250d8.js → cf910fc299170b7d.js} +2 -2
- package/dist/web/.next/static/chunks/{turbopack-4964158913ad5e72.js → turbopack-563e27abda63930f.js} +2 -2
- package/dist/web/package-lock.json +1589 -155
- package/dist/web/package.json +1 -0
- package/dist/web/src/app/api/transcribe/route.ts +96 -1
- package/dist/web/src/lib/store-scanner.ts +8 -69
- package/dist/web/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/templates/kanban-seed.json +1 -1
- package/dist/web/.next/server/chunks/[externals]__65615fd8._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__46b023d4._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__4c7995bf._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__4d0d3464._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__6d330d40._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__884d73e4._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__8ab096a3._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__9058a007._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__949bb248._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__aa814a86._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__ad64e04f._.js +0 -27
- package/dist/web/.next/server/chunks/[root-of-the-server]__baa99257._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__bbb4b3ac._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__bf286c26._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__d219e3f0._.js +0 -18
- package/dist/web/.next/server/chunks/[root-of-the-server]__d38c7a96._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__e9b0e744._.js +0 -3
- package/dist/web/.next/server/chunks/[root-of-the-server]__f1fe18e6._.js +0 -6
- package/dist/web/.next/server/chunks/[root-of-the-server]__f4124388._.js +0 -3
- package/dist/web/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_ffc6c790.js +0 -11
- package/dist/web/.next/server/chunks/ssr/[root-of-the-server]__73cfc6bb._.js +0 -3
- package/dist/web/.next/server/chunks/ssr/[root-of-the-server]__79c0188d._.js +0 -9
- package/dist/web/.next/server/chunks/ssr/[root-of-the-server]__bb807bcf._.js +0 -3
- package/dist/web/.next/static/chunks/7660448872d80e27.js +0 -4
- /package/dist/web/.next/static/{Ky5DLflBRa2FbKsyhH40R → LL2KFMFJkFiDQbYtgqSpv}/_buildManifest.js +0 -0
- /package/dist/web/.next/static/{Ky5DLflBRa2FbKsyhH40R → LL2KFMFJkFiDQbYtgqSpv}/_clientMiddlewareManifest.json +0 -0
- /package/dist/web/.next/static/{Ky5DLflBRa2FbKsyhH40R → LL2KFMFJkFiDQbYtgqSpv}/_ssgManifest.js +0 -0
package/dist/web/package.json
CHANGED
|
@@ -4,8 +4,16 @@ import { promises as fs } from 'fs';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { execFile } from 'child_process';
|
|
6
6
|
import { getSlycodeRoot } from '@/lib/paths';
|
|
7
|
+
import {
|
|
8
|
+
TranscribeStreamingClient,
|
|
9
|
+
StartStreamTranscriptionCommand,
|
|
10
|
+
type AudioStream,
|
|
11
|
+
type LanguageCode,
|
|
12
|
+
type MediaEncoding,
|
|
13
|
+
} from '@aws-sdk/client-transcribe-streaming';
|
|
7
14
|
|
|
8
15
|
let openaiClient: OpenAI | null = null;
|
|
16
|
+
let transcribeClient: TranscribeStreamingClient | null = null;
|
|
9
17
|
let envLoaded = false;
|
|
10
18
|
let envCache: Record<string, string> = {};
|
|
11
19
|
|
|
@@ -41,6 +49,13 @@ async function getClient(): Promise<OpenAI> {
|
|
|
41
49
|
return openaiClient;
|
|
42
50
|
}
|
|
43
51
|
|
|
52
|
+
function getTranscribeClient(region?: string): TranscribeStreamingClient {
|
|
53
|
+
if (!transcribeClient) {
|
|
54
|
+
transcribeClient = new TranscribeStreamingClient(region ? { region } : {});
|
|
55
|
+
}
|
|
56
|
+
return transcribeClient;
|
|
57
|
+
}
|
|
58
|
+
|
|
44
59
|
function execAsync(cmd: string, args: string[], options: Record<string, unknown>): Promise<string> {
|
|
45
60
|
return new Promise((resolve, reject) => {
|
|
46
61
|
execFile(cmd, args, { ...options, windowsHide: true }, (error, stdout, stderr) => {
|
|
@@ -76,6 +91,78 @@ async function transcribeLocal(audioBuffer: Buffer, ext: string, cliPath: string
|
|
|
76
91
|
}
|
|
77
92
|
}
|
|
78
93
|
|
|
94
|
+
async function transcribeAwsStreaming(audioBuffer: Buffer, ext: string, region: string, language: string): Promise<string> {
|
|
95
|
+
const client = getTranscribeClient(region || undefined);
|
|
96
|
+
|
|
97
|
+
const isOgg = ext === 'ogg' || ext === 'oga';
|
|
98
|
+
|
|
99
|
+
let streamBuffer: Buffer;
|
|
100
|
+
let mediaEncoding: MediaEncoding;
|
|
101
|
+
let sampleRate: number;
|
|
102
|
+
let pcmPath: string | null = null;
|
|
103
|
+
|
|
104
|
+
if (isOgg) {
|
|
105
|
+
// OGG/Opus can be sent directly
|
|
106
|
+
streamBuffer = audioBuffer;
|
|
107
|
+
mediaEncoding = 'ogg-opus';
|
|
108
|
+
sampleRate = 48000;
|
|
109
|
+
} else {
|
|
110
|
+
// Convert WebM/MP4 to PCM via ffmpeg
|
|
111
|
+
const tmpDir = process.env.TMPDIR || '/tmp';
|
|
112
|
+
const tmpFile = path.join(tmpDir, `transcribe_${Date.now()}.${ext}`);
|
|
113
|
+
pcmPath = tmpFile.replace(/\.[^.]+$/, '.pcm');
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
await fs.writeFile(tmpFile, audioBuffer);
|
|
117
|
+
await execAsync('ffmpeg', [
|
|
118
|
+
'-i', tmpFile, '-ar', '16000', '-ac', '1', '-f', 's16le', '-y', pcmPath,
|
|
119
|
+
], { timeout: 30_000 });
|
|
120
|
+
streamBuffer = await fs.readFile(pcmPath);
|
|
121
|
+
await fs.unlink(tmpFile).catch(() => {});
|
|
122
|
+
} catch (err) {
|
|
123
|
+
await fs.unlink(tmpFile).catch(() => {});
|
|
124
|
+
throw new Error(`ffmpeg conversion to PCM failed: ${(err as Error).message}`);
|
|
125
|
+
}
|
|
126
|
+
mediaEncoding = 'pcm';
|
|
127
|
+
sampleRate = 16000;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const chunkSize = 4096;
|
|
131
|
+
async function* audioStream(): AsyncGenerator<AudioStream> {
|
|
132
|
+
for (let offset = 0; offset < streamBuffer.length; offset += chunkSize) {
|
|
133
|
+
yield { AudioEvent: { AudioChunk: streamBuffer.subarray(offset, offset + chunkSize) } };
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
const response = await client.send(new StartStreamTranscriptionCommand({
|
|
139
|
+
LanguageCode: language as LanguageCode,
|
|
140
|
+
MediaEncoding: mediaEncoding,
|
|
141
|
+
MediaSampleRateHertz: sampleRate,
|
|
142
|
+
AudioStream: audioStream(),
|
|
143
|
+
}));
|
|
144
|
+
|
|
145
|
+
const parts: string[] = [];
|
|
146
|
+
if (response.TranscriptResultStream) {
|
|
147
|
+
for await (const event of response.TranscriptResultStream) {
|
|
148
|
+
if (event.TranscriptEvent?.Transcript?.Results) {
|
|
149
|
+
for (const result of event.TranscriptEvent.Transcript.Results) {
|
|
150
|
+
if (!result.IsPartial && result.Alternatives?.[0]?.Transcript) {
|
|
151
|
+
parts.push(result.Alternatives[0].Transcript);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return parts.join(' ').trim();
|
|
159
|
+
} finally {
|
|
160
|
+
if (pcmPath) {
|
|
161
|
+
await fs.unlink(pcmPath).catch(() => {});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
79
166
|
export async function POST(request: Request) {
|
|
80
167
|
try {
|
|
81
168
|
const formData = await request.formData();
|
|
@@ -102,7 +189,15 @@ export async function POST(request: Request) {
|
|
|
102
189
|
return NextResponse.json({ text });
|
|
103
190
|
}
|
|
104
191
|
|
|
105
|
-
|
|
192
|
+
if (backend === 'aws-transcribe') {
|
|
193
|
+
const region = process.env.AWS_TRANSCRIBE_REGION || env.AWS_TRANSCRIBE_REGION || '';
|
|
194
|
+
const language = process.env.AWS_TRANSCRIBE_LANGUAGE || env.AWS_TRANSCRIBE_LANGUAGE || 'en-AU';
|
|
195
|
+
|
|
196
|
+
const text = await transcribeAwsStreaming(buffer, ext, region, language);
|
|
197
|
+
return NextResponse.json({ text });
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// OpenAI API path (default)
|
|
106
201
|
let client: OpenAI;
|
|
107
202
|
try {
|
|
108
203
|
client = await getClient();
|
|
@@ -17,36 +17,6 @@ function getStorePath(): string {
|
|
|
17
17
|
return path.join(getSlycodeRoot(), 'store');
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
/** Load manifest lists. Returns null if manifest not found. */
|
|
21
|
-
function loadManifest(): { skills: string[]; actions: string[]; agents: string[]; mcp: string[] } | null {
|
|
22
|
-
// Try multiple locations: dev repo, then package dist
|
|
23
|
-
const candidates = [
|
|
24
|
-
path.join(getSlycodeRoot(), 'build', 'store-manifest.js'),
|
|
25
|
-
path.join(getSlycodeRoot(), 'node_modules', '@slycode', 'slycode', 'build', 'store-manifest.js'),
|
|
26
|
-
];
|
|
27
|
-
for (const p of candidates) {
|
|
28
|
-
try {
|
|
29
|
-
if (fs.existsSync(p)) {
|
|
30
|
-
// Use dynamic import workaround — read and parse manually to avoid require()
|
|
31
|
-
const content = fs.readFileSync(p, 'utf-8');
|
|
32
|
-
const mod: Record<string, unknown> = {};
|
|
33
|
-
const fn = new Function('module', 'exports', content);
|
|
34
|
-
fn(mod, mod);
|
|
35
|
-
const result = (mod as { exports?: { skills?: string[]; actions?: string[]; agents?: string[]; mcp?: string[] } }).exports;
|
|
36
|
-
if (result?.skills) return {
|
|
37
|
-
skills: result.skills,
|
|
38
|
-
actions: result.actions || [],
|
|
39
|
-
agents: result.agents || [],
|
|
40
|
-
mcp: result.mcp || [],
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
} catch {
|
|
44
|
-
// Try next candidate
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
20
|
// ============================================================================
|
|
51
21
|
// Store Directory Scanning
|
|
52
22
|
// ============================================================================
|
|
@@ -154,56 +124,25 @@ function scanStoreMcp(storePath: string): StoreAssetInfo[] {
|
|
|
154
124
|
// ============================================================================
|
|
155
125
|
|
|
156
126
|
/**
|
|
157
|
-
* Full store scan — returns
|
|
127
|
+
* Full store scan — returns all assets in the store.
|
|
128
|
+
* The manifest is only used by the build pipeline (build-package.ts) to control
|
|
129
|
+
* what ships in the npm package. The store UI shows everything.
|
|
158
130
|
*/
|
|
159
131
|
export function scanStore(): StoreData {
|
|
160
132
|
const storePath = getStorePath();
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
let agents = scanStoreAssetDir(storePath, 'agent');
|
|
165
|
-
let mcp = scanStoreMcp(storePath);
|
|
166
|
-
|
|
167
|
-
if (manifest) {
|
|
168
|
-
if (manifest.skills) {
|
|
169
|
-
const allowed = new Set(manifest.skills);
|
|
170
|
-
skills = skills.filter(s => allowed.has(s.name));
|
|
171
|
-
}
|
|
172
|
-
if (manifest.agents) {
|
|
173
|
-
const allowed = new Set(manifest.agents);
|
|
174
|
-
agents = agents.filter(a => allowed.has(a.name));
|
|
175
|
-
}
|
|
176
|
-
if (manifest.mcp) {
|
|
177
|
-
const allowed = new Set(manifest.mcp);
|
|
178
|
-
mcp = mcp.filter(m => allowed.has(m.name));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
133
|
+
const skills = scanStoreAssetDir(storePath, 'skill');
|
|
134
|
+
const agents = scanStoreAssetDir(storePath, 'agent');
|
|
135
|
+
const mcp = scanStoreMcp(storePath);
|
|
182
136
|
return { skills, agents, mcp };
|
|
183
137
|
}
|
|
184
138
|
|
|
185
139
|
/**
|
|
186
140
|
* Get flat list of all store assets (skills + agents).
|
|
187
141
|
* Used as the master source for project matrix comparison.
|
|
188
|
-
* Skills are filtered by manifest.
|
|
189
142
|
*/
|
|
190
143
|
export function getStoreAssets(): StoreAssetInfo[] {
|
|
191
144
|
const storePath = getStorePath();
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
let skills = scanStoreAssetDir(storePath, 'skill');
|
|
195
|
-
let agents = scanStoreAssetDir(storePath, 'agent');
|
|
196
|
-
|
|
197
|
-
if (manifest) {
|
|
198
|
-
if (manifest.skills) {
|
|
199
|
-
const allowed = new Set(manifest.skills);
|
|
200
|
-
skills = skills.filter(s => allowed.has(s.name));
|
|
201
|
-
}
|
|
202
|
-
if (manifest.agents) {
|
|
203
|
-
const allowed = new Set(manifest.agents);
|
|
204
|
-
agents = agents.filter(a => allowed.has(a.name));
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
145
|
+
const skills = scanStoreAssetDir(storePath, 'skill');
|
|
146
|
+
const agents = scanStoreAssetDir(storePath, 'agent');
|
|
208
147
|
return [...skills, ...agents];
|
|
209
148
|
}
|