toolcraft 0.0.37 → 0.0.39

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.
@@ -15,6 +15,7 @@ const ignoredRoot = defineGroup({
15
15
  const ignoredOptions = {
16
16
  approvals: true,
17
17
  casing: "kebab",
18
+ fetch: globalThis.fetch,
18
19
  controls: {
19
20
  debug: true,
20
21
  output: true,
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: globalThis.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
  };
@@ -18,6 +18,7 @@ const ignoredOptions = {
18
18
  approvals: false,
19
19
  name: "toolcraft-test",
20
20
  version: "1.0.0",
21
+ fetch: globalThis.fetch,
21
22
  tools: ["usage"],
22
23
  casing: "snake",
23
24
  humanInLoop: {},
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: globalThis.fetch,
535
+ fetch: runtimeFetch,
535
536
  fs: createFs(),
536
537
  env: createEnv(),
537
538
  progress() {
@@ -91,6 +91,7 @@ const ignoredRoot = defineGroup({
91
91
  const ignoredOptions = {
92
92
  approvals: false,
93
93
  casing: "camel",
94
+ fetch: globalThis.fetch,
94
95
  services: {
95
96
  logger: console,
96
97
  },
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: globalThis.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.37",
3
+ "version": "0.0.39",
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.37",
52
+ "toolcraft-schema": "0.0.39",
53
53
  "commander": "^14.0.3",
54
54
  "jose": "^6.1.2",
55
55
  "jsonc-parser": "^3.3.1",