@kodycodes/cli 3.40.0 → 3.41.1
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/api-token.d.ts +1 -1
- package/dist/{auth-GBBIWKPB.js → auth-YDCBANFB.js} +5 -5
- package/dist/bin.js +8 -8
- package/dist/{chunk-OFTFT75V.js → chunk-42C77QLO.js} +93 -11
- package/dist/chunk-42C77QLO.js.map +6 -0
- package/dist/{chunk-35MZOTUL.js → chunk-5VGYHCGW.js} +6 -6
- package/dist/{chunk-HL6FD7UL.js → chunk-F6N7JCMD.js} +5 -5
- package/dist/chunk-F6N7JCMD.js.map +6 -0
- package/dist/{chunk-5ZPZVTTT.js → chunk-MILGY6PM.js} +2 -2
- package/dist/{chunk-VBFUS5VS.js → chunk-MON2WLPF.js} +4 -4
- package/dist/{chunk-EDGEBS25.js → chunk-N5RXQCBQ.js} +2 -2
- package/dist/{chunk-3YVS3237.js → chunk-OPLYCVZM.js} +42 -41
- package/dist/chunk-OPLYCVZM.js.map +6 -0
- package/dist/{chunk-COQHFREF.js → chunk-QJK6DTR5.js} +3 -3
- package/dist/{chunk-SRP5PBSP.js → chunk-REZD6BQ5.js} +3 -3
- package/dist/{chunk-HNLC2H7W.js → chunk-S2PL6T74.js} +3 -3
- package/dist/{chunk-RIUEXR4R.js → chunk-SSLGP7Q3.js} +4 -4
- package/dist/{chunk-MU2WOVN7.js → chunk-T3EM47NE.js} +3 -3
- package/dist/{chunk-HCDO2RMN.js → chunk-V7EVS6AD.js} +2 -2
- package/dist/cli.js +8 -8
- package/dist/{commands-5UYB25R5.js → commands-LTMZH4NG.js} +21 -13
- package/dist/commands-LTMZH4NG.js.map +6 -0
- package/dist/{dev-command-2HKWG2GT.js → dev-command-UIIY427S.js} +8 -8
- package/dist/execution-context/fs-access.d.ts +15 -1
- package/dist/execution-context/machine-capabilities.d.ts +8 -2
- package/dist/{git-credential-IHTFM5PZ.js → git-credential-UITFYZ6T.js} +6 -6
- package/dist/{local-execute-GES63R7D.js → local-execute-L3UR5FS7.js} +43 -7
- package/dist/local-execute-L3UR5FS7.js.map +6 -0
- package/dist/local-execute.d.ts +1 -1
- package/dist/{local-package-graph-67FPK7OV.js → local-package-graph-5HFY4G64.js} +4 -4
- package/dist/{local-package-run-LCG6WJCY.js → local-package-run-PRUMAW2V.js} +8 -8
- package/dist/{local-secrets-WHO57JNS.js → local-secrets-GA6FIJTC.js} +4 -4
- package/dist/{mock-dep-resolve-VIQ7GIDE.js → mock-dep-resolve-HADQXYSI.js} +3 -3
- package/dist/{mock-local-deps-JDAYLRO7.js → mock-local-deps-PUMHENYR.js} +5 -5
- package/dist/{open-api-client-O7SH6HJK.js → open-api-client-FB4TFQ52.js} +4 -4
- package/dist/publish-builder.js +382 -49
- package/dist/{remote-execute-RLVZLLNH.js → remote-execute-43LS7EB7.js} +4 -4
- package/dist/{run-executor-2W5STQV3.js → run-executor-U6QTQV3N.js} +2 -2
- package/dist/{setup-git-Y723F7WP.js → setup-git-3KMOPMJS.js} +5 -5
- package/dist/{whoami-L6GNUTV6.js → whoami-S3Y5IYL2.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-3YVS3237.js.map +0 -6
- package/dist/chunk-HL6FD7UL.js.map +0 -6
- package/dist/chunk-OFTFT75V.js.map +0 -6
- package/dist/commands-5UYB25R5.js.map +0 -6
- package/dist/local-execute-GES63R7D.js.map +0 -6
- /package/dist/{auth-GBBIWKPB.js.map → auth-YDCBANFB.js.map} +0 -0
- /package/dist/{chunk-35MZOTUL.js.map → chunk-5VGYHCGW.js.map} +0 -0
- /package/dist/{chunk-5ZPZVTTT.js.map → chunk-MILGY6PM.js.map} +0 -0
- /package/dist/{chunk-VBFUS5VS.js.map → chunk-MON2WLPF.js.map} +0 -0
- /package/dist/{chunk-EDGEBS25.js.map → chunk-N5RXQCBQ.js.map} +0 -0
- /package/dist/{chunk-COQHFREF.js.map → chunk-QJK6DTR5.js.map} +0 -0
- /package/dist/{chunk-SRP5PBSP.js.map → chunk-REZD6BQ5.js.map} +0 -0
- /package/dist/{chunk-HNLC2H7W.js.map → chunk-S2PL6T74.js.map} +0 -0
- /package/dist/{chunk-RIUEXR4R.js.map → chunk-SSLGP7Q3.js.map} +0 -0
- /package/dist/{chunk-MU2WOVN7.js.map → chunk-T3EM47NE.js.map} +0 -0
- /package/dist/{chunk-HCDO2RMN.js.map → chunk-V7EVS6AD.js.map} +0 -0
- /package/dist/{dev-command-2HKWG2GT.js.map → dev-command-UIIY427S.js.map} +0 -0
- /package/dist/{git-credential-IHTFM5PZ.js.map → git-credential-UITFYZ6T.js.map} +0 -0
- /package/dist/{local-package-graph-67FPK7OV.js.map → local-package-graph-5HFY4G64.js.map} +0 -0
- /package/dist/{local-package-run-LCG6WJCY.js.map → local-package-run-PRUMAW2V.js.map} +0 -0
- /package/dist/{local-secrets-WHO57JNS.js.map → local-secrets-GA6FIJTC.js.map} +0 -0
- /package/dist/{mock-dep-resolve-VIQ7GIDE.js.map → mock-dep-resolve-HADQXYSI.js.map} +0 -0
- /package/dist/{mock-local-deps-JDAYLRO7.js.map → mock-local-deps-PUMHENYR.js.map} +0 -0
- /package/dist/{open-api-client-O7SH6HJK.js.map → open-api-client-FB4TFQ52.js.map} +0 -0
- /package/dist/{remote-execute-RLVZLLNH.js.map → remote-execute-43LS7EB7.js.map} +0 -0
- /package/dist/{run-executor-2W5STQV3.js.map → run-executor-U6QTQV3N.js.map} +0 -0
- /package/dist/{setup-git-Y723F7WP.js.map → setup-git-3KMOPMJS.js.map} +0 -0
- /package/dist/{whoami-L6GNUTV6.js.map → whoami-S3Y5IYL2.js.map} +0 -0
package/dist/publish-builder.js
CHANGED
|
@@ -11175,7 +11175,11 @@ function listKodyPackageDependencyNames(dependencies) {
|
|
|
11175
11175
|
function isPlainObject2(value) {
|
|
11176
11176
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
11177
11177
|
}
|
|
11178
|
-
|
|
11178
|
+
function packageMachineNeedsFor(needs, name) {
|
|
11179
|
+
const entry = needs && Object.hasOwn(needs, name) ? needs[name] : void 0;
|
|
11180
|
+
return entry === void 0 ? [] : Array.isArray(entry) ? entry : [entry];
|
|
11181
|
+
}
|
|
11182
|
+
var kodyPackageIdPattern, packageJobScheduleSchema, packageJobDefinitionSchema, packageAppClientExternalSchema, packageAppClientDefinitionSchema, packageCredentialSlotNamePattern, packageAppCapabilityNamePattern, mcpToolCapabilitySegment, packageMcpToolCapabilityNamePattern, packageCapabilityDeclarationsSchema, packageAppVisitorNeedKeyPattern, packageAppVisitorNeedSchema, packageAppAnonymousRealtimeModes, packageAppDefinitionSchema, packageSecretMountDefinitionSchema, packageSecretProviderIdPattern, packageSecretProviderSchema, packageCredentialKindValues, secretProviderSlotKind, packageCredentialSlotKindValues, ownerCredentialForVisitorsValueMessage, packageCredentialSlotSchema, packageCredentialsSchema, secretProviderSlotPackagePattern, secretProviderSlotOnlyFields, packageSubscriptionDefinitionSchema, httpFieldNamePattern2, webhookSignedPayloadValues, webhookTimestampFormatValues, packageWebhookHmacVerificationSchema, packageWebhookUrlSecretVerificationSchema, packageWebhookVerificationSchema, webhookChallengeParamKeySchema, webhookChallengeWhenValueSchema, packageWebhookSubscriptionChallengeSchema, packageWebhookChallengeSchema, webhookTimestampFormatSchema, packageWebhookReplaySchema, webhookInputModeValues, webhookMaxRateLimitPerMinute, packageWebhookDefinitionSchema, packageWebhooksSchema, packageEmittedEventDefinitionSchema, packageExportConditionSchema, packageExportTargetSchema, scopedPackageNamePattern, kodyPackageDependencySchema, kodyPackageDependencyWildcard, kodyPackageDependenciesSchema, KODY_DESCRIPTION_MAX_LENGTH, kodyDescriptionTooLongPhrase, packagePublishDefinitionSchema, packageMachineNeedNamePattern, maxPackageMachineNeeds, machineNeedDescription, packageMachineNeedSchema, packageMachineNeedListSchema, packageMachineNeedEntrySchema, packageMachineNeedsSchema, authoredPackageKodySchema, authoredPackageJsonSchema;
|
|
11179
11183
|
var init_types = __esm({
|
|
11180
11184
|
"../worker/src/package-registry/types.ts"() {
|
|
11181
11185
|
"use strict";
|
|
@@ -11694,6 +11698,60 @@ var init_types = __esm({
|
|
|
11694
11698
|
)
|
|
11695
11699
|
}).optional()
|
|
11696
11700
|
});
|
|
11701
|
+
packageMachineNeedNamePattern = /^[a-z0-9][a-z0-9_-]{0,62}$/;
|
|
11702
|
+
maxPackageMachineNeeds = 20;
|
|
11703
|
+
machineNeedDescription = external_exports.string().min(1).max(500);
|
|
11704
|
+
packageMachineNeedSchema = external_exports.discriminatedUnion("kind", [
|
|
11705
|
+
external_exports.strictObject({
|
|
11706
|
+
kind: external_exports.literal("command"),
|
|
11707
|
+
description: machineNeedDescription
|
|
11708
|
+
}),
|
|
11709
|
+
external_exports.strictObject({
|
|
11710
|
+
kind: external_exports.literal("lan"),
|
|
11711
|
+
description: machineNeedDescription,
|
|
11712
|
+
hosts: external_exports.array(external_exports.union([external_exports.ipv4(), external_exports.ipv6(), external_exports.cidrv4(), external_exports.cidrv6()])).min(1).max(20).optional(),
|
|
11713
|
+
ports: external_exports.array(external_exports.number().int().min(1).max(65535)).min(1).max(20).optional()
|
|
11714
|
+
}),
|
|
11715
|
+
external_exports.strictObject({
|
|
11716
|
+
kind: external_exports.literal("fs"),
|
|
11717
|
+
description: machineNeedDescription,
|
|
11718
|
+
mode: external_exports.enum(["ro", "rw"])
|
|
11719
|
+
})
|
|
11720
|
+
]);
|
|
11721
|
+
packageMachineNeedListSchema = external_exports.array(packageMachineNeedSchema).min(1).max(3).refine(
|
|
11722
|
+
(needs) => new Set(needs.map((need) => need.kind)).size === needs.length,
|
|
11723
|
+
{ message: "A list can hold one entry per kind." }
|
|
11724
|
+
);
|
|
11725
|
+
packageMachineNeedEntrySchema = external_exports.unknown().transform((value, ctx) => {
|
|
11726
|
+
const parsed = Array.isArray(value) ? packageMachineNeedListSchema.safeParse(value) : packageMachineNeedSchema.safeParse(value);
|
|
11727
|
+
if (parsed.success) return parsed.data;
|
|
11728
|
+
for (const issue2 of parsed.error.issues) {
|
|
11729
|
+
ctx.addIssue({ code: "custom", message: issue2.message, path: issue2.path });
|
|
11730
|
+
}
|
|
11731
|
+
return external_exports.NEVER;
|
|
11732
|
+
});
|
|
11733
|
+
packageMachineNeedsSchema = external_exports.record(external_exports.string(), packageMachineNeedEntrySchema).superRefine((needs, ctx) => {
|
|
11734
|
+
const names = Object.keys(needs);
|
|
11735
|
+
const count = names.reduce(
|
|
11736
|
+
(total, name) => total + packageMachineNeedsFor(needs, name).length,
|
|
11737
|
+
0
|
|
11738
|
+
);
|
|
11739
|
+
if (count > maxPackageMachineNeeds) {
|
|
11740
|
+
ctx.addIssue({
|
|
11741
|
+
code: "custom",
|
|
11742
|
+
message: `kody.machine can declare at most ${maxPackageMachineNeeds} entries.`
|
|
11743
|
+
});
|
|
11744
|
+
}
|
|
11745
|
+
for (const name of names) {
|
|
11746
|
+
if (!packageMachineNeedNamePattern.test(name)) {
|
|
11747
|
+
ctx.addIssue({
|
|
11748
|
+
code: "custom",
|
|
11749
|
+
path: [name],
|
|
11750
|
+
message: `kody.machine key ${JSON.stringify(name)} must be the entry's name on the machine: lowercase letters, digits, "-" or "_" (at most 63 characters), e.g. "kdocker".`
|
|
11751
|
+
});
|
|
11752
|
+
}
|
|
11753
|
+
}
|
|
11754
|
+
});
|
|
11697
11755
|
authoredPackageKodySchema = external_exports.object({
|
|
11698
11756
|
id: external_exports.string().regex(kodyPackageIdPattern).optional(),
|
|
11699
11757
|
// No max here: this schema is shared by load/parse. Enforce
|
|
@@ -11711,6 +11769,8 @@ var init_types = __esm({
|
|
|
11711
11769
|
*/
|
|
11712
11770
|
capabilities: packageCapabilityDeclarationsSchema.optional(),
|
|
11713
11771
|
credentials: packageCredentialsSchema.optional(),
|
|
11772
|
+
/** Machine access the package's code uses on an execution context. */
|
|
11773
|
+
machine: packageMachineNeedsSchema.optional(),
|
|
11714
11774
|
secretMounts: external_exports.record(external_exports.string().min(1), packageSecretMountDefinitionSchema).optional(),
|
|
11715
11775
|
secretProvider: packageSecretProviderSchema.optional(),
|
|
11716
11776
|
subscriptions: external_exports.record(external_exports.string().min(1), packageSubscriptionDefinitionSchema).optional(),
|
|
@@ -11819,6 +11879,7 @@ function parseAuthoredPackageJson(input3) {
|
|
|
11819
11879
|
parsed = dropRetiredOnceJobs(parsed);
|
|
11820
11880
|
}
|
|
11821
11881
|
const invalidCredentialSlots = input3.mode === "published" ? splitPublishedCredentials(parsed) : null;
|
|
11882
|
+
if (input3.mode === "published") dropInvalidPublishedMachineNeeds(parsed);
|
|
11822
11883
|
const result = authoredPackageJsonSchema.safeParse(parsed);
|
|
11823
11884
|
if (!result.success) {
|
|
11824
11885
|
const formatted = external_exports.prettifyError(result.error);
|
|
@@ -11954,6 +12015,13 @@ function splitPublishedCredentials(parsed) {
|
|
|
11954
12015
|
kody.credentials = Object.fromEntries(valid);
|
|
11955
12016
|
return invalid.length > 0 ? Object.fromEntries(invalid) : null;
|
|
11956
12017
|
}
|
|
12018
|
+
function dropInvalidPublishedMachineNeeds(parsed) {
|
|
12019
|
+
if (!isPlainRecord2(parsed) || !isPlainRecord2(parsed.kody)) return;
|
|
12020
|
+
if (!("machine" in parsed.kody)) return;
|
|
12021
|
+
if (!packageMachineNeedsSchema.safeParse(parsed.kody.machine).success) {
|
|
12022
|
+
delete parsed.kody.machine;
|
|
12023
|
+
}
|
|
12024
|
+
}
|
|
11957
12025
|
function dropRetiredOnceJobs(parsed) {
|
|
11958
12026
|
if (!isPlainRecord2(parsed) || !isPlainRecord2(parsed.kody)) return parsed;
|
|
11959
12027
|
const jobs = parsed.kody.jobs;
|
|
@@ -26656,9 +26724,149 @@ var init_module_source = __esm({
|
|
|
26656
26724
|
});
|
|
26657
26725
|
|
|
26658
26726
|
// ../worker/src/package-runtime/module-scope-bindings.ts
|
|
26727
|
+
function nameOf(node2) {
|
|
26728
|
+
const typed = node2;
|
|
26729
|
+
return typed?.type === "Identifier" && typeof typed.name === "string" ? typed.name : null;
|
|
26730
|
+
}
|
|
26731
|
+
function patternIdentifiers(pattern, into) {
|
|
26732
|
+
const node2 = pattern;
|
|
26733
|
+
if (!node2) return;
|
|
26734
|
+
switch (node2.type) {
|
|
26735
|
+
case "Identifier":
|
|
26736
|
+
into.push(node2);
|
|
26737
|
+
return;
|
|
26738
|
+
case "AssignmentPattern":
|
|
26739
|
+
patternIdentifiers(node2.left, into);
|
|
26740
|
+
return;
|
|
26741
|
+
case "RestElement":
|
|
26742
|
+
patternIdentifiers(node2.argument, into);
|
|
26743
|
+
return;
|
|
26744
|
+
case "TSParameterProperty":
|
|
26745
|
+
patternIdentifiers(node2.parameter, into);
|
|
26746
|
+
return;
|
|
26747
|
+
case "ArrayPattern":
|
|
26748
|
+
for (const element of node2.elements) {
|
|
26749
|
+
patternIdentifiers(element, into);
|
|
26750
|
+
}
|
|
26751
|
+
return;
|
|
26752
|
+
case "ObjectPattern":
|
|
26753
|
+
for (const property of node2.properties) {
|
|
26754
|
+
patternIdentifiers(
|
|
26755
|
+
property.type === "RestElement" ? property : property.value,
|
|
26756
|
+
into
|
|
26757
|
+
);
|
|
26758
|
+
}
|
|
26759
|
+
return;
|
|
26760
|
+
default:
|
|
26761
|
+
return;
|
|
26762
|
+
}
|
|
26763
|
+
}
|
|
26764
|
+
function resolveModuleBindings(program) {
|
|
26765
|
+
const scopes = /* @__PURE__ */ new Map();
|
|
26766
|
+
const declare = (scope, pattern) => {
|
|
26767
|
+
const identifiers = [];
|
|
26768
|
+
patternIdentifiers(pattern, identifiers);
|
|
26769
|
+
for (const identifier of identifiers) {
|
|
26770
|
+
const name = nameOf(identifier);
|
|
26771
|
+
if (!scope.bindings.has(name)) scope.bindings.set(name, { name });
|
|
26772
|
+
}
|
|
26773
|
+
};
|
|
26774
|
+
const functionScopeOf = (scope) => {
|
|
26775
|
+
let current = scope;
|
|
26776
|
+
while (!current.isFunction && current.parent) current = current.parent;
|
|
26777
|
+
return current;
|
|
26778
|
+
};
|
|
26779
|
+
const newScope = (parent, isFunction) => ({
|
|
26780
|
+
bindings: /* @__PURE__ */ new Map(),
|
|
26781
|
+
parent,
|
|
26782
|
+
isFunction
|
|
26783
|
+
});
|
|
26784
|
+
const build2 = (input3, scope) => {
|
|
26785
|
+
if (!input3 || typeof input3 !== "object") return;
|
|
26786
|
+
if (Array.isArray(input3)) {
|
|
26787
|
+
for (const entry of input3) build2(entry, scope);
|
|
26788
|
+
return;
|
|
26789
|
+
}
|
|
26790
|
+
const node2 = input3;
|
|
26791
|
+
let inner = scope;
|
|
26792
|
+
if (typeof node2.type === "string") {
|
|
26793
|
+
if (functionTypes.has(node2.type)) {
|
|
26794
|
+
if (node2.type === "FunctionDeclaration") declare(scope, node2.id);
|
|
26795
|
+
inner = newScope(scope, true);
|
|
26796
|
+
if (node2.type === "FunctionExpression") declare(inner, node2.id);
|
|
26797
|
+
for (const parameter of node2.params ?? []) {
|
|
26798
|
+
declare(inner, parameter);
|
|
26799
|
+
}
|
|
26800
|
+
} else if (scopeTypes.has(node2.type)) {
|
|
26801
|
+
inner = newScope(scope, false);
|
|
26802
|
+
if (node2.type === "CatchClause") declare(inner, node2.param);
|
|
26803
|
+
} else if (node2.type === "ClassDeclaration") {
|
|
26804
|
+
declare(scope, node2.id);
|
|
26805
|
+
} else if (node2.type === "ClassExpression" && node2.id) {
|
|
26806
|
+
inner = newScope(scope, false);
|
|
26807
|
+
declare(inner, node2.id);
|
|
26808
|
+
} else if (node2.type === "VariableDeclaration") {
|
|
26809
|
+
const target = node2.kind === "var" ? functionScopeOf(scope) : scope;
|
|
26810
|
+
for (const declarator of node2.declarations) {
|
|
26811
|
+
declare(target, declarator.id);
|
|
26812
|
+
}
|
|
26813
|
+
} else if (node2.type === "ImportSpecifier" || node2.type === "ImportDefaultSpecifier" || node2.type === "ImportNamespaceSpecifier") {
|
|
26814
|
+
declare(scope, node2.local);
|
|
26815
|
+
}
|
|
26816
|
+
scopes.set(node2, inner);
|
|
26817
|
+
}
|
|
26818
|
+
for (const value of Object.values(node2)) build2(value, inner);
|
|
26819
|
+
};
|
|
26820
|
+
const root = { bindings: /* @__PURE__ */ new Map(), parent: null, isFunction: true };
|
|
26821
|
+
build2(program, root);
|
|
26822
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
26823
|
+
const resolve = (input3, scope) => {
|
|
26824
|
+
if (!input3 || typeof input3 !== "object") return;
|
|
26825
|
+
if (Array.isArray(input3)) {
|
|
26826
|
+
for (const entry of input3) resolve(entry, scope);
|
|
26827
|
+
return;
|
|
26828
|
+
}
|
|
26829
|
+
const node2 = input3;
|
|
26830
|
+
const name = nameOf(node2);
|
|
26831
|
+
if (name) {
|
|
26832
|
+
for (let current = scope; current; current = current.parent) {
|
|
26833
|
+
const binding = current.bindings.get(name);
|
|
26834
|
+
if (!binding) continue;
|
|
26835
|
+
resolved.set(node2, binding);
|
|
26836
|
+
break;
|
|
26837
|
+
}
|
|
26838
|
+
}
|
|
26839
|
+
const inner = scopes.get(node2) ?? scope;
|
|
26840
|
+
for (const [key, value] of Object.entries(node2)) {
|
|
26841
|
+
const declaredName = key === "id" && (node2.type === "FunctionDeclaration" || node2.type === "ClassDeclaration");
|
|
26842
|
+
resolve(value, declaredName ? scope : inner);
|
|
26843
|
+
}
|
|
26844
|
+
};
|
|
26845
|
+
resolve(program, root);
|
|
26846
|
+
return resolved;
|
|
26847
|
+
}
|
|
26848
|
+
var functionTypes, scopeTypes;
|
|
26659
26849
|
var init_module_scope_bindings = __esm({
|
|
26660
26850
|
"../worker/src/package-runtime/module-scope-bindings.ts"() {
|
|
26661
26851
|
"use strict";
|
|
26852
|
+
functionTypes = /* @__PURE__ */ new Set([
|
|
26853
|
+
"FunctionDeclaration",
|
|
26854
|
+
"FunctionExpression",
|
|
26855
|
+
"ArrowFunctionExpression",
|
|
26856
|
+
"ObjectMethod",
|
|
26857
|
+
"ClassMethod",
|
|
26858
|
+
"ClassPrivateMethod"
|
|
26859
|
+
]);
|
|
26860
|
+
scopeTypes = /* @__PURE__ */ new Set([
|
|
26861
|
+
"BlockStatement",
|
|
26862
|
+
"ForStatement",
|
|
26863
|
+
"ForInStatement",
|
|
26864
|
+
"ForOfStatement",
|
|
26865
|
+
"SwitchStatement",
|
|
26866
|
+
"CatchClause",
|
|
26867
|
+
"StaticBlock",
|
|
26868
|
+
"ClassBody"
|
|
26869
|
+
]);
|
|
26662
26870
|
}
|
|
26663
26871
|
});
|
|
26664
26872
|
|
|
@@ -26715,6 +26923,80 @@ async function collectTopLevelFetchCollisionNames(source) {
|
|
|
26715
26923
|
return null;
|
|
26716
26924
|
}
|
|
26717
26925
|
}
|
|
26926
|
+
function sourceMayReadFetchThroughGlobalObject(source) {
|
|
26927
|
+
return /\b(?:globalThis|self)\b/.test(source) && source.includes("fetch");
|
|
26928
|
+
}
|
|
26929
|
+
async function rewriteGlobalObjectFetchReads(source, replacement) {
|
|
26930
|
+
const found = await collectGlobalObjectFetchReads(source);
|
|
26931
|
+
if (!found) return source;
|
|
26932
|
+
let next2 = source;
|
|
26933
|
+
for (const read of found.reads.sort((a2, b3) => b3.start - a2.start)) {
|
|
26934
|
+
next2 = `${next2.slice(0, read.start)}${replacement}${next2.slice(read.end)}`;
|
|
26935
|
+
}
|
|
26936
|
+
return next2;
|
|
26937
|
+
}
|
|
26938
|
+
async function sourceReadsFetchThroughGlobalObject(source) {
|
|
26939
|
+
return ((await collectGlobalObjectFetchReads(source))?.reads.length ?? 0) > 0;
|
|
26940
|
+
}
|
|
26941
|
+
async function collectGlobalObjectFetchReads(source) {
|
|
26942
|
+
if (!sourceMayReadFetchThroughGlobalObject(source)) return null;
|
|
26943
|
+
let parsed;
|
|
26944
|
+
try {
|
|
26945
|
+
parsed = await parseModuleSource(source);
|
|
26946
|
+
} catch {
|
|
26947
|
+
return null;
|
|
26948
|
+
}
|
|
26949
|
+
const bindings = resolveModuleBindings(parsed);
|
|
26950
|
+
const reads = [];
|
|
26951
|
+
walkAst(parsed, (node2, parent) => {
|
|
26952
|
+
if (node2.type !== "Identifier") return;
|
|
26953
|
+
const name = node2.name;
|
|
26954
|
+
if (typeof name !== "string" || !globalObjectNames.has(name)) return;
|
|
26955
|
+
if (bindings.has(node2)) return;
|
|
26956
|
+
const member = parent;
|
|
26957
|
+
const isMember = member?.type === "MemberExpression" || member?.type === "OptionalMemberExpression" || member?.type === "StaticMemberExpression" || member?.type === "ComputedMemberExpression";
|
|
26958
|
+
if (!isMember || member.object !== node2) return;
|
|
26959
|
+
const property = member.property;
|
|
26960
|
+
const propertyName = member.computed === true ? typeof property?.value === "string" ? property.value : null : typeof property?.name === "string" ? property.name : null;
|
|
26961
|
+
if (propertyName !== "fetch") return;
|
|
26962
|
+
if (typeof member.start !== "number" || typeof member.end !== "number") {
|
|
26963
|
+
return;
|
|
26964
|
+
}
|
|
26965
|
+
reads.push({ start: member.start, end: member.end });
|
|
26966
|
+
});
|
|
26967
|
+
const writes = collectMemberWriteStarts(parsed);
|
|
26968
|
+
return { reads: reads.filter((read) => !writes.has(read.start)) };
|
|
26969
|
+
}
|
|
26970
|
+
function collectMemberWriteStarts(parsed) {
|
|
26971
|
+
const starts = /* @__PURE__ */ new Set();
|
|
26972
|
+
const addTarget = (target) => {
|
|
26973
|
+
walkAst(target, (inner) => {
|
|
26974
|
+
if (typeof inner.start === "number") starts.add(inner.start);
|
|
26975
|
+
});
|
|
26976
|
+
};
|
|
26977
|
+
walkAst(parsed, (node2) => {
|
|
26978
|
+
if (node2.type === "AssignmentExpression") {
|
|
26979
|
+
addTarget(node2.left);
|
|
26980
|
+
} else if (node2.type === "UpdateExpression" || node2.type === "UnaryExpression" && node2.operator === "delete") {
|
|
26981
|
+
addTarget(node2.argument);
|
|
26982
|
+
} else if (node2.type === "ForInStatement" || node2.type === "ForOfStatement") {
|
|
26983
|
+
addTarget(node2.left);
|
|
26984
|
+
}
|
|
26985
|
+
});
|
|
26986
|
+
return starts;
|
|
26987
|
+
}
|
|
26988
|
+
function walkAst(node2, visit2, parent) {
|
|
26989
|
+
if (!node2 || typeof node2 !== "object") return;
|
|
26990
|
+
const typed = node2;
|
|
26991
|
+
if (typeof typed.type === "string") visit2(typed, parent);
|
|
26992
|
+
for (const value of Object.values(typed)) {
|
|
26993
|
+
if (Array.isArray(value)) {
|
|
26994
|
+
for (const entry of value) walkAst(entry, visit2, typed);
|
|
26995
|
+
continue;
|
|
26996
|
+
}
|
|
26997
|
+
walkAst(value, visit2, typed);
|
|
26998
|
+
}
|
|
26999
|
+
}
|
|
26718
27000
|
function getBindingIdentifierName(node2) {
|
|
26719
27001
|
if (!node2 || typeof node2 !== "object") return null;
|
|
26720
27002
|
const typed = node2;
|
|
@@ -26762,12 +27044,14 @@ function collectPatternBoundNames(node2, names) {
|
|
|
26762
27044
|
return;
|
|
26763
27045
|
}
|
|
26764
27046
|
}
|
|
27047
|
+
var globalObjectNames;
|
|
26765
27048
|
var init_rewrite_local_execute_secret_fetch = __esm({
|
|
26766
27049
|
"../worker/src/package-runtime/rewrite-local-execute-secret-fetch.ts"() {
|
|
26767
27050
|
"use strict";
|
|
26768
27051
|
init_module_source();
|
|
26769
27052
|
init_module_scope_bindings();
|
|
26770
27053
|
init_module_graph_path_basics();
|
|
27054
|
+
globalObjectNames = /* @__PURE__ */ new Set(["globalThis", "self"]);
|
|
26771
27055
|
}
|
|
26772
27056
|
});
|
|
26773
27057
|
|
|
@@ -29135,7 +29419,7 @@ function denialMessage(code2, permission, resource, mintScopes = [permission]) {
|
|
|
29135
29419
|
case "missing_permission":
|
|
29136
29420
|
return `Missing ${permission}${target}. ${ownerCanGrant(permission, resource)}`;
|
|
29137
29421
|
case "credential_scope":
|
|
29138
|
-
return `This credential is not scoped for ${permission}${target}. Mint a token that adds it: from Kody MCP, call cliCredentialBootstrap({ lifetime: "
|
|
29422
|
+
return `This credential is not scoped for ${permission}${target}. Mint a token that adds it: from Kody MCP, call cliCredentialBootstrap({ lifetime: "long", scopes: [${mintScopes.map((scope) => JSON.stringify(scope)).join(", ")}] }) and run the returned cli_command; or after \`kody login\`, run \`npx @kodycodes/cli auth bootstrap --lifetime long --scopes ${mintScopes.join(",")}\`. Use those scopes with tokenCreate only for CI/headless.`;
|
|
29139
29423
|
case "profile_inactive":
|
|
29140
29424
|
case "profile_grant":
|
|
29141
29425
|
return `This profile cannot use ${permission}${target}.`;
|
|
@@ -30916,6 +31200,9 @@ var init_runtime_source_modules = __esm({
|
|
|
30916
31200
|
});
|
|
30917
31201
|
|
|
30918
31202
|
// ../worker/src/package-runtime/pre-binding-artifact-repair.ts
|
|
31203
|
+
function hasLexicalBindingMarker(artifact) {
|
|
31204
|
+
return (artifact.packageBindingRewrite ?? 0) >= lexicalBindingRewriteVersion;
|
|
31205
|
+
}
|
|
30919
31206
|
function warnUnrepairedModule(input3) {
|
|
30920
31207
|
console.warn(
|
|
30921
31208
|
JSON.stringify({
|
|
@@ -30979,9 +31266,7 @@ function isRepairableArtifactKind(kind) {
|
|
|
30979
31266
|
}
|
|
30980
31267
|
function isPreBindingPublishedArtifact(artifact) {
|
|
30981
31268
|
if (!isRepairableArtifactKind(artifact.kind)) return false;
|
|
30982
|
-
if (artifact
|
|
30983
|
-
return false;
|
|
30984
|
-
}
|
|
31269
|
+
if (hasLexicalBindingMarker(artifact)) return false;
|
|
30985
31270
|
let needsBinding = false;
|
|
30986
31271
|
for (const [modulePath, module] of Object.entries(artifact.modules)) {
|
|
30987
31272
|
if (isPlatformRuntimeModulePath(modulePath)) continue;
|
|
@@ -31057,6 +31342,61 @@ ${source}`
|
|
|
31057
31342
|
if (!modules) return artifact;
|
|
31058
31343
|
return { ...artifact, modules };
|
|
31059
31344
|
}
|
|
31345
|
+
async function artifactReadsFetchThroughGlobalObject(artifact) {
|
|
31346
|
+
for (const [modulePath, module] of Object.entries(artifact.modules)) {
|
|
31347
|
+
if (isPlatformRuntimeModulePath(modulePath)) continue;
|
|
31348
|
+
const source = moduleSource(module);
|
|
31349
|
+
if (source == null || !sourceMayReadFetchThroughGlobalObject(source)) {
|
|
31350
|
+
continue;
|
|
31351
|
+
}
|
|
31352
|
+
if (await sourceReadsFetchThroughGlobalObject(source)) return true;
|
|
31353
|
+
}
|
|
31354
|
+
return false;
|
|
31355
|
+
}
|
|
31356
|
+
async function repairGlobalObjectFetchReadsInArtifact(artifact) {
|
|
31357
|
+
if (!isRepairableArtifactKind(artifact.kind)) return artifact;
|
|
31358
|
+
if (artifact.packageBindingRewrite === packageBindingRewriteVersion) {
|
|
31359
|
+
return artifact;
|
|
31360
|
+
}
|
|
31361
|
+
const ownPackageId = artifact.packageContext?.packageId?.trim();
|
|
31362
|
+
if (!ownPackageId) return artifact;
|
|
31363
|
+
if (publishedArtifactInlinesOtherPackages(artifact)) return artifact;
|
|
31364
|
+
let modules = null;
|
|
31365
|
+
for (const [modulePath, module] of Object.entries(artifact.modules)) {
|
|
31366
|
+
if (isPlatformRuntimeModulePath(modulePath)) continue;
|
|
31367
|
+
const original = moduleSource(module);
|
|
31368
|
+
if (original == null || !sourceMayReadFetchThroughGlobalObject(original)) {
|
|
31369
|
+
continue;
|
|
31370
|
+
}
|
|
31371
|
+
const rewritten = await rewriteGlobalObjectFetchReads(
|
|
31372
|
+
original,
|
|
31373
|
+
repairGlobalReadFetchName
|
|
31374
|
+
);
|
|
31375
|
+
if (rewritten === original) continue;
|
|
31376
|
+
const collisions = await collectTopLevelFetchCollisionNames(original);
|
|
31377
|
+
if (!collisions || collisions.has(repairGlobalReadFetchName) || collisions.has(repairGlobalReadCreatorName)) {
|
|
31378
|
+
warnUnrepairedModule({
|
|
31379
|
+
artifact,
|
|
31380
|
+
modulePath,
|
|
31381
|
+
reason: collisions ? "creator-name-collision" : "parse-failed"
|
|
31382
|
+
});
|
|
31383
|
+
continue;
|
|
31384
|
+
}
|
|
31385
|
+
modules ??= { ...artifact.modules };
|
|
31386
|
+
modules[modulePath] = withModuleSource(
|
|
31387
|
+
module,
|
|
31388
|
+
[
|
|
31389
|
+
`import { __kodyCreatePackageBoundFetch as ${repairGlobalReadCreatorName} } from ${JSON.stringify(
|
|
31390
|
+
runtimeSpecifierFrom(modulePath)
|
|
31391
|
+
)};`,
|
|
31392
|
+
`const ${repairGlobalReadFetchName} = ${repairGlobalReadCreatorName}(${JSON.stringify(ownPackageId)});`,
|
|
31393
|
+
rewritten
|
|
31394
|
+
].join("\n")
|
|
31395
|
+
);
|
|
31396
|
+
}
|
|
31397
|
+
if (!modules) return artifact;
|
|
31398
|
+
return { ...artifact, modules };
|
|
31399
|
+
}
|
|
31060
31400
|
function artifactMentionsLexicalPackageBinding(artifact) {
|
|
31061
31401
|
for (const [modulePath, module] of Object.entries(artifact.modules)) {
|
|
31062
31402
|
if (isPlatformRuntimeModulePath(modulePath)) continue;
|
|
@@ -31068,20 +31408,22 @@ function artifactMentionsLexicalPackageBinding(artifact) {
|
|
|
31068
31408
|
}
|
|
31069
31409
|
return false;
|
|
31070
31410
|
}
|
|
31071
|
-
function isUnrepairablePreBindingArtifact(artifact) {
|
|
31411
|
+
async function isUnrepairablePreBindingArtifact(artifact) {
|
|
31072
31412
|
if (!artifact.packageContext?.packageId) return false;
|
|
31073
31413
|
if (!isRepairableArtifactKind(artifact.kind)) return false;
|
|
31074
31414
|
if (!publishedArtifactInlinesOtherPackages(artifact)) return false;
|
|
31075
31415
|
if (artifact.packageBindingRewrite === packageBindingRewriteVersion) {
|
|
31076
31416
|
return false;
|
|
31077
31417
|
}
|
|
31418
|
+
if (await artifactReadsFetchThroughGlobalObject(artifact)) return true;
|
|
31419
|
+
if (hasLexicalBindingMarker(artifact)) return false;
|
|
31078
31420
|
if (!isPreBindingPublishedArtifact(artifact) && artifactMentionsLexicalPackageBinding(artifact)) {
|
|
31079
31421
|
return false;
|
|
31080
31422
|
}
|
|
31081
31423
|
return true;
|
|
31082
31424
|
}
|
|
31083
|
-
function publishedArtifactNeedsPackageBindingRebuild(input3) {
|
|
31084
|
-
if (!isUnrepairablePreBindingArtifact(input3.artifact)) return false;
|
|
31425
|
+
async function publishedArtifactNeedsPackageBindingRebuild(input3) {
|
|
31426
|
+
if (!await isUnrepairablePreBindingArtifact(input3.artifact)) return false;
|
|
31085
31427
|
const missing = listMissingPublishedSourceInstalledDependencies(
|
|
31086
31428
|
input3.sourceFiles
|
|
31087
31429
|
);
|
|
@@ -31095,7 +31437,7 @@ function publishedArtifactNeedsPackageBindingRebuild(input3) {
|
|
|
31095
31437
|
);
|
|
31096
31438
|
return false;
|
|
31097
31439
|
}
|
|
31098
|
-
var packageBindingRewriteVersion, lexicalBindingNames, repairFetchCreatorName, repairKodyCreatorName, freeFetchPattern, sharedRuntimeImportPattern, browserArtifactKinds;
|
|
31440
|
+
var packageBindingRewriteVersion, lexicalBindingRewriteVersion, lexicalBindingNames, repairFetchCreatorName, repairKodyCreatorName, freeFetchPattern, sharedRuntimeImportPattern, browserArtifactKinds, repairGlobalReadFetchName, repairGlobalReadCreatorName;
|
|
31099
31441
|
var init_pre_binding_artifact_repair = __esm({
|
|
31100
31442
|
"../worker/src/package-runtime/pre-binding-artifact-repair.ts"() {
|
|
31101
31443
|
"use strict";
|
|
@@ -31103,7 +31445,8 @@ var init_pre_binding_artifact_repair = __esm({
|
|
|
31103
31445
|
init_published_source_dependencies();
|
|
31104
31446
|
init_rewrite_local_execute_secret_fetch();
|
|
31105
31447
|
init_runtime_source_modules();
|
|
31106
|
-
packageBindingRewriteVersion =
|
|
31448
|
+
packageBindingRewriteVersion = 2;
|
|
31449
|
+
lexicalBindingRewriteVersion = 1;
|
|
31107
31450
|
lexicalBindingNames = [
|
|
31108
31451
|
"__kodyCreatePackageBoundFetch",
|
|
31109
31452
|
"__kodyCreatePackageBoundKody",
|
|
@@ -31114,6 +31457,8 @@ var init_pre_binding_artifact_repair = __esm({
|
|
|
31114
31457
|
freeFetchPattern = /\bfetch\b/;
|
|
31115
31458
|
sharedRuntimeImportPattern = /^import\s*\{([^}]*)\}\s*from\s*("[^"\n]*\.__kody_virtual__\/runtime\.js");?[ \t]*$/gm;
|
|
31116
31459
|
browserArtifactKinds = /* @__PURE__ */ new Set(["app-client"]);
|
|
31460
|
+
repairGlobalReadFetchName = "__kodyPreBindingGlobalReadFetch";
|
|
31461
|
+
repairGlobalReadCreatorName = "__kodyPreBindingGlobalReadCreator";
|
|
31117
31462
|
}
|
|
31118
31463
|
});
|
|
31119
31464
|
|
|
@@ -31821,7 +32166,9 @@ async function parseStoredPublishedBundleArtifact(stored) {
|
|
|
31821
32166
|
};
|
|
31822
32167
|
if (!isRepairableArtifactKind(loaded.kind)) return loaded;
|
|
31823
32168
|
return repairInlinedFacadeBindingsInArtifact(
|
|
31824
|
-
await
|
|
32169
|
+
await repairGlobalObjectFetchReadsInArtifact(
|
|
32170
|
+
await repairPreBindingPublishedArtifact(loaded)
|
|
32171
|
+
)
|
|
31825
32172
|
);
|
|
31826
32173
|
}
|
|
31827
32174
|
var sourceSnapshotVersion, sourceManifestSnapshotVersion, bundleArtifactVersion, sourceSnapshotPrefix, sourceManifestSnapshotPrefix, bundleArtifactPrefix, packageAppTemplateVersion, packageAppTemplatePrefix, packageAppClientPointerPrefix;
|
|
@@ -197493,7 +197840,7 @@ function renderStaticCss(selector, styles) {
|
|
|
197493
197840
|
const own2 = declarations.length ? `${selector}{${declarations.join(";")}}` : "";
|
|
197494
197841
|
return own2 + nested.join("");
|
|
197495
197842
|
}
|
|
197496
|
-
var hoverMq, buttonSizes, pageHeadCss, markdownTableCss, proseCss, stackedPageCss, layoutMaxWidths, pageGutter, siteHeaderNavPaddingBlock, siteHeaderBrandMinHeight, siteHeaderHairline, siteHeaderHeight, accountRailContentTop, accountRailGapBelowHeader, workspaceTextureCss, packageDetailPageCss, pageHeaderCss, pageEyebrowCss, pageTitleCss, pageDescriptionCss, cardCss, insetCardCss, cardTitleCss, sectionTitleCss, descriptionCss, nativeDisclosureCss, fieldLabelCss, fieldLabelRowCss, fieldDescriptionCss, fieldErrorCss, choiceControlCss, inlineSpinnerCss, focusRingCss, visuallyHiddenCss, visuallyHiddenUntilFocusedCss, listCss, detailGridCss, detailItemCss, detailLabelCss, detailValueCss
|
|
197843
|
+
var hoverMq, buttonSizes, pageHeadCss, markdownTableCss, proseCss, stackedPageCss, layoutMaxWidths, pageGutter, siteHeaderNavPaddingBlock, siteHeaderBrandMinHeight, siteHeaderHairline, siteHeaderHeight, accountRailContentTop, accountRailGapBelowHeader, workspaceTextureCss, packageDetailPageCss, pageHeaderCss, pageEyebrowCss, pageTitleCss, pageDescriptionCss, cardCss, insetCardCss, cardTitleCss, sectionTitleCss, descriptionCss, nativeDisclosureCss, fieldLabelCss, fieldLabelRowCss, fieldDescriptionCss, fieldErrorCss, choiceControlCss, inlineSpinnerCss, focusRingCss, visuallyHiddenCss, visuallyHiddenUntilFocusedCss, listCss, detailGridCss, detailItemCss, detailLabelCss, detailValueCss;
|
|
197497
197844
|
var init_style_primitives = __esm({
|
|
197498
197845
|
"../worker/universal/styles/style-primitives.ts"() {
|
|
197499
197846
|
"use strict";
|
|
@@ -198038,22 +198385,6 @@ var init_style_primitives = __esm({
|
|
|
198038
198385
|
overflowWrap: "anywhere",
|
|
198039
198386
|
whiteSpace: "normal"
|
|
198040
198387
|
};
|
|
198041
|
-
primaryLinkCss = {
|
|
198042
|
-
color: colors.primaryText,
|
|
198043
|
-
fontWeight: typography.fontWeight.medium,
|
|
198044
|
-
textDecoration: "none",
|
|
198045
|
-
"&:hover": {
|
|
198046
|
-
textDecoration: "underline"
|
|
198047
|
-
}
|
|
198048
|
-
};
|
|
198049
|
-
mutedLinkCss = {
|
|
198050
|
-
color: colors.textMuted,
|
|
198051
|
-
fontSize: typography.fontSize.sm,
|
|
198052
|
-
textDecoration: "none",
|
|
198053
|
-
"&:hover": {
|
|
198054
|
-
textDecoration: "underline"
|
|
198055
|
-
}
|
|
198056
|
-
};
|
|
198057
198388
|
}
|
|
198058
198389
|
});
|
|
198059
198390
|
|
|
@@ -201328,7 +201659,7 @@ async function maybeEnsurePublishedArtifactTarget(input3) {
|
|
|
201328
201659
|
if (!artifact?.artifact) {
|
|
201329
201660
|
return null;
|
|
201330
201661
|
}
|
|
201331
|
-
if (publishedArtifactNeedsPackageBindingRebuild({
|
|
201662
|
+
if (await publishedArtifactNeedsPackageBindingRebuild({
|
|
201332
201663
|
artifact: artifact.artifact,
|
|
201333
201664
|
sourceFiles: input3.loaded.files
|
|
201334
201665
|
})) {
|
|
@@ -201656,6 +201987,23 @@ async function rewriteKodyImports(input3) {
|
|
|
201656
201987
|
`;
|
|
201657
201988
|
}
|
|
201658
201989
|
}
|
|
201990
|
+
if (input3.sourcePackageId && !input3.source.includes(packageOwnFetchName)) {
|
|
201991
|
+
const rewritten2 = await rewriteGlobalObjectFetchReads(
|
|
201992
|
+
input3.source,
|
|
201993
|
+
packageOwnFetchName
|
|
201994
|
+
);
|
|
201995
|
+
if (rewritten2 !== input3.source) {
|
|
201996
|
+
const facadePath = ensurePackageRuntimeModule(
|
|
201997
|
+
input3.state,
|
|
201998
|
+
input3.sourcePackageId
|
|
201999
|
+
);
|
|
202000
|
+
boundFetchPrefix += `import { __kodyBoundFetch as ${packageOwnFetchName} } from ${JSON.stringify(
|
|
202001
|
+
createRelativeImportSpecifier(input3.modulePath, facadePath)
|
|
202002
|
+
)};
|
|
202003
|
+
`;
|
|
202004
|
+
input3 = { ...input3, source: rewritten2 };
|
|
202005
|
+
}
|
|
202006
|
+
}
|
|
201659
202007
|
const {
|
|
201660
202008
|
literalImports: importNodes,
|
|
201661
202009
|
dynamicImportExpressions: dynamicImportNodes
|
|
@@ -201891,7 +202239,7 @@ function mergePublishedArtifactDependencies(input3) {
|
|
|
201891
202239
|
(left, right) => left.kodyId.localeCompare(right.kodyId) || left.sourceId.localeCompare(right.sourceId)
|
|
201892
202240
|
);
|
|
201893
202241
|
}
|
|
201894
|
-
var bundlerScriptSourcePathPattern, bundlerConfigSourcePathPattern;
|
|
202242
|
+
var bundlerScriptSourcePathPattern, bundlerConfigSourcePathPattern, packageOwnFetchName;
|
|
201895
202243
|
var init_module_graph_import_rewriting = __esm({
|
|
201896
202244
|
"../worker/src/package-runtime/module-graph-import-rewriting.ts"() {
|
|
201897
202245
|
"use strict";
|
|
@@ -201913,6 +202261,7 @@ var init_module_graph_import_rewriting = __esm({
|
|
|
201913
202261
|
init_module_graph_workspace();
|
|
201914
202262
|
bundlerScriptSourcePathPattern = /\.(?:[cm]?[jt]sx?)$/i;
|
|
201915
202263
|
bundlerConfigSourcePathPattern = /\.(?:jsonc?|toml)$/i;
|
|
202264
|
+
packageOwnFetchName = "__kodyPackageOwnFetch";
|
|
201916
202265
|
}
|
|
201917
202266
|
});
|
|
201918
202267
|
|
|
@@ -202332,13 +202681,6 @@ function createAttachedModulesExternalsPlugin(attachedModulePaths) {
|
|
|
202332
202681
|
}
|
|
202333
202682
|
};
|
|
202334
202683
|
}
|
|
202335
|
-
function preparedGraphNeedsSourceBuild(prepared) {
|
|
202336
|
-
if (prepared.hasTypedPublishedArtifactModules) return true;
|
|
202337
|
-
for (const role of prepared.moduleRoles.values()) {
|
|
202338
|
-
if (role === "package-source" || role === "root-dependency") return true;
|
|
202339
|
-
}
|
|
202340
|
-
return false;
|
|
202341
|
-
}
|
|
202342
202684
|
function splitAttachedPublishedArtifactModules(files, moduleRoles) {
|
|
202343
202685
|
const bundlerFiles = {};
|
|
202344
202686
|
const attachedModules = {};
|
|
@@ -202426,10 +202768,7 @@ async function buildKodyModuleBundle(input3) {
|
|
|
202426
202768
|
prepareCache: input3.prepareCache,
|
|
202427
202769
|
linkKodyPackageImports: input3.linkKodyPackageImports
|
|
202428
202770
|
});
|
|
202429
|
-
|
|
202430
|
-
throw new PublishedImportsNeedSourceBuildError();
|
|
202431
|
-
}
|
|
202432
|
-
const { bundlerFiles: files, attachedModules } = input3.attachPublishedArtifacts ? splitAttachedPublishedArtifactModules(
|
|
202771
|
+
const { bundlerFiles: files, attachedModules } = input3.attachPublishedArtifacts && !prepared.hasTypedPublishedArtifactModules ? splitAttachedPublishedArtifactModules(
|
|
202433
202772
|
prepared.files,
|
|
202434
202773
|
prepared.moduleRoles
|
|
202435
202774
|
) : {
|
|
@@ -202644,7 +202983,7 @@ function createPublishedPackageAppBundleCacheKey(input3) {
|
|
|
202644
202983
|
entryPoint: input3.entryPoint
|
|
202645
202984
|
});
|
|
202646
202985
|
}
|
|
202647
|
-
var packageAppBundleCache, moduleBundleCache, kodyRuntimeExternalsPlugin, kodyLinkedPackageImportsPlugin
|
|
202986
|
+
var packageAppBundleCache, moduleBundleCache, kodyRuntimeExternalsPlugin, kodyLinkedPackageImportsPlugin;
|
|
202648
202987
|
var init_module_graph_bundle_builders = __esm({
|
|
202649
202988
|
"../worker/src/package-runtime/module-graph-bundle-builders.ts"() {
|
|
202650
202989
|
"use strict";
|
|
@@ -202679,12 +203018,6 @@ var init_module_graph_bundle_builders = __esm({
|
|
|
202679
203018
|
});
|
|
202680
203019
|
}
|
|
202681
203020
|
};
|
|
202682
|
-
PublishedImportsNeedSourceBuildError = class extends Error {
|
|
202683
|
-
constructor() {
|
|
202684
|
-
super("Bundle needs a package source build.");
|
|
202685
|
-
this.name = "PublishedImportsNeedSourceBuildError";
|
|
202686
|
-
}
|
|
202687
|
-
};
|
|
202688
203021
|
}
|
|
202689
203022
|
});
|
|
202690
203023
|
|
|
@@ -202961,7 +203294,7 @@ async function resolveCurrentDynamicPackageArtifact(input3) {
|
|
|
202961
203294
|
entryPoint,
|
|
202962
203295
|
commit: servingArtifactCommitForSource(loaded.source)
|
|
202963
203296
|
});
|
|
202964
|
-
if (loadedArtifact?.artifact && !publishedArtifactNeedsPackageBindingRebuild({
|
|
203297
|
+
if (loadedArtifact?.artifact && !await publishedArtifactNeedsPackageBindingRebuild({
|
|
202965
203298
|
artifact: loadedArtifact.artifact,
|
|
202966
203299
|
sourceFiles: loaded.files
|
|
202967
203300
|
})) {
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./chunk-E4R3Y6MM.js";
|
|
5
5
|
import {
|
|
6
6
|
openApiRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S2PL6T74.js";
|
|
8
8
|
import {
|
|
9
9
|
assertTokenSafeApiUrl
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-V7EVS6AD.js";
|
|
11
|
+
import "./chunk-F6N7JCMD.js";
|
|
12
12
|
import "./chunk-G6LJWROP.js";
|
|
13
13
|
import "./chunk-6JQXFR73.js";
|
|
14
14
|
import "./chunk-AM2SBW3C.js";
|
|
@@ -150,4 +150,4 @@ export {
|
|
|
150
150
|
resolveRemoteExecuteCode,
|
|
151
151
|
runRemoteExecuteWithToken
|
|
152
152
|
};
|
|
153
|
-
//# sourceMappingURL=remote-execute-
|
|
153
|
+
//# sourceMappingURL=remote-execute-43LS7EB7.js.map
|
|
@@ -38,7 +38,7 @@ async function runContextRun(input) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
const hostCommands = input.hostCommands;
|
|
41
|
-
const { runLocalExecute } = await import("./local-execute-
|
|
41
|
+
const { runLocalExecute } = await import("./local-execute-L3UR5FS7.js");
|
|
42
42
|
let timing;
|
|
43
43
|
const result = await runLocalExecute({
|
|
44
44
|
code: source.code,
|
|
@@ -89,4 +89,4 @@ async function runContextRun(input) {
|
|
|
89
89
|
export {
|
|
90
90
|
runContextRun
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=run-executor-
|
|
92
|
+
//# sourceMappingURL=run-executor-U6QTQV3N.js.map
|