@makine/cli 0.1.4

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 (50) hide show
  1. package/LICENSE +34 -0
  2. package/dist/index.d.ts +63 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +380 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/main.d.ts +3 -0
  7. package/dist/main.d.ts.map +1 -0
  8. package/dist/main.js +31 -0
  9. package/dist/main.js.map +1 -0
  10. package/dist/migrate/command.d.ts +39 -0
  11. package/dist/migrate/command.d.ts.map +1 -0
  12. package/dist/migrate/command.js +257 -0
  13. package/dist/migrate/command.js.map +1 -0
  14. package/dist/migrate/credentials.d.ts +29 -0
  15. package/dist/migrate/credentials.d.ts.map +1 -0
  16. package/dist/migrate/credentials.js +56 -0
  17. package/dist/migrate/credentials.js.map +1 -0
  18. package/dist/migrate/litellm.d.ts +13 -0
  19. package/dist/migrate/litellm.d.ts.map +1 -0
  20. package/dist/migrate/litellm.js +454 -0
  21. package/dist/migrate/litellm.js.map +1 -0
  22. package/dist/migrate/nodes.d.ts +7 -0
  23. package/dist/migrate/nodes.d.ts.map +1 -0
  24. package/dist/migrate/nodes.js +17 -0
  25. package/dist/migrate/nodes.js.map +1 -0
  26. package/dist/migrate/paths.d.ts +17 -0
  27. package/dist/migrate/paths.d.ts.map +1 -0
  28. package/dist/migrate/paths.js +94 -0
  29. package/dist/migrate/paths.js.map +1 -0
  30. package/dist/migrate/portkey.d.ts +22 -0
  31. package/dist/migrate/portkey.d.ts.map +1 -0
  32. package/dist/migrate/portkey.js +371 -0
  33. package/dist/migrate/portkey.js.map +1 -0
  34. package/dist/migrate/render.d.ts +22 -0
  35. package/dist/migrate/render.d.ts.map +1 -0
  36. package/dist/migrate/render.js +124 -0
  37. package/dist/migrate/render.js.map +1 -0
  38. package/dist/migrate/runtime-rules.d.ts +55 -0
  39. package/dist/migrate/runtime-rules.d.ts.map +1 -0
  40. package/dist/migrate/runtime-rules.js +203 -0
  41. package/dist/migrate/runtime-rules.js.map +1 -0
  42. package/dist/migrate/translate.d.ts +96 -0
  43. package/dist/migrate/translate.d.ts.map +1 -0
  44. package/dist/migrate/translate.js +305 -0
  45. package/dist/migrate/translate.js.map +1 -0
  46. package/dist/migrate/types.d.ts +63 -0
  47. package/dist/migrate/types.d.ts.map +1 -0
  48. package/dist/migrate/types.js +9 -0
  49. package/dist/migrate/types.js.map +1 -0
  50. package/package.json +40 -0
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The shape of what `makine migrate` produces.
3
+ *
4
+ * This is CLI output, not a registered Makine contract: no schema file, no event, no durable state.
5
+ * `--json` prints exactly these fields so a script can consume them; the default rendering is an
6
+ * env-file fragment built from the same data.
7
+ */
8
+ /**
9
+ * How the API process is started, which decides which variables can reach it at all.
10
+ *
11
+ * `onprem` is `docker compose --env-file makine.env -f docker-compose.onprem.yml up`, where the API
12
+ * container receives only the names the compose file's `api.environment` block lists. `direct` is
13
+ * the API process started with the file's variables already in its environment.
14
+ */
15
+ export type MigrationShape = "onprem" | "direct";
16
+ export type MigrationSource = "litellm" | "portkey";
17
+ /**
18
+ * A location in the parsed input, as segments rather than a joined string.
19
+ *
20
+ * Joining would make a key that contains `.` — the LiteLLM fixture's `"gpt-4.1"` model-group alias —
21
+ * indistinguishable from a two-level path, and the reconciliation check would then believe a leaf
22
+ * was covered when it was not.
23
+ */
24
+ export type PathSegment = string | number;
25
+ export type InputPath = readonly PathSegment[];
26
+ /**
27
+ * Why an input construct did not become a setting.
28
+ *
29
+ * - `unsupported_provider` — the upstream provider has no Makine chat slot at all.
30
+ * - `not_expressible` — Makine has no setting with this meaning, or the nearest one means something
31
+ * materially different.
32
+ * - `shape_limit` — expressible in Makine, but not reachable in the deployment shape asked for.
33
+ * - `egress_refused` — the endpoint would boot and then fail every request at the egress guard.
34
+ * - `credential_withheld` — a secret was present; no credential field is copied.
35
+ * - `rewritten` — translated, but not to the literal input value; the change is named.
36
+ * - `invalid_value` — the value cannot be carried through an env file or past Makine's validation.
37
+ * - `unknown_key` — the tool does not know this key and did not examine it.
38
+ */
39
+ export type ReportCategory = "unsupported_provider" | "not_expressible" | "shape_limit" | "egress_refused" | "credential_withheld" | "rewritten" | "invalid_value" | "unknown_key";
40
+ export interface ReportEntry {
41
+ path: InputPath;
42
+ category: ReportCategory;
43
+ reason: string;
44
+ }
45
+ /** Which input field became which Makine variable. Paths only — never values. */
46
+ export interface MappingEntry {
47
+ path: InputPath;
48
+ variable: string;
49
+ }
50
+ export interface EnvLine {
51
+ name: string;
52
+ value: string;
53
+ }
54
+ export interface TranslationResult {
55
+ source: MigrationSource;
56
+ shape: MigrationShape;
57
+ env: readonly EnvLine[];
58
+ mapping: readonly MappingEntry[];
59
+ /** Exact leaf paths of the input whose value reached the output. */
60
+ consumed: readonly InputPath[];
61
+ report: readonly ReportEntry[];
62
+ }
63
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/migrate/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAC1C,MAAM,MAAM,SAAS,GAAG,SAAS,WAAW,EAAE,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GACtB,sBAAsB,GACtB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,qBAAqB,GACrB,WAAW,GACX,eAAe,GACf,aAAa,CAAC;AAElB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;IACtB,GAAG,EAAE,SAAS,OAAO,EAAE,CAAC;IACxB,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,oEAAoE;IACpE,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IAC/B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CAChC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The shape of what `makine migrate` produces.
3
+ *
4
+ * This is CLI output, not a registered Makine contract: no schema file, no event, no durable state.
5
+ * `--json` prints exactly these fields so a script can consume them; the default rendering is an
6
+ * env-file fragment built from the same data.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/migrate/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@makine/cli",
3
+ "version": "0.1.4",
4
+ "description": "The makine command line: send a prompt to a Makine Gateway, list its models, and translate a Portkey or LiteLLM config into makine.env settings.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "bin": {
10
+ "makine": "./dist/main.js"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "dependencies": {
25
+ "@makine/sdk": "0.1.4",
26
+ "yaml": "2.9.0"
27
+ },
28
+ "devDependencies": {
29
+ "@makine/executors": "0.0.0",
30
+ "@makine/policy-core": "0.0.0",
31
+ "@makine/providers": "0.0.0",
32
+ "@types/node": "24.13.3",
33
+ "vitest": "4.1.11"
34
+ },
35
+ "scripts": {
36
+ "build": "tsc -b tsconfig.json",
37
+ "test": "vitest run",
38
+ "typecheck": "tsc -b tsconfig.json --pretty false"
39
+ }
40
+ }