@builder.io/ai-utils 0.85.1 → 0.85.3
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/package.json +1 -1
- package/src/projects.d.ts +15 -0
- package/src/projects.js +22 -0
- package/src/projects.test.d.ts +1 -0
- package/src/projects.test.js +22 -0
package/package.json
CHANGED
package/src/projects.d.ts
CHANGED
|
@@ -231,6 +231,17 @@ export declare const STARTER_REPO = "BuilderIO/fusion-starter";
|
|
|
231
231
|
export declare const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
|
|
232
232
|
export declare const DSI_PLACEHOLDER_REPO = "BuilderIO/dsi-placeholder";
|
|
233
233
|
export declare const AGENT_NATIVE_STARTER_REPO = "BuilderIO/builder-agent-native-starter";
|
|
234
|
+
/**
|
|
235
|
+
* Whether a repo/workspace-folder refers to the Agent Native starter. Hostable
|
|
236
|
+
* Agent Native projects are born with their own `repoName` (the eagerly
|
|
237
|
+
* provisioned internal host), so the starter is only identifiable via
|
|
238
|
+
* `templateRepoUrl` — the read-only clone source. Matching either keeps both
|
|
239
|
+
* hostable and plain-clone projects working.
|
|
240
|
+
*/
|
|
241
|
+
export declare const matchesAgentNativeStarter: (repo: {
|
|
242
|
+
repoName?: string | null;
|
|
243
|
+
templateRepoUrl?: string | null;
|
|
244
|
+
}) => boolean;
|
|
234
245
|
export declare const EXAMPLE_OR_STARTER_REPOS: string[];
|
|
235
246
|
export declare const EXAMPLE_OR_STARTER_REPOS_URLS: string[];
|
|
236
247
|
export interface GitBackupUploadUrlResult {
|
|
@@ -1711,6 +1722,10 @@ export declare const DeployArtifactManifestSchema: z.ZodObject<{
|
|
|
1711
1722
|
functions: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1712
1723
|
functions_config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1713
1724
|
function_invocation_modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1725
|
+
function_schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1726
|
+
name: z.ZodString;
|
|
1727
|
+
cron: z.ZodString;
|
|
1728
|
+
}, z.core.$strip>>>;
|
|
1714
1729
|
}, z.core.$strip>;
|
|
1715
1730
|
export type DeployArtifactManifest = z.infer<typeof DeployArtifactManifestSchema>;
|
|
1716
1731
|
/**
|
package/src/projects.js
CHANGED
|
@@ -38,6 +38,19 @@ export const STARTER_REPO = "BuilderIO/fusion-starter";
|
|
|
38
38
|
export const DSI_PREVIEW_REPO = "BuilderIO/dsi-starter";
|
|
39
39
|
export const DSI_PLACEHOLDER_REPO = "BuilderIO/dsi-placeholder";
|
|
40
40
|
export const AGENT_NATIVE_STARTER_REPO = "BuilderIO/builder-agent-native-starter";
|
|
41
|
+
/**
|
|
42
|
+
* Whether a repo/workspace-folder refers to the Agent Native starter. Hostable
|
|
43
|
+
* Agent Native projects are born with their own `repoName` (the eagerly
|
|
44
|
+
* provisioned internal host), so the starter is only identifiable via
|
|
45
|
+
* `templateRepoUrl` — the read-only clone source. Matching either keeps both
|
|
46
|
+
* hostable and plain-clone projects working.
|
|
47
|
+
*/
|
|
48
|
+
export const matchesAgentNativeStarter = (repo) => {
|
|
49
|
+
var _a;
|
|
50
|
+
if (repo.repoName === AGENT_NATIVE_STARTER_REPO)
|
|
51
|
+
return true;
|
|
52
|
+
return !!((_a = repo.templateRepoUrl) === null || _a === void 0 ? void 0 : _a.includes(AGENT_NATIVE_STARTER_REPO));
|
|
53
|
+
};
|
|
41
54
|
export const EXAMPLE_OR_STARTER_REPOS = [
|
|
42
55
|
...EXAMPLE_REPOS,
|
|
43
56
|
STARTER_REPO,
|
|
@@ -620,6 +633,15 @@ export const DeployArtifactManifestSchema = z.object({
|
|
|
620
633
|
function_invocation_modes: z.record(z.string(), z.string()).optional().meta({
|
|
621
634
|
description: 'Lambda invocation mode per function name (e.g. "stream" for v2 streaming functions)',
|
|
622
635
|
}),
|
|
636
|
+
function_schedules: z
|
|
637
|
+
.array(z.object({
|
|
638
|
+
name: z.string(),
|
|
639
|
+
cron: z.string(),
|
|
640
|
+
}))
|
|
641
|
+
.optional()
|
|
642
|
+
.meta({
|
|
643
|
+
description: "Scheduled Netlify functions and their cron expressions",
|
|
644
|
+
}),
|
|
623
645
|
});
|
|
624
646
|
/**
|
|
625
647
|
* Per-deploy overrides passed from ai-services to the deploy pod's build-and-upload endpoint.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { AGENT_NATIVE_STARTER_REPO, matchesAgentNativeStarter, } from "./projects";
|
|
3
|
+
describe("matchesAgentNativeStarter", () => {
|
|
4
|
+
it("matches when repoName is the starter", () => {
|
|
5
|
+
expect(matchesAgentNativeStarter({ repoName: AGENT_NATIVE_STARTER_REPO })).toBe(true);
|
|
6
|
+
});
|
|
7
|
+
it("matches hostable projects via templateRepoUrl even when repoName is the internal host", () => {
|
|
8
|
+
expect(matchesAgentNativeStarter({
|
|
9
|
+
repoName: "builder-internal-host/some-project",
|
|
10
|
+
templateRepoUrl: "https://github.com/BuilderIO/builder-agent-native-starter",
|
|
11
|
+
})).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
it("does not match unrelated projects", () => {
|
|
14
|
+
expect(matchesAgentNativeStarter({
|
|
15
|
+
repoName: "acme/dashboard",
|
|
16
|
+
templateRepoUrl: "https://github.com/BuilderIO/fusion-starter",
|
|
17
|
+
})).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
it("does not match when both fields are absent", () => {
|
|
20
|
+
expect(matchesAgentNativeStarter({})).toBe(false);
|
|
21
|
+
});
|
|
22
|
+
});
|