specli 0.0.18 → 0.0.20

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.
Files changed (75) hide show
  1. package/README.md +3 -1
  2. package/dist/ai/tools.d.ts +6 -5
  3. package/dist/ai/tools.js +7 -20
  4. package/dist/ai/tools.test.js +7 -14
  5. package/dist/cli/compile.js +137 -61
  6. package/dist/cli.d.ts +0 -1
  7. package/dist/cli.js +0 -1
  8. package/package.json +1 -2
  9. package/src/ai/tools.test.ts +0 -83
  10. package/src/ai/tools.ts +0 -211
  11. package/src/cli/auth-requirements.test.ts +0 -27
  12. package/src/cli/auth-requirements.ts +0 -91
  13. package/src/cli/auth-schemes.test.ts +0 -66
  14. package/src/cli/auth-schemes.ts +0 -187
  15. package/src/cli/capabilities.test.ts +0 -94
  16. package/src/cli/capabilities.ts +0 -88
  17. package/src/cli/command-id.test.ts +0 -32
  18. package/src/cli/command-id.ts +0 -16
  19. package/src/cli/command-index.ts +0 -19
  20. package/src/cli/command-model.test.ts +0 -44
  21. package/src/cli/command-model.ts +0 -128
  22. package/src/cli/compile.ts +0 -109
  23. package/src/cli/crypto.ts +0 -9
  24. package/src/cli/derive-name.ts +0 -101
  25. package/src/cli/exec.ts +0 -72
  26. package/src/cli/main.ts +0 -255
  27. package/src/cli/naming.test.ts +0 -86
  28. package/src/cli/naming.ts +0 -224
  29. package/src/cli/operations.test.ts +0 -57
  30. package/src/cli/operations.ts +0 -152
  31. package/src/cli/params.test.ts +0 -70
  32. package/src/cli/params.ts +0 -71
  33. package/src/cli/pluralize.ts +0 -41
  34. package/src/cli/positional.test.ts +0 -65
  35. package/src/cli/positional.ts +0 -75
  36. package/src/cli/request-body.test.ts +0 -35
  37. package/src/cli/request-body.ts +0 -94
  38. package/src/cli/runtime/argv.ts +0 -14
  39. package/src/cli/runtime/auth/resolve.ts +0 -59
  40. package/src/cli/runtime/body-flags.test.ts +0 -261
  41. package/src/cli/runtime/body-flags.ts +0 -176
  42. package/src/cli/runtime/body.ts +0 -24
  43. package/src/cli/runtime/collect.ts +0 -6
  44. package/src/cli/runtime/compat.ts +0 -89
  45. package/src/cli/runtime/context.ts +0 -62
  46. package/src/cli/runtime/execute.ts +0 -147
  47. package/src/cli/runtime/generated.ts +0 -242
  48. package/src/cli/runtime/headers.ts +0 -37
  49. package/src/cli/runtime/index.ts +0 -3
  50. package/src/cli/runtime/profile/secrets.ts +0 -83
  51. package/src/cli/runtime/profile/store.ts +0 -100
  52. package/src/cli/runtime/request.test.ts +0 -375
  53. package/src/cli/runtime/request.ts +0 -390
  54. package/src/cli/runtime/server-url.ts +0 -45
  55. package/src/cli/runtime/template.ts +0 -26
  56. package/src/cli/runtime/validate/ajv.ts +0 -13
  57. package/src/cli/runtime/validate/coerce.test.ts +0 -98
  58. package/src/cli/runtime/validate/coerce.ts +0 -71
  59. package/src/cli/runtime/validate/error.ts +0 -29
  60. package/src/cli/runtime/validate/index.ts +0 -4
  61. package/src/cli/runtime/validate/schema.ts +0 -54
  62. package/src/cli/schema-shape.ts +0 -36
  63. package/src/cli/schema.ts +0 -76
  64. package/src/cli/server.test.ts +0 -55
  65. package/src/cli/server.ts +0 -167
  66. package/src/cli/spec-id.ts +0 -12
  67. package/src/cli/spec-loader.ts +0 -58
  68. package/src/cli/stable-json.ts +0 -35
  69. package/src/cli/strings.ts +0 -21
  70. package/src/cli/types.ts +0 -59
  71. package/src/cli.ts +0 -94
  72. package/src/compiled.ts +0 -24
  73. package/src/macros/env.ts +0 -21
  74. package/src/macros/spec.ts +0 -17
  75. package/src/macros/version.ts +0 -14
package/src/macros/env.ts DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * Bun macro: reads an environment variable at bundle-time.
3
- * Returns undefined if the env var is not set.
4
- */
5
- export function env(name: string): string | undefined {
6
- if (!name) throw new Error("env macro: missing variable name");
7
- return process.env[name];
8
- }
9
-
10
- /**
11
- * Bun macro: reads a required environment variable at bundle-time.
12
- * Throws if the env var is not set.
13
- */
14
- export function envRequired(name: string): string {
15
- if (!name) throw new Error("envRequired macro: missing variable name");
16
- const value = process.env[name];
17
- if (value === undefined) {
18
- throw new Error(`Missing required env var: ${name}`);
19
- }
20
- return value;
21
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * Bun macro: loads an OpenAPI spec from a URL or file path at bundle-time.
3
- * The spec text is inlined into the bundle.
4
- */
5
- export async function loadSpec(spec: string): Promise<string> {
6
- if (!spec) throw new Error("loadSpec macro: missing spec path/URL");
7
-
8
- if (/^https?:\/\//i.test(spec)) {
9
- const res = await fetch(spec);
10
- if (!res.ok) {
11
- throw new Error(`Failed to fetch spec: ${res.status} ${res.statusText}`);
12
- }
13
- return await res.text();
14
- }
15
-
16
- return await Bun.file(spec).text();
17
- }
@@ -1,14 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- /**
6
- * Bun macro: reads the version from package.json at bundle-time.
7
- */
8
- export function version(): string {
9
- const currentDir = dirname(fileURLToPath(import.meta.url));
10
- const packageJsonPath = join(currentDir, "../../package.json");
11
- const content = readFileSync(packageJsonPath, "utf-8");
12
- const packageJson = JSON.parse(content);
13
- return packageJson.version;
14
- }