specli 0.0.18 → 0.0.19

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 (71) hide show
  1. package/dist/cli/compile.js +137 -61
  2. package/dist/cli.d.ts +0 -1
  3. package/dist/cli.js +0 -1
  4. package/package.json +1 -2
  5. package/src/ai/tools.test.ts +0 -83
  6. package/src/ai/tools.ts +0 -211
  7. package/src/cli/auth-requirements.test.ts +0 -27
  8. package/src/cli/auth-requirements.ts +0 -91
  9. package/src/cli/auth-schemes.test.ts +0 -66
  10. package/src/cli/auth-schemes.ts +0 -187
  11. package/src/cli/capabilities.test.ts +0 -94
  12. package/src/cli/capabilities.ts +0 -88
  13. package/src/cli/command-id.test.ts +0 -32
  14. package/src/cli/command-id.ts +0 -16
  15. package/src/cli/command-index.ts +0 -19
  16. package/src/cli/command-model.test.ts +0 -44
  17. package/src/cli/command-model.ts +0 -128
  18. package/src/cli/compile.ts +0 -109
  19. package/src/cli/crypto.ts +0 -9
  20. package/src/cli/derive-name.ts +0 -101
  21. package/src/cli/exec.ts +0 -72
  22. package/src/cli/main.ts +0 -255
  23. package/src/cli/naming.test.ts +0 -86
  24. package/src/cli/naming.ts +0 -224
  25. package/src/cli/operations.test.ts +0 -57
  26. package/src/cli/operations.ts +0 -152
  27. package/src/cli/params.test.ts +0 -70
  28. package/src/cli/params.ts +0 -71
  29. package/src/cli/pluralize.ts +0 -41
  30. package/src/cli/positional.test.ts +0 -65
  31. package/src/cli/positional.ts +0 -75
  32. package/src/cli/request-body.test.ts +0 -35
  33. package/src/cli/request-body.ts +0 -94
  34. package/src/cli/runtime/argv.ts +0 -14
  35. package/src/cli/runtime/auth/resolve.ts +0 -59
  36. package/src/cli/runtime/body-flags.test.ts +0 -261
  37. package/src/cli/runtime/body-flags.ts +0 -176
  38. package/src/cli/runtime/body.ts +0 -24
  39. package/src/cli/runtime/collect.ts +0 -6
  40. package/src/cli/runtime/compat.ts +0 -89
  41. package/src/cli/runtime/context.ts +0 -62
  42. package/src/cli/runtime/execute.ts +0 -147
  43. package/src/cli/runtime/generated.ts +0 -242
  44. package/src/cli/runtime/headers.ts +0 -37
  45. package/src/cli/runtime/index.ts +0 -3
  46. package/src/cli/runtime/profile/secrets.ts +0 -83
  47. package/src/cli/runtime/profile/store.ts +0 -100
  48. package/src/cli/runtime/request.test.ts +0 -375
  49. package/src/cli/runtime/request.ts +0 -390
  50. package/src/cli/runtime/server-url.ts +0 -45
  51. package/src/cli/runtime/template.ts +0 -26
  52. package/src/cli/runtime/validate/ajv.ts +0 -13
  53. package/src/cli/runtime/validate/coerce.test.ts +0 -98
  54. package/src/cli/runtime/validate/coerce.ts +0 -71
  55. package/src/cli/runtime/validate/error.ts +0 -29
  56. package/src/cli/runtime/validate/index.ts +0 -4
  57. package/src/cli/runtime/validate/schema.ts +0 -54
  58. package/src/cli/schema-shape.ts +0 -36
  59. package/src/cli/schema.ts +0 -76
  60. package/src/cli/server.test.ts +0 -55
  61. package/src/cli/server.ts +0 -167
  62. package/src/cli/spec-id.ts +0 -12
  63. package/src/cli/spec-loader.ts +0 -58
  64. package/src/cli/stable-json.ts +0 -35
  65. package/src/cli/strings.ts +0 -21
  66. package/src/cli/types.ts +0 -59
  67. package/src/cli.ts +0 -94
  68. package/src/compiled.ts +0 -24
  69. package/src/macros/env.ts +0 -21
  70. package/src/macros/spec.ts +0 -17
  71. 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
- }