toolcraft 0.0.36 → 0.0.38
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/cli.compile-check.js +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +6 -5
- package/dist/mcp.compile-check.js +1 -0
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.js +2 -1
- package/dist/sdk.compile-check.js +1 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.js +2 -1
- package/package.json +2 -2
package/dist/cli.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface RunCLIOptions<TServices extends object = Record<string, unknown
|
|
|
15
15
|
approvals?: boolean;
|
|
16
16
|
casing?: Casing;
|
|
17
17
|
controls?: CLIControls;
|
|
18
|
+
fetch?: typeof globalThis.fetch;
|
|
18
19
|
humanInLoop?: HumanInLoopRuntimeOptions;
|
|
19
20
|
projectRoot?: string;
|
|
20
21
|
rootDisplayName?: string;
|
package/dist/cli.js
CHANGED
|
@@ -1834,12 +1834,12 @@ function createFixtureEnvValues(command) {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
return values;
|
|
1836
1836
|
}
|
|
1837
|
-
async function resolveFixtureRuntime(command, services, requirementOptions) {
|
|
1837
|
+
async function resolveFixtureRuntime(command, services, requirementOptions, runtimeFetch) {
|
|
1838
1838
|
const selector = process.env.TOOLCRAFT_FIXTURE;
|
|
1839
1839
|
if (selector === undefined || selector.length === 0) {
|
|
1840
1840
|
return {
|
|
1841
1841
|
env: createEnv(),
|
|
1842
|
-
fetch:
|
|
1842
|
+
fetch: runtimeFetch,
|
|
1843
1843
|
fs: createFs(),
|
|
1844
1844
|
isFixture: false,
|
|
1845
1845
|
requirementOptions,
|
|
@@ -2448,7 +2448,7 @@ function getResolvedFlags(command) {
|
|
|
2448
2448
|
const flags = command.optsWithGlobals();
|
|
2449
2449
|
return flags;
|
|
2450
2450
|
}
|
|
2451
|
-
async function executeCommand(state, services, requirementOptions, runtimeOptions, onErrorReportContext) {
|
|
2451
|
+
async function executeCommand(state, services, requirementOptions, runtimeFetch, runtimeOptions, onErrorReportContext) {
|
|
2452
2452
|
const logger = createLogger();
|
|
2453
2453
|
const primitives = {
|
|
2454
2454
|
logger,
|
|
@@ -2460,7 +2460,7 @@ async function executeCommand(state, services, requirementOptions, runtimeOption
|
|
|
2460
2460
|
const resolvedFlags = optionValues;
|
|
2461
2461
|
const output = resolveOutput(resolvedFlags);
|
|
2462
2462
|
const shouldPrompt = !resolvedFlags.yes && Boolean(process.stdin.isTTY);
|
|
2463
|
-
const runtime = await resolveFixtureRuntime(state.command, services, requirementOptions);
|
|
2463
|
+
const runtime = await resolveFixtureRuntime(state.command, services, requirementOptions, runtimeFetch);
|
|
2464
2464
|
const preflightContext = {
|
|
2465
2465
|
...runtime.services,
|
|
2466
2466
|
secrets: runtime.secrets,
|
|
@@ -2955,6 +2955,7 @@ export async function runCLI(roots, options = {}) {
|
|
|
2955
2955
|
const casing = options.casing ?? "kebab";
|
|
2956
2956
|
const services = (options.services ?? {});
|
|
2957
2957
|
const runtimeOptions = options.humanInLoop ?? {};
|
|
2958
|
+
const runtimeFetch = options.fetch ?? globalThis.fetch;
|
|
2958
2959
|
const version = options.version ?? findEntrypointPackageMetadata(process.argv[1])?.version;
|
|
2959
2960
|
const rootUsageName = options.rootUsageName ?? inferProgramName(process.argv);
|
|
2960
2961
|
const controls = resolveCLIControls(options.controls);
|
|
@@ -2988,7 +2989,7 @@ export async function runCLI(roots, options = {}) {
|
|
|
2988
2989
|
const execute = async (state) => {
|
|
2989
2990
|
lastActionCommand = state.actionCommand;
|
|
2990
2991
|
resolvedCommandPath = formatCliCommandPath(state.commandPath);
|
|
2991
|
-
await executeCommand(state, servicesWithBuiltIns, requirementOptions, runtimeOptions, (context) => {
|
|
2992
|
+
await executeCommand(state, servicesWithBuiltIns, requirementOptions, runtimeFetch, runtimeOptions, (context) => {
|
|
2992
2993
|
errorReportContext = context;
|
|
2993
2994
|
});
|
|
2994
2995
|
};
|
package/dist/mcp.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ type CmdkitServer = Omit<TinyServer, "connect"> & {
|
|
|
8
8
|
};
|
|
9
9
|
export interface RunMCPOptions<TServices extends object = Record<string, unknown>> {
|
|
10
10
|
approvals?: boolean;
|
|
11
|
+
fetch?: typeof globalThis.fetch;
|
|
11
12
|
name: string;
|
|
12
13
|
version?: string;
|
|
13
14
|
humanInLoop?: HumanInLoopRuntimeOptions;
|
package/dist/mcp.js
CHANGED
|
@@ -509,6 +509,7 @@ function createResolvedMCPServer(root, options) {
|
|
|
509
509
|
const casing = options.casing ?? "snake";
|
|
510
510
|
const services = (options.services ?? {});
|
|
511
511
|
const runtimeOptions = options.humanInLoop ?? {};
|
|
512
|
+
const runtimeFetch = options.fetch ?? globalThis.fetch;
|
|
512
513
|
const servicesWithBuiltIns = {
|
|
513
514
|
...services,
|
|
514
515
|
runtimeOptions,
|
|
@@ -531,7 +532,7 @@ function createResolvedMCPServer(root, options) {
|
|
|
531
532
|
const baseContext = {
|
|
532
533
|
...servicesWithBuiltIns,
|
|
533
534
|
secrets,
|
|
534
|
-
fetch:
|
|
535
|
+
fetch: runtimeFetch,
|
|
535
536
|
fs: createFs(),
|
|
536
537
|
env: createEnv(),
|
|
537
538
|
progress() {
|
package/dist/sdk.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ type SDKNodeShape<TNode, TInheritedScope extends ScopeInput, TInheritedHumanInLo
|
|
|
62
62
|
type SDKChildrenShape<TChildren, TInheritedScope extends ScopeInput, TInheritedHumanInLoopMode extends HumanInLoopMode | undefined> = Simplify<UnionToIntersection<SDKNodeShape<RawChildrenValue<TChildren>, TInheritedScope, TInheritedHumanInLoopMode>>>;
|
|
63
63
|
export interface CreateSDKOptions<TServices extends object = Record<string, unknown>> {
|
|
64
64
|
approvals?: boolean;
|
|
65
|
+
fetch?: typeof globalThis.fetch;
|
|
65
66
|
services?: TServices;
|
|
66
67
|
casing?: "camel";
|
|
67
68
|
humanInLoop?: HumanInLoopRuntimeOptions;
|
package/dist/sdk.js
CHANGED
|
@@ -323,6 +323,7 @@ export function createSDK(root, options = {}) {
|
|
|
323
323
|
function createResolvedSDK(root, options = {}) {
|
|
324
324
|
const services = options.services ?? {};
|
|
325
325
|
const runtimeOptions = options.humanInLoop ?? {};
|
|
326
|
+
const runtimeFetch = options.fetch ?? globalThis.fetch;
|
|
326
327
|
void options.casing;
|
|
327
328
|
validateServices(services);
|
|
328
329
|
function build(node, path) {
|
|
@@ -342,7 +343,7 @@ function createResolvedSDK(root, options = {}) {
|
|
|
342
343
|
runtimeOptions,
|
|
343
344
|
root,
|
|
344
345
|
secrets,
|
|
345
|
-
fetch:
|
|
346
|
+
fetch: runtimeFetch,
|
|
346
347
|
fs: createFs(),
|
|
347
348
|
env: createEnv(),
|
|
348
349
|
progress() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@clack/core": "^1.0.0",
|
|
51
51
|
"@clack/prompts": "^1.0.0",
|
|
52
|
-
"toolcraft-schema": "0.0.
|
|
52
|
+
"toolcraft-schema": "0.0.38",
|
|
53
53
|
"commander": "^14.0.3",
|
|
54
54
|
"jose": "^6.1.2",
|
|
55
55
|
"jsonc-parser": "^3.3.1",
|