veryfront 0.1.216 → 0.1.217
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/esm/cli/commands/generate/integration-generator-helpers.d.ts +35 -0
- package/esm/cli/commands/generate/integration-generator-helpers.d.ts.map +1 -0
- package/esm/cli/commands/generate/integration-generator-helpers.js +123 -0
- package/esm/cli/commands/generate/integration-generator.d.ts +1 -2
- package/esm/cli/commands/generate/integration-generator.d.ts.map +1 -1
- package/esm/cli/commands/generate/integration-generator.js +1 -123
- package/esm/cli/commands/knowledge/command-helpers.d.ts +48 -0
- package/esm/cli/commands/knowledge/command-helpers.d.ts.map +1 -0
- package/esm/cli/commands/knowledge/command-helpers.js +216 -0
- package/esm/cli/commands/knowledge/command.d.ts +11 -16
- package/esm/cli/commands/knowledge/command.d.ts.map +1 -1
- package/esm/cli/commands/knowledge/command.js +25 -212
- package/esm/cli/mcp/remote-file-tool-helpers.d.ts +5 -0
- package/esm/cli/mcp/remote-file-tool-helpers.d.ts.map +1 -0
- package/esm/cli/mcp/remote-file-tool-helpers.js +22 -0
- package/esm/cli/mcp/remote-file-tools.d.ts.map +1 -1
- package/esm/cli/mcp/remote-file-tools.js +1 -22
- package/esm/cli/templates/integration-loader-helpers.d.ts +8 -0
- package/esm/cli/templates/integration-loader-helpers.d.ts.map +1 -0
- package/esm/cli/templates/integration-loader-helpers.js +29 -0
- package/esm/cli/templates/integration-loader.d.ts.map +1 -1
- package/esm/cli/templates/integration-loader.js +5 -21
- package/esm/cli/templates/manifest.d.ts +1 -0
- package/esm/cli/templates/manifest.js +2 -1
- package/esm/deno.js +2 -2
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +48 -90
- package/esm/src/chat/ag-ui-helpers.d.ts +17 -0
- package/esm/src/chat/ag-ui-helpers.d.ts.map +1 -0
- package/esm/src/chat/ag-ui-helpers.js +111 -0
- package/esm/src/chat/ag-ui.d.ts.map +1 -1
- package/esm/src/chat/ag-ui.js +1 -111
- package/esm/src/config/schemas/config.schema.d.ts +1 -0
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +11 -0
- package/esm/src/config/schemas/index.d.ts +11 -1
- package/esm/src/config/schemas/index.d.ts.map +1 -1
- package/esm/src/errors/error-registry-helpers.d.ts +6 -0
- package/esm/src/errors/error-registry-helpers.d.ts.map +1 -0
- package/esm/src/errors/error-registry-helpers.js +9 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/error-registry.js +4 -3
- package/esm/src/extensions/factory-loader.d.ts +29 -0
- package/esm/src/extensions/factory-loader.d.ts.map +1 -0
- package/esm/src/extensions/factory-loader.js +63 -0
- package/esm/src/extensions/index.d.ts +16 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +16 -0
- package/esm/src/extensions/orchestrate.d.ts +54 -0
- package/esm/src/extensions/orchestrate.d.ts.map +1 -0
- package/esm/src/extensions/orchestrate.js +116 -0
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +23 -0
- package/esm/src/html/styles-builder/tailwind-plugin-allowlist.d.ts +29 -0
- package/esm/src/html/styles-builder/tailwind-plugin-allowlist.d.ts.map +1 -0
- package/esm/src/html/styles-builder/tailwind-plugin-allowlist.js +48 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader-helpers.d.ts +15 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader-helpers.d.ts.map +1 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader-helpers.js +22 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +0 -2
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +4 -24
- package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.d.ts +19 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.d.ts.map +1 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.js +26 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +4 -20
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +1 -0
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +3 -0
- package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations.js +4 -7
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.d.ts +28 -0
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.d.ts.map +1 -0
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.js +41 -0
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +1 -4
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +7 -40
- package/esm/src/provider/runtime-loader/tool-input-status.d.ts +17 -0
- package/esm/src/provider/runtime-loader/tool-input-status.d.ts.map +1 -0
- package/esm/src/provider/runtime-loader/tool-input-status.js +155 -0
- package/esm/src/provider/runtime-loader.d.ts +2 -3
- package/esm/src/provider/runtime-loader.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader.js +2 -155
- package/esm/src/rendering/orchestrator/pipeline-helpers.d.ts +8 -0
- package/esm/src/rendering/orchestrator/pipeline-helpers.d.ts.map +1 -0
- package/esm/src/rendering/orchestrator/pipeline-helpers.js +20 -0
- package/esm/src/rendering/orchestrator/pipeline.d.ts +0 -3
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +4 -22
- package/esm/src/routing/api/module-loader/loader-helpers.d.ts +10 -0
- package/esm/src/routing/api/module-loader/loader-helpers.d.ts.map +1 -0
- package/esm/src/routing/api/module-loader/loader-helpers.js +62 -0
- package/esm/src/routing/api/module-loader/loader.d.ts +1 -1
- package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/loader.js +2 -60
- package/esm/src/server/bootstrap.d.ts +22 -2
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +67 -5
- package/esm/src/server/dev-ui/manifest.d.ts +2 -0
- package/esm/src/server/dev-ui/manifest.js +3 -1
- package/esm/src/server/handlers/request/api/project-discovery.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/project-discovery.js +14 -8
- package/esm/src/server/production-server.js +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
- package/esm/src/tool/index.d.ts +1 -1
- package/esm/src/tool/index.d.ts.map +1 -1
- package/esm/src/tool/types.d.ts +20 -0
- package/esm/src/tool/types.d.ts.map +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/cli/commands/generate/integration-generator-helpers.ts +185 -0
- package/src/cli/commands/generate/integration-generator.ts +12 -168
- package/src/cli/commands/knowledge/command-helpers.ts +295 -0
- package/src/cli/commands/knowledge/command.ts +33 -259
- package/src/cli/mcp/remote-file-tool-helpers.ts +27 -0
- package/src/cli/mcp/remote-file-tools.ts +6 -28
- package/src/cli/templates/integration-loader-helpers.ts +49 -0
- package/src/cli/templates/integration-loader.ts +10 -28
- package/src/cli/templates/manifest.js +2 -1
- package/src/deno.js +2 -2
- package/src/src/agent/runtime/index.ts +77 -94
- package/src/src/chat/ag-ui-helpers.ts +139 -0
- package/src/src/chat/ag-ui.ts +11 -139
- package/src/src/config/schemas/config.schema.ts +11 -0
- package/src/src/config/schemas/index.ts +15 -1
- package/src/src/errors/error-registry-helpers.ts +23 -0
- package/src/src/errors/error-registry.ts +8 -3
- package/src/src/extensions/factory-loader.ts +76 -0
- package/src/src/extensions/index.ts +20 -0
- package/src/src/extensions/orchestrate.ts +184 -0
- package/src/src/html/styles-builder/plugin-loader.ts +32 -0
- package/src/src/html/styles-builder/tailwind-plugin-allowlist.ts +51 -0
- package/src/src/modules/react-loader/ssr-module-loader/loader-helpers.ts +37 -0
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +8 -39
- package/src/src/platform/adapters/fs/veryfront/adapter-helpers.ts +43 -0
- package/src/src/platform/adapters/fs/veryfront/adapter.ts +8 -22
- package/src/src/platform/adapters/fs/veryfront/read-operations-helpers.ts +4 -0
- package/src/src/platform/adapters/fs/veryfront/read-operations.ts +4 -7
- package/src/src/platform/adapters/fs/veryfront/websocket-manager-helpers.ts +73 -0
- package/src/src/platform/adapters/fs/veryfront/websocket-manager.ts +29 -44
- package/src/src/provider/runtime-loader/tool-input-status.ts +210 -0
- package/src/src/provider/runtime-loader.ts +6 -203
- package/src/src/rendering/orchestrator/pipeline-helpers.ts +35 -0
- package/src/src/rendering/orchestrator/pipeline.ts +8 -35
- package/src/src/routing/api/module-loader/loader-helpers.ts +68 -0
- package/src/src/routing/api/module-loader/loader.ts +8 -65
- package/src/src/server/bootstrap.ts +88 -7
- package/src/src/server/dev-ui/manifest.js +3 -1
- package/src/src/server/handlers/request/api/project-discovery.ts +19 -8
- package/src/src/server/production-server.ts +1 -1
- package/src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts +2 -2
- package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
- package/src/src/tool/index.ts +1 -0
- package/src/src/tool/types.ts +21 -0
- package/src/src/utils/version-constant.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/knowled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C,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,GACA,OAAO,CAAC;IACT,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC,MAAM,EAAE,+BAA+B,EAAE,CAAC;CAC3C,CAAC,CAsGD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAwItE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createFileSystem, getEnv, runCommand } from "../../../src/platform/index.js";
|
|
4
|
-
import { basename
|
|
4
|
+
import { basename } from "../../../src/platform/compat/path/index.js";
|
|
5
5
|
import { withSpan } from "../../../src/observability/tracing/otlp-setup.js";
|
|
6
6
|
import { cliLogger } from "../../utils/index.js";
|
|
7
7
|
import { createApiClient, resolveConfigWithAuth } from "../../shared/config.js";
|
|
@@ -9,9 +9,10 @@ import { getStringArg } from "../../shared/parsed-args.js";
|
|
|
9
9
|
import { downloadUploadToFile, listAllUploads } from "../uploads/command.js";
|
|
10
10
|
import { putRemoteFileFromLocal } from "../files/command.js";
|
|
11
11
|
import { knowledgeIngestPythonSource } from "./parser-source.js";
|
|
12
|
+
import * as commandHelpers from "./command-helpers.js";
|
|
12
13
|
import { createJobUserLogger, serverLogger } from "../../../src/utils/index.js";
|
|
13
14
|
import { writeJobResultIfConfigured } from "../../utils/write-job-result.js";
|
|
14
|
-
import {
|
|
15
|
+
import { classifyKnowledgeSourcePath } from "./source-policy.js";
|
|
15
16
|
import { buildKnowledgeIngestJobResult, } from "./result.js";
|
|
16
17
|
const knowledgeJobLogger = serverLogger.component("knowledge-ingest");
|
|
17
18
|
const KnowledgeIngestArgsSchema = z.object({
|
|
@@ -112,233 +113,45 @@ export function parseKnowledgeIngestArgs(args) {
|
|
|
112
113
|
quiet: getBooleanArg(args, "quiet", "q"),
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
|
-
export function normalizeKnowledgeInputPath(inputPath) {
|
|
116
|
-
const normalizedPath = normalize(inputPath).replace(/^\/+/, "").replace(/\\/g, "/");
|
|
117
|
-
if (!normalizedPath || normalizedPath.startsWith("..") || normalizedPath.startsWith("/")) {
|
|
118
|
-
throw new Error(`Invalid knowledge input path: ${inputPath}`);
|
|
119
|
-
}
|
|
120
|
-
return normalizedPath;
|
|
121
|
-
}
|
|
122
|
-
export function normalizeProjectUploadPath(inputPath) {
|
|
123
|
-
return normalizeKnowledgeInputPath(inputPath);
|
|
124
|
-
}
|
|
125
|
-
export function formatKnowledgeUploadSource(uploadPath) {
|
|
126
|
-
const normalizedPath = normalizeKnowledgeInputPath(uploadPath);
|
|
127
|
-
return normalizedPath === "uploads" || normalizedPath.startsWith("uploads/")
|
|
128
|
-
? normalizedPath
|
|
129
|
-
: `uploads/${normalizedPath}`;
|
|
130
|
-
}
|
|
131
|
-
function resolveExplicitUploadPath(inputPath) {
|
|
132
|
-
const normalizedInput = normalizeKnowledgeInputPath(inputPath);
|
|
133
|
-
const displayInput = inputPath.replace(/\\/g, "/");
|
|
134
|
-
const uploadPath = normalizeProjectUploadPath(inputPath);
|
|
135
|
-
if (!uploadPath || uploadPath === "uploads" || normalizedInput === "uploads" ||
|
|
136
|
-
normalizedInput.endsWith("/")) {
|
|
137
|
-
throw new Error(`Directory upload references require --path <prefix> --all: ${displayInput}`);
|
|
138
|
-
}
|
|
139
|
-
return uploadPath;
|
|
140
|
-
}
|
|
141
|
-
export function isLikelyLocalPath(value) {
|
|
142
|
-
return value.startsWith("/") || value.startsWith("./") || value.startsWith("../") ||
|
|
143
|
-
/^[A-Za-z]:[\\/]/.test(value);
|
|
144
|
-
}
|
|
145
|
-
function isProjectUploadReference(value) {
|
|
146
|
-
if (isLikelyLocalPath(value))
|
|
147
|
-
return false;
|
|
148
|
-
const normalizedValue = normalize(value).replace(/\\/g, "/").replace(/^\/+/, "");
|
|
149
|
-
return normalizedValue === "uploads" || normalizedValue.startsWith("uploads/");
|
|
150
|
-
}
|
|
151
|
-
function slugify(value) {
|
|
152
|
-
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "document";
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Strip the chat-upload prefix that Studio prepends to uploaded files.
|
|
156
|
-
*
|
|
157
|
-
* Studio stores uploads with a generated prefix like:
|
|
158
|
-
* chat-<uuid>-<timestamp>-<shortid>-<original-filename>
|
|
159
|
-
*
|
|
160
|
-
* This function removes the prefix so knowledge files use the clean
|
|
161
|
-
* original filename (e.g. "agents" instead of
|
|
162
|
-
* "chat-909d3dbc-5a9a-4156-97e4-bcceb5c2ec0d-1773942180291-fv1qg5-agents").
|
|
163
|
-
*/
|
|
164
|
-
const CHAT_UPLOAD_PREFIX_RE = /^chat-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}-\d+-[a-z0-9]+-/i;
|
|
165
|
-
export function stripChatUploadPrefix(name) {
|
|
166
|
-
return name.replace(CHAT_UPLOAD_PREFIX_RE, "");
|
|
167
|
-
}
|
|
168
116
|
function defaultOutputRoot() {
|
|
169
117
|
return dntShim.Deno.makeTempDir({ prefix: "veryfront-knowledge-" });
|
|
170
118
|
}
|
|
171
|
-
export function resolveKnowledgeDownloadOutputDir(outputDir) {
|
|
172
|
-
return join(outputDir, ".uploads");
|
|
173
|
-
}
|
|
174
|
-
function createSkippedKnowledgeSource(input) {
|
|
175
|
-
return {
|
|
176
|
-
source: input.source,
|
|
177
|
-
localSourcePath: input.localSourcePath ?? null,
|
|
178
|
-
message: input.message,
|
|
179
|
-
reason: input.reason,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
function createFailedKnowledgeSource(input) {
|
|
183
|
-
return {
|
|
184
|
-
source: input.source,
|
|
185
|
-
localSourcePath: input.localSourcePath,
|
|
186
|
-
message: input.message,
|
|
187
|
-
reason: input.reason,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
119
|
function classifySourceOrSkip(input) {
|
|
191
120
|
const decision = classifyKnowledgeSourcePath(input.source);
|
|
192
121
|
if (decision.kind === "ingest") {
|
|
193
122
|
return null;
|
|
194
123
|
}
|
|
195
|
-
return
|
|
196
|
-
source: input.source,
|
|
197
|
-
localSourcePath: input.localSourcePath,
|
|
198
|
-
message: decision.message,
|
|
199
|
-
reason: decision.reason,
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
function classifyDirectoryOrSkip(input) {
|
|
203
|
-
const decision = classifyKnowledgeDirectoryPath(input.source);
|
|
204
|
-
if (decision.kind === "ingest") {
|
|
205
|
-
return null;
|
|
206
|
-
}
|
|
207
|
-
return createSkippedKnowledgeSource({
|
|
124
|
+
return {
|
|
208
125
|
source: input.source,
|
|
209
|
-
localSourcePath: null,
|
|
126
|
+
localSourcePath: input.localSourcePath ?? null,
|
|
210
127
|
message: decision.message,
|
|
211
128
|
reason: decision.reason,
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
async function collectLocalFiles(root, recursive) {
|
|
215
|
-
const fs = createFileSystem();
|
|
216
|
-
const stat = await fs.stat(root);
|
|
217
|
-
if (stat.isFile) {
|
|
218
|
-
const skipped = classifySourceOrSkip({ source: root, localSourcePath: root });
|
|
219
|
-
return skipped == null
|
|
220
|
-
? {
|
|
221
|
-
sources: [{ kind: "local", input: root, localPath: root }],
|
|
222
|
-
skipped: [],
|
|
223
|
-
}
|
|
224
|
-
: {
|
|
225
|
-
sources: [],
|
|
226
|
-
skipped: [skipped],
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
if (!stat.isDirectory) {
|
|
230
|
-
return { sources: [], skipped: [] };
|
|
231
|
-
}
|
|
232
|
-
const skippedRootDirectory = classifyDirectoryOrSkip({ source: root });
|
|
233
|
-
if (skippedRootDirectory != null) {
|
|
234
|
-
return {
|
|
235
|
-
sources: [],
|
|
236
|
-
skipped: [skippedRootDirectory],
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
const collection = {
|
|
240
|
-
sources: [],
|
|
241
|
-
skipped: [],
|
|
242
129
|
};
|
|
243
|
-
async function walk(dir) {
|
|
244
|
-
for await (const entry of fs.readDir(dir)) {
|
|
245
|
-
const entryPath = join(dir, entry.name);
|
|
246
|
-
if (entry.isDirectory) {
|
|
247
|
-
const skipped = classifyDirectoryOrSkip({ source: entryPath });
|
|
248
|
-
if (skipped != null) {
|
|
249
|
-
collection.skipped.push(skipped);
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
if (recursive)
|
|
253
|
-
await walk(entryPath);
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
256
|
-
if (!entry.isFile) {
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
const skipped = classifySourceOrSkip({ source: entryPath, localSourcePath: entryPath });
|
|
260
|
-
if (skipped != null) {
|
|
261
|
-
collection.skipped.push(skipped);
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
|
-
collection.sources.push({ kind: "local", input: root, localPath: entryPath });
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
await walk(root);
|
|
268
|
-
collection.sources.sort((left, right) => left.localPath.localeCompare(right.localPath));
|
|
269
|
-
collection.skipped.sort((left, right) => left.source.localeCompare(right.source));
|
|
270
|
-
return collection;
|
|
271
130
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
131
|
+
export const normalizeKnowledgeInputPath = commandHelpers.normalizeKnowledgeInputPath;
|
|
132
|
+
export const normalizeProjectUploadPath = commandHelpers.normalizeProjectUploadPath;
|
|
133
|
+
export const formatKnowledgeUploadSource = commandHelpers.formatKnowledgeUploadSource;
|
|
134
|
+
export const isLikelyLocalPath = commandHelpers.isLikelyLocalPath;
|
|
135
|
+
export const stripChatUploadPrefix = commandHelpers.stripChatUploadPrefix;
|
|
136
|
+
export const resolveKnowledgeDownloadOutputDir = commandHelpers.resolveKnowledgeDownloadOutputDir;
|
|
137
|
+
export const buildSuggestedSlug = commandHelpers.buildSuggestedSlug;
|
|
138
|
+
export const ensureUniqueSlugs = commandHelpers.ensureUniqueSlugs;
|
|
139
|
+
export const deriveKnowledgeRemotePath = commandHelpers.deriveKnowledgeRemotePath;
|
|
140
|
+
export const createKnowledgeIngestResult = commandHelpers.createKnowledgeIngestResult;
|
|
141
|
+
function resolveExplicitUploadPath(inputPath) {
|
|
142
|
+
return commandHelpers.resolveExplicitUploadPath(inputPath);
|
|
276
143
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
let stripped;
|
|
280
|
-
if (source.kind === "upload") {
|
|
281
|
-
stripped = normalized
|
|
282
|
-
.replace(/^\/workspace\/uploads\//, "")
|
|
283
|
-
.replace(/^\/workspace\//, "")
|
|
284
|
-
.replace(/^uploads\//, "")
|
|
285
|
-
.replace(/\.[^.]+$/, "");
|
|
286
|
-
}
|
|
287
|
-
else if (normalized.startsWith("/workspace/uploads/")) {
|
|
288
|
-
stripped = normalized.replace(/^\/workspace\/uploads\//, "").replace(/\.[^.]+$/, "");
|
|
289
|
-
}
|
|
290
|
-
else if (normalized.startsWith("/workspace/")) {
|
|
291
|
-
stripped = normalized.replace(/^\/workspace\//, "").replace(/\.[^.]+$/, "");
|
|
292
|
-
}
|
|
293
|
-
else if (normalized.startsWith("/")) {
|
|
294
|
-
stripped = basename(normalized, extname(normalized));
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
stripped = normalized.replace(/\.[^.]+$/, "");
|
|
298
|
-
}
|
|
299
|
-
// Strip Studio's chat-upload prefix from the filename portion so that
|
|
300
|
-
// knowledge files use the original clean filename.
|
|
301
|
-
const lastSlash = stripped.lastIndexOf("/");
|
|
302
|
-
if (lastSlash >= 0) {
|
|
303
|
-
const dir = stripped.slice(0, lastSlash + 1);
|
|
304
|
-
const file = stripChatUploadPrefix(stripped.slice(lastSlash + 1));
|
|
305
|
-
stripped = file ? `${dir}${file}` : stripped;
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
stripped = stripChatUploadPrefix(stripped) || stripped;
|
|
309
|
-
}
|
|
310
|
-
return slugify(stripped || basename(normalized, extname(normalized)) || `document-${index + 1}`);
|
|
144
|
+
function isProjectUploadReference(value) {
|
|
145
|
+
return commandHelpers.isProjectUploadReference(value);
|
|
311
146
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
return sources.map((source, index) => {
|
|
315
|
-
const baseSlug = buildSuggestedSlug(source, index);
|
|
316
|
-
const nextCount = (counts.get(baseSlug) ?? 0) + 1;
|
|
317
|
-
counts.set(baseSlug, nextCount);
|
|
318
|
-
return nextCount === 1 ? baseSlug : `${baseSlug}-${nextCount}`;
|
|
319
|
-
});
|
|
147
|
+
function createFailedKnowledgeSource(input) {
|
|
148
|
+
return commandHelpers.createFailedKnowledgeSource(input);
|
|
320
149
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (!relativeOutputPath || relativeOutputPath.startsWith("..")) {
|
|
324
|
-
throw new Error(`Output path is outside output directory: ${outputPath}`);
|
|
325
|
-
}
|
|
326
|
-
const prefix = normalizeKnowledgeInputPath(knowledgePath);
|
|
327
|
-
const normalizedRelative = normalize(relativeOutputPath).replace(/^\/+/, "");
|
|
328
|
-
return `${prefix}/${normalizedRelative}`.replace(/\\/g, "/");
|
|
150
|
+
async function collectLocalFiles(root, recursive) {
|
|
151
|
+
return commandHelpers.collectLocalFiles(root, recursive);
|
|
329
152
|
}
|
|
330
|
-
|
|
331
|
-
return
|
|
332
|
-
source: input.source,
|
|
333
|
-
localSourcePath: input.localSourcePath,
|
|
334
|
-
outputPath: input.outputPath,
|
|
335
|
-
remotePath: input.remotePath,
|
|
336
|
-
slug: input.parser.slug,
|
|
337
|
-
sourceType: input.parser.source_type,
|
|
338
|
-
summary: input.parser.summary,
|
|
339
|
-
stats: input.parser.stats,
|
|
340
|
-
warnings: input.parser.warnings,
|
|
341
|
-
};
|
|
153
|
+
function buildSourceReference(source) {
|
|
154
|
+
return commandHelpers.buildSourceReference(source);
|
|
342
155
|
}
|
|
343
156
|
export async function runKnowledgeParser(input) {
|
|
344
157
|
const [result] = await runKnowledgeParsers({
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function getBranchParam(branch?: string): string;
|
|
2
|
+
export declare function buildProjectApiPath(project: string, resource: string, branch?: string): string;
|
|
3
|
+
export declare function buildProjectFilePath(project: string, filePath: string, branch?: string): string;
|
|
4
|
+
export declare function slugToName(slug: string): string;
|
|
5
|
+
//# sourceMappingURL=remote-file-tool-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-file-tool-helpers.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/remote-file-tool-helpers.ts"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9F;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function encodeFilePath(path) {
|
|
2
|
+
return path.split("/").map(encodeURIComponent).join("/");
|
|
3
|
+
}
|
|
4
|
+
function getBranchPath(branch) {
|
|
5
|
+
return branch ? `/branches/${branch}` : "";
|
|
6
|
+
}
|
|
7
|
+
export function getBranchParam(branch) {
|
|
8
|
+
return branch ? `?branch_id=${branch}` : "";
|
|
9
|
+
}
|
|
10
|
+
export function buildProjectApiPath(project, resource, branch) {
|
|
11
|
+
const normalizedResource = resource.startsWith("/") ? resource.slice(1) : resource;
|
|
12
|
+
return `/${project}${getBranchPath(branch)}/${normalizedResource}`;
|
|
13
|
+
}
|
|
14
|
+
export function buildProjectFilePath(project, filePath, branch) {
|
|
15
|
+
return buildProjectApiPath(project, `files/${encodeFilePath(filePath)}`, branch);
|
|
16
|
+
}
|
|
17
|
+
export function slugToName(slug) {
|
|
18
|
+
return slug
|
|
19
|
+
.split("-")
|
|
20
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
21
|
+
.join(" ");
|
|
22
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-file-tools.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/remote-file-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"remote-file-tools.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/remote-file-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAuF1C,UAAU,YAAY;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD;AAOD,UAAU,MAAM;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAA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";
|
|
14
14
|
import { randomSuffix } from "../shared/slug.js";
|
|
15
15
|
import { DEFAULT_LOCAL_API_URL } from "../shared/constants.js";
|
|
16
|
+
import { buildProjectApiPath, buildProjectFilePath, getBranchParam, slugToName, } from "./remote-file-tool-helpers.js";
|
|
16
17
|
function getApiBaseUrl() {
|
|
17
18
|
return getEnvironmentConfig().apiBaseUrl || DEFAULT_LOCAL_API_URL;
|
|
18
19
|
}
|
|
@@ -58,29 +59,7 @@ async function apiRequest(method, path, options = {}) {
|
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
function encodeFilePath(path) {
|
|
62
|
-
return path.split("/").map(encodeURIComponent).join("/");
|
|
63
|
-
}
|
|
64
|
-
function getBranchPath(branch) {
|
|
65
|
-
return branch ? `/branches/${branch}` : "";
|
|
66
|
-
}
|
|
67
|
-
function getBranchParam(branch) {
|
|
68
|
-
return branch ? `?branch_id=${branch}` : "";
|
|
69
|
-
}
|
|
70
|
-
function buildProjectApiPath(project, resource, branch) {
|
|
71
|
-
const normalizedResource = resource.startsWith("/") ? resource.slice(1) : resource;
|
|
72
|
-
return `/${project}${getBranchPath(branch)}/${normalizedResource}`;
|
|
73
|
-
}
|
|
74
|
-
function buildProjectFilePath(project, filePath, branch) {
|
|
75
|
-
return buildProjectApiPath(project, `files/${encodeFilePath(filePath)}`, branch);
|
|
76
|
-
}
|
|
77
62
|
const MAX_SLUG_ATTEMPTS = 10;
|
|
78
|
-
function slugToName(slug) {
|
|
79
|
-
return slug
|
|
80
|
-
.split("-")
|
|
81
|
-
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
82
|
-
.join(" ");
|
|
83
|
-
}
|
|
84
63
|
/**
|
|
85
64
|
* Create a project with slug conflict retry.
|
|
86
65
|
* On 409, appends a random suffix and retries (matches reserveProjectSlug behavior).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IntegrationName, TemplateFile } from "./types.js";
|
|
2
|
+
export declare function resolveIntegrationModuleDir(moduleUrl: string, platform?: NodeJS.Platform | undefined): string;
|
|
3
|
+
export declare function buildIntegrationDirectory(moduleDir: string, integrationName: string): string;
|
|
4
|
+
export declare function buildUnknownIntegrationErrors(integrations: IntegrationName[], availableIntegrations: readonly IntegrationName[]): string[];
|
|
5
|
+
export declare function mergeIntegrationFiles(integrations: Array<{
|
|
6
|
+
files: TemplateFile[];
|
|
7
|
+
}>): TemplateFile[];
|
|
8
|
+
//# sourceMappingURL=integration-loader-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-loader-helpers.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/integration-loader-helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEhE,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,QAAQ,8BAAgE,GACvE,MAAM,CAWR;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GACtB,MAAM,CAER;AAED,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,eAAe,EAAE,EAC/B,qBAAqB,EAAE,SAAS,eAAe,EAAE,GAChD,MAAM,EAAE,CAKV;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,GAC7C,YAAY,EAAE,CAUhB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { join } from "../../src/fs/index.js";
|
|
2
|
+
export function resolveIntegrationModuleDir(moduleUrl, platform = typeof process !== "undefined" ? process.platform : undefined) {
|
|
3
|
+
const normalizedModuleUrl = new URL(".", moduleUrl);
|
|
4
|
+
if (normalizedModuleUrl.protocol !== "file:")
|
|
5
|
+
return normalizedModuleUrl.href;
|
|
6
|
+
let moduleDir = normalizedModuleUrl.pathname;
|
|
7
|
+
if (platform === "win32" && moduleDir.startsWith("/")) {
|
|
8
|
+
moduleDir = moduleDir.slice(1);
|
|
9
|
+
}
|
|
10
|
+
return moduleDir;
|
|
11
|
+
}
|
|
12
|
+
export function buildIntegrationDirectory(moduleDir, integrationName) {
|
|
13
|
+
return join(moduleDir, "integrations", integrationName);
|
|
14
|
+
}
|
|
15
|
+
export function buildUnknownIntegrationErrors(integrations, availableIntegrations) {
|
|
16
|
+
const availableList = availableIntegrations.join(", ");
|
|
17
|
+
return integrations
|
|
18
|
+
.filter((integration) => !availableIntegrations.includes(integration))
|
|
19
|
+
.map((integration) => `Unknown integration: ${integration}. Available: ${availableList}`);
|
|
20
|
+
}
|
|
21
|
+
export function mergeIntegrationFiles(integrations) {
|
|
22
|
+
const fileMap = new Map();
|
|
23
|
+
for (const integration of integrations) {
|
|
24
|
+
for (const file of integration.files) {
|
|
25
|
+
fileMap.set(file.path, file);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return [...fileMap.values()].sort((a, b) => a.path.localeCompare(b.path));
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-loader.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/integration-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"integration-loader.d.ts","sourceRoot":"","sources":["../../../src/cli/templates/integration-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAAe,EAqDnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,EAM3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,aAAa,CA8C/D,CAAC;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AAY,EAAE,CAwZxD"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { createFileSystem, join } from "../../src/fs/index.js";
|
|
11
11
|
import { loadTemplateFromDirectory } from "./loader.js";
|
|
12
|
+
import { buildIntegrationDirectory, buildUnknownIntegrationErrors, mergeIntegrationFiles, resolveIntegrationModuleDir, } from "./integration-loader-helpers.js";
|
|
12
13
|
/**
|
|
13
14
|
* Available integrations that can be added via --integrations flag
|
|
14
15
|
*/
|
|
@@ -127,20 +128,13 @@ export const USE_CASE_CONFIGS = {
|
|
|
127
128
|
},
|
|
128
129
|
};
|
|
129
130
|
function getModuleDir() {
|
|
130
|
-
|
|
131
|
-
if (moduleUrl.protocol !== "file:")
|
|
132
|
-
return moduleUrl.href;
|
|
133
|
-
let moduleDir = moduleUrl.pathname;
|
|
134
|
-
if (typeof process !== "undefined" && process.platform === "win32" && moduleDir.startsWith("/")) {
|
|
135
|
-
moduleDir = moduleDir.slice(1);
|
|
136
|
-
}
|
|
137
|
-
return moduleDir;
|
|
131
|
+
return resolveIntegrationModuleDir(globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).url);
|
|
138
132
|
}
|
|
139
133
|
/**
|
|
140
134
|
* Get the directory path for an integration
|
|
141
135
|
*/
|
|
142
136
|
export function getIntegrationDirectory(integrationName) {
|
|
143
|
-
return
|
|
137
|
+
return buildIntegrationDirectory(getModuleDir(), integrationName);
|
|
144
138
|
}
|
|
145
139
|
/**
|
|
146
140
|
* Load integration configuration from connector.json
|
|
@@ -170,12 +164,7 @@ export async function loadIntegration(integrationName) {
|
|
|
170
164
|
* Validate integration names
|
|
171
165
|
*/
|
|
172
166
|
export function validateIntegrations(integrations) {
|
|
173
|
-
const errors =
|
|
174
|
-
for (const integration of integrations) {
|
|
175
|
-
if (AVAILABLE_INTEGRATIONS.includes(integration))
|
|
176
|
-
continue;
|
|
177
|
-
errors.push(`Unknown integration: ${integration}. Available: ${AVAILABLE_INTEGRATIONS.join(", ")}`);
|
|
178
|
-
}
|
|
167
|
+
const errors = buildUnknownIntegrationErrors(integrations, AVAILABLE_INTEGRATIONS);
|
|
179
168
|
return { valid: errors.length === 0, errors };
|
|
180
169
|
}
|
|
181
170
|
/**
|
|
@@ -184,7 +173,6 @@ export function validateIntegrations(integrations) {
|
|
|
184
173
|
export async function loadIntegrations(integrationNames) {
|
|
185
174
|
const integrations = [];
|
|
186
175
|
const errors = [];
|
|
187
|
-
const fileMap = new Map();
|
|
188
176
|
for (const name of integrationNames) {
|
|
189
177
|
const integration = await loadIntegration(name);
|
|
190
178
|
if (!integration) {
|
|
@@ -192,14 +180,10 @@ export async function loadIntegrations(integrationNames) {
|
|
|
192
180
|
continue;
|
|
193
181
|
}
|
|
194
182
|
integrations.push(integration);
|
|
195
|
-
for (const file of integration.files) {
|
|
196
|
-
// Later integrations override earlier ones
|
|
197
|
-
fileMap.set(file.path, file);
|
|
198
|
-
}
|
|
199
183
|
}
|
|
200
184
|
return {
|
|
201
185
|
integrations,
|
|
202
|
-
files:
|
|
186
|
+
files: mergeIntegrationFiles(integrations),
|
|
203
187
|
errors,
|
|
204
188
|
};
|
|
205
189
|
}
|
|
@@ -210,6 +210,7 @@ declare namespace _default {
|
|
|
210
210
|
"lib/token-store-examples.ts": string;
|
|
211
211
|
"lib/token-store.ts": string;
|
|
212
212
|
"app/setup/page.tsx": string;
|
|
213
|
+
"app/setup/page-helpers.tsx": string;
|
|
213
214
|
"app/components/ServiceConnections.tsx": string;
|
|
214
215
|
"app/page.tsx": string;
|
|
215
216
|
"app/api/integrations/status/route.ts": string;
|