@makine/cli 0.1.5 → 0.2.0

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 (59) hide show
  1. package/dist/baseline/command.d.ts +30 -0
  2. package/dist/baseline/command.d.ts.map +1 -0
  3. package/dist/baseline/command.js +185 -0
  4. package/dist/baseline/command.js.map +1 -0
  5. package/dist/contracts/command.d.ts +29 -0
  6. package/dist/contracts/command.d.ts.map +1 -0
  7. package/dist/contracts/command.js +327 -0
  8. package/dist/contracts/command.js.map +1 -0
  9. package/dist/index.d.ts +15 -7
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +207 -49
  12. package/dist/index.js.map +1 -1
  13. package/dist/login/command.d.ts +20 -0
  14. package/dist/login/command.d.ts.map +1 -0
  15. package/dist/login/command.js +119 -0
  16. package/dist/login/command.js.map +1 -0
  17. package/dist/main.js +4 -7
  18. package/dist/main.js.map +1 -1
  19. package/dist/migrate/command.d.ts +4 -12
  20. package/dist/migrate/command.d.ts.map +1 -1
  21. package/dist/migrate/command.js +28 -83
  22. package/dist/migrate/command.js.map +1 -1
  23. package/dist/migrate/credentials.d.ts +5 -14
  24. package/dist/migrate/credentials.d.ts.map +1 -1
  25. package/dist/migrate/credentials.js +5 -14
  26. package/dist/migrate/credentials.js.map +1 -1
  27. package/dist/migrate/litellm.d.ts +3 -8
  28. package/dist/migrate/litellm.d.ts.map +1 -1
  29. package/dist/migrate/litellm.js +11 -21
  30. package/dist/migrate/litellm.js.map +1 -1
  31. package/dist/migrate/paths.d.ts +2 -7
  32. package/dist/migrate/paths.d.ts.map +1 -1
  33. package/dist/migrate/paths.js +11 -37
  34. package/dist/migrate/paths.js.map +1 -1
  35. package/dist/migrate/portkey.d.ts +6 -16
  36. package/dist/migrate/portkey.d.ts.map +1 -1
  37. package/dist/migrate/portkey.js +19 -40
  38. package/dist/migrate/portkey.js.map +1 -1
  39. package/dist/migrate/render.d.ts +5 -13
  40. package/dist/migrate/render.d.ts.map +1 -1
  41. package/dist/migrate/render.js +6 -16
  42. package/dist/migrate/render.js.map +1 -1
  43. package/dist/migrate/runtime-rules.d.ts +14 -28
  44. package/dist/migrate/runtime-rules.d.ts.map +1 -1
  45. package/dist/migrate/runtime-rules.js +27 -54
  46. package/dist/migrate/runtime-rules.js.map +1 -1
  47. package/dist/migrate/translate.d.ts +14 -30
  48. package/dist/migrate/translate.d.ts.map +1 -1
  49. package/dist/migrate/translate.js +24 -52
  50. package/dist/migrate/translate.js.map +1 -1
  51. package/dist/migrate/types.d.ts +4 -10
  52. package/dist/migrate/types.d.ts.map +1 -1
  53. package/dist/migrate/types.js +2 -5
  54. package/dist/migrate/types.js.map +1 -1
  55. package/dist/session-store.d.ts +29 -0
  56. package/dist/session-store.d.ts.map +1 -0
  57. package/dist/session-store.js +78 -0
  58. package/dist/session-store.js.map +1 -0
  59. package/package.json +6 -2
@@ -1,52 +1,36 @@
1
1
  /**
2
- * Makine's own admission rules, restated here because `@makine/cli` is a client.
3
- *
4
- * `@makine/cli` ships depending on `@makine/sdk` and `yaml` (`package.json`), so the runtime
5
- * predicates cannot be imported here — importing them would ship the runtime with the CLI.
6
- * `packages/cli/test/runtime-parity.test.ts` closes the gap instead: it takes
7
- * `@makine/executors` and `@makine/providers` as DEV dependencies — absent from the published
8
- * package — and drives the real functions alongside every rule restated below. A restated rule that
9
- * drifts from its source fails that test.
10
- *
11
- * Sources:
12
- * - host rule `packages/providers/src/capability-registry.ts:152-189` (isPrivateEndpointUrl)
13
- * - cloud chat egress `packages/providers/src/chat.ts:40-46`, `:279-290` (assertChatEgressPermitted)
14
- * - endpoint validation `packages/executors/src/configuration.ts:312-329` (validateModelEndpoint)
15
- * - alias rule `packages/executors/src/configuration.ts:233-234`, `:275-286`
16
- * - alias uniqueness `packages/policy-core/src/model-alias.ts:36-38`, `:62`
2
+ * Makine's admission rules, restated because `@makine/cli` ships depending only on `@makine/sdk`
3
+ * and `yaml`; importing the runtime predicates would ship the runtime with it.
4
+ * `test/runtime-parity.test.ts` drives the real functions (dev dependencies) against every rule
5
+ * here, so a restated rule that drifts fails that test. `validateModelEndpoint` in
6
+ * `packages/executors/src/configuration.ts` is the source of the endpoint checks.
17
7
  */
18
- /** `packages/executors/src/configuration.ts:233`. */
8
+ /** `MODEL_ALIAS_PATTERN` in `packages/executors/src/configuration.ts`. */
19
9
  const MODEL_ALIAS_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:\/-]{0,127}$/;
20
- /** `packages/executors/src/configuration.ts:234`. */
10
+ /** `MAX_MODEL_ALIASES_PER_DEFINITION` in `packages/executors/src/configuration.ts`. */
21
11
  export const MAX_MODEL_ALIASES_PER_SLOT = 20;
22
- /** `packages/executors/src/configuration.ts:248`, the model-id length the runtime accepts. */
12
+ /** The model-id length `packages/executors/src/configuration.ts` accepts. */
23
13
  export const MAX_MODEL_LENGTH = 256;
24
14
  export function isValidModelAlias(alias) {
25
15
  return MODEL_ALIAS_PATTERN.test(alias);
26
16
  }
27
- /** `packages/policy-core/src/model-alias.ts:36-38`. Two slots claiming one normalized alias boot
28
- * fine and then fail every request for it as `ambiguous_alias`. */
17
+ /** `packages/policy-core/src/model-alias.ts`. Two slots claiming one normalized alias boot fine
18
+ * and then fail every request for it as `ambiguous_alias`. */
29
19
  export function normalizeModelAlias(alias) {
30
20
  return alias.trim().toLowerCase();
31
21
  }
32
22
  /**
33
- * The characters an emitted value may contain.
34
- *
35
- * Narrower than anything Makine enforces, and deliberately so: the output is read by Compose
36
- * through `--env-file`, where `$` starts an interpolation and `#` can start a comment. A value that
37
- * cannot contain either cannot be silently rewritten between this tool and the running container.
38
- * Whitespace and quotes are out for the same reason.
23
+ * Narrower than anything Makine enforces: Compose reads the output through `--env-file`, where `$`
24
+ * interpolates and `#` can start a comment, so those, whitespace and quotes are excluded.
39
25
  */
40
26
  const EMITTABLE_VALUE = /^[A-Za-z0-9._:\/@+,-]*$/;
41
27
  export function isEmittableValue(value) {
42
28
  return EMITTABLE_VALUE.test(value);
43
29
  }
44
30
  /**
45
- * `packages/providers/src/capability-registry.ts:152-178`, restated.
46
- *
47
- * Does not resolve names, for the same reason the original does not: `*.local` and
48
- * `host.docker.internal` are trusted for what they mean, not for where they point. `169.254/16` is
49
- * NOT private here — it is the cloud instance-metadata range.
31
+ * Restates `isPrivateEndpointUrl` in `packages/providers/src/capability-registry.ts`. Names are
32
+ * not resolved: `*.local` and `host.docker.internal` are trusted for what they mean. `169.254/16`
33
+ * is not private here; it is the cloud instance-metadata range.
50
34
  */
51
35
  export function isPrivateEndpointUrl(url) {
52
36
  const hostname = url.hostname.toLowerCase().replace(/^\[(.*)\]$/, "$1");
@@ -85,13 +69,11 @@ function parseIpv4Address(hostname) {
85
69
  return undefined;
86
70
  return [first, second];
87
71
  }
88
- /** `packages/providers/src/chat.ts:40-46`. The two hosts the 2026-08-23 egress sign-off names. */
72
+ /** `SIGNED_CHAT_EGRESS_HOSTS` in `packages/providers/src/chat.ts`: the signed-off cloud hosts. */
89
73
  export const SIGNED_CHAT_EGRESS_HOSTS = ["api.openai.com", "api.anthropic.com"];
90
74
  /**
91
75
  * Turns an upstream endpoint into a `MAKINE_LOCAL_PROVIDER_BASE_URL`, or says why it cannot.
92
- *
93
- * Checks run in the task's category precedence: `egress_refused` before `invalid_value`, because a
94
- * host the guard will not admit is the more fundamental fact about the endpoint.
76
+ * `egress_refused` is checked before `invalid_value`: an inadmissible host is the more basic fact.
95
77
  */
96
78
  export function toLocalProviderBaseUrl(raw, shape) {
97
79
  let url;
@@ -107,12 +89,9 @@ export function toLocalProviderBaseUrl(raw, shape) {
107
89
  "e.g. http://host.docker.internal:11434.",
108
90
  };
109
91
  }
110
- // No part of a refused URL is quoted, the host included. A quick-tunnel address such as
111
- // `https://<token>.trycloudflare.com` carries its credential in the HOSTNAME — the token is the
112
- // only thing guarding the server behind it — and
113
- // `system-governance/security-compliance/secrets-policy.md:84-85` says treat an ambiguous value
114
- // as a secret. A refusal reason is printed in the report, in `--json`, and in whatever file the
115
- // user redirects the output into, and the report entry already names which field it is about.
92
+ // A refusal quotes no part of the URL, host included: a quick-tunnel hostname
93
+ // (`<token>.trycloudflare.com`) is itself a credential, and `secrets-policy.md` treats ambiguous
94
+ // values as secrets. The report entry's path already names the field.
116
95
  if (!isPrivateEndpointUrl(url)) {
117
96
  return {
118
97
  ok: false,
@@ -132,7 +111,7 @@ export function toLocalProviderBaseUrl(raw, shape) {
132
111
  category: "invalid_value",
133
112
  reason: "The URL carries a username or password. Makine refuses that at boot, because it would " +
134
113
  "store a credential inside a configuration row where no log redaction reaches it " +
135
- "(packages/executors/src/configuration.ts:319-322). Move the credential to " +
114
+ "(packages/executors/src/configuration.ts:300-303). Move the credential to " +
136
115
  "MAKINE_LOCAL_PROVIDER_API_KEY and give a bare URL.",
137
116
  };
138
117
  }
@@ -141,7 +120,7 @@ export function toLocalProviderBaseUrl(raw, shape) {
141
120
  ok: false,
142
121
  category: "invalid_value",
143
122
  reason: "The URL carries a query string or a fragment. Makine refuses both at boot " +
144
- "(packages/executors/src/configuration.ts:323-324).",
123
+ "(packages/executors/src/configuration.ts:304-305).",
145
124
  };
146
125
  }
147
126
  if (url.protocol !== "http:" && url.protocol !== "https:") {
@@ -151,10 +130,8 @@ export function toLocalProviderBaseUrl(raw, shape) {
151
130
  reason: `Makine's local chat slot speaks HTTP or HTTPS; "${url.protocol}" is neither.`,
152
131
  };
153
132
  }
154
- // The runtime appends `/v1` to this variable and the adapter then appends `/chat/completions`
155
- // (`apps/api/src/index.ts:426`; `docs/operations/onprem-deployment.md:168`). An upstream config
156
- // naming either suffix reaches the same endpoint once both are stripped, so both come off, in
157
- // that order and case-insensitively — `/V1` is the same route to every HTTP server.
133
+ // The runtime appends `/v1` and the adapter `/chat/completions`, so an upstream URL ending in
134
+ // either has it stripped, case-insensitively (see `docs/operations/onprem-deployment.md`).
158
135
  const path = url.pathname
159
136
  .replace(/\/+$/, "")
160
137
  .replace(/\/chat\/completions$/i, "")
@@ -169,7 +146,7 @@ export function toLocalProviderBaseUrl(raw, shape) {
169
146
  `Rewritten from ${url.host} to ${host}. On the on-prem shape the API runs inside a ` +
170
147
  `container, where a loopback address is the container itself, not the machine running the ` +
171
148
  `model server. The compose file maps host.docker.internal to the host for exactly this ` +
172
- `(docker-compose.onprem.yml:33-34), and the egress guard admits that name.`;
149
+ `(docker-compose.onprem.yml:32-33), and the egress guard admits that name.`;
173
150
  }
174
151
  const value = `${url.protocol}//${host}${path}`;
175
152
  if (!isEmittableValue(value)) {
@@ -186,12 +163,8 @@ export function toLocalProviderBaseUrl(raw, shape) {
186
163
  : { ok: true, value, rewritten, rewriteReason };
187
164
  }
188
165
  /**
189
- * Loopback as seen from inside the API container.
190
- *
191
- * The task names `localhost`, `127.0.0.1` and `::1`. This covers the whole loopback family —
192
- * `0.0.0.0` and all of `127/8` — because the failure is identical for each: inside the container
193
- * the address resolves to the container, and the model server is not there. The wider set is
194
- * declared in the completion note.
166
+ * Loopback as seen from inside the API container, `0.0.0.0` and all of `127/8` included: each
167
+ * resolves to the container itself, not to the host running the model server.
195
168
  */
196
169
  function isContainerLoopback(url) {
197
170
  const hostname = url.hostname.toLowerCase().replace(/^\[(.*)\]$/, "$1");
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-rules.js","sourceRoot":"","sources":["../../src/migrate/runtime-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,qDAAqD;AACrD,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AAEpE,qDAAqD;AACrD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;mEACmE;AACnE,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,KAAK,CA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;IACxE,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC1F,MAAM,IAAI,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;AAC/C,CAAC"}
@@ -1,23 +1,15 @@
1
1
  /**
2
- * The translator's core: a pure function from a parsed config to data.
3
- *
4
- * Nothing here reads a file, touches the network, or prints. `render.ts` turns the result into an
5
- * env-file fragment or JSON; `command.ts` is the only part that does I/O.
6
- *
7
- * The invariant the whole design serves: **every leaf of the input is either consumed or reported**.
8
- * A construct that is silently dropped produces settings that look migrated and behave differently,
9
- * which is worse than refusing to translate it.
2
+ * The translator core: a pure function from a parsed config to data (`render.ts` formats,
3
+ * `command.ts` does the I/O). Invariant: every leaf of the input is either consumed or reported;
4
+ * a silently dropped construct yields settings that look migrated and behave differently.
10
5
  */
11
6
  import { type CredentialSource } from "./credentials.js";
12
7
  import type { InputPath, MigrationShape, MigrationSource, ReportCategory, TranslationResult } from "./types.js";
13
8
  export type SlotName = "openai" | "anthropic" | "local";
14
9
  /**
15
- * The closed list of variables each shape may emit, in emission order.
16
- *
17
- * `onprem` is short because the compose file's `api.environment` block is the whole channel into
18
- * the API container (`docker-compose.onprem.yml:11-27`): there is no `env_file:`, and `--env-file`
19
- * only feeds Compose's own interpolation. A name the block does not list never reaches the process,
20
- * however carefully it is written into `makine.env`.
10
+ * The closed list of variables each shape may emit, in emission order. `onprem` is short because
11
+ * the `api.environment` block of `docker-compose.onprem.yml` is the only channel into the API
12
+ * container; `--env-file` feeds only Compose's own interpolation.
21
13
  */
22
14
  export declare const SHAPE_VARIABLES: Readonly<Record<MigrationShape, readonly string[]>>;
23
15
  export interface SlotCandidate {
@@ -50,11 +42,8 @@ export type ClaimResult = {
50
42
  reason: string;
51
43
  };
52
44
  /**
53
- * Accumulates the four output lists and owns the rules that decide whether a deployment can become
54
- * a slot at all.
55
- *
56
- * Both source parsers drive this; neither decides shape limits, slot occupancy or alias uniqueness
57
- * for itself, so the two cannot drift.
45
+ * Accumulates the output lists and owns the slot rules (shape limits, occupancy, alias uniqueness),
46
+ * so the two source parsers cannot drift.
58
47
  */
59
48
  export declare class TranslationBuilder {
60
49
  readonly shape: MigrationShape;
@@ -70,21 +59,16 @@ export declare class TranslationBuilder {
70
59
  map(path: InputPath, variable: string): void;
71
60
  isSlotTaken(slot: SlotName): boolean;
72
61
  /**
73
- * Try to turn one upstream deployment into one Makine slot.
74
- *
75
- * On success this records every consumption and every report the slot implies, so a caller
76
- * cannot accept a deployment and then forget to withhold its key. On failure nothing is recorded
77
- * and the caller reports the whole deployment: a partly emitted slot is never produced.
62
+ * Turns one upstream deployment into one Makine slot. On success it records every consumption and
63
+ * report the slot implies, the credential withholding included; on failure it records nothing and
64
+ * the caller reports the whole deployment, so no slot is partly emitted.
78
65
  */
79
66
  claimSlot(candidate: SlotCandidate): ClaimResult;
80
67
  build(source: MigrationSource): TranslationResult;
81
68
  /**
82
- * Builds the lines, in the closed list's order.
83
- *
84
- * A slot's credential line is always emitted, blank. For OpenAI and Anthropic that is a blank the
85
- * user must fill: the runtime registers those slots only when the key is non-empty
86
- * (`apps/api/src/index.ts:382`, `:398`). For the local slot blank is the finished answer — a
87
- * local model server needs no key, and blank reads as absent (`apps/api/src/index.ts:439-442`).
69
+ * Lines in the closed list's order. A slot's credential line is always emitted blank: the runtime
70
+ * registers OpenAI and Anthropic only with a non-empty key, so the user fills it; for the local
71
+ * slot blank is final, since a local server needs no key and blank reads as absent.
88
72
  */
89
73
  private emit;
90
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/migrate/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAY7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I,EAAE,QAAQ,GAAG,OAAO;IAIpC;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,aAAa,GAAG,WAAW;IA4JhD,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;IAWjD;;;;OAIG;IACH,OAAO,CAAC,IAAI;CAuBb;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAQtF"}
@@ -1,12 +1,7 @@
1
1
  /**
2
- * The translator's core: a pure function from a parsed config to data.
3
- *
4
- * Nothing here reads a file, touches the network, or prints. `render.ts` turns the result into an
5
- * env-file fragment or JSON; `command.ts` is the only part that does I/O.
6
- *
7
- * The invariant the whole design serves: **every leaf of the input is either consumed or reported**.
8
- * A construct that is silently dropped produces settings that look migrated and behave differently,
9
- * which is worse than refusing to translate it.
2
+ * The translator core: a pure function from a parsed config to data (`render.ts` formats,
3
+ * `command.ts` does the I/O). Invariant: every leaf of the input is either consumed or reported;
4
+ * a silently dropped construct yields settings that look migrated and behave differently.
10
5
  */
11
6
  import { describeCredential } from "./credentials.js";
12
7
  import { translateLiteLlm } from "./litellm.js";
@@ -32,12 +27,9 @@ const SLOT_VARIABLES = {
32
27
  },
33
28
  };
34
29
  /**
35
- * The closed list of variables each shape may emit, in emission order.
36
- *
37
- * `onprem` is short because the compose file's `api.environment` block is the whole channel into
38
- * the API container (`docker-compose.onprem.yml:11-27`): there is no `env_file:`, and `--env-file`
39
- * only feeds Compose's own interpolation. A name the block does not list never reaches the process,
40
- * however carefully it is written into `makine.env`.
30
+ * The closed list of variables each shape may emit, in emission order. `onprem` is short because
31
+ * the `api.environment` block of `docker-compose.onprem.yml` is the only channel into the API
32
+ * container; `--env-file` feeds only Compose's own interpolation.
41
33
  */
42
34
  export const SHAPE_VARIABLES = {
43
35
  onprem: [
@@ -58,26 +50,15 @@ export const SHAPE_VARIABLES = {
58
50
  "MAKINE_LOCAL_CHAT_ALIASES",
59
51
  ],
60
52
  };
61
- /**
62
- * The local slot is not a chat-only setting, and nothing in the upstream config says so.
63
- *
64
- * `MAKINE_LOCAL_PROVIDER_BASE_URL` and `MAKINE_LOCAL_PROVIDER_MODEL` are read a second time by the
65
- * document-extraction adapter (`apps/api/src/index.ts:273-295`) and a third time by the readiness
66
- * probe (`:511-516`). Translating one upstream chat deployment therefore also moves extraction and
67
- * the probe, which is a change to a part of the deployment the user was not migrating.
68
- */
69
53
  const LOCAL_SLOT_SIDE_EFFECT_REASON = "Translated as written, but this setting does more than chat. MAKINE_LOCAL_PROVIDER_BASE_URL " +
70
54
  "and MAKINE_LOCAL_PROVIDER_MODEL are also read by Makine's document-extraction adapter " +
71
- "(apps/api/src/index.ts:273-295) and by the readiness probe (apps/api/src/index.ts:511-516). " +
55
+ "(apps/api/src/index.ts:273-295) and by the readiness probe (apps/api/src/index.ts:487-492). " +
72
56
  "Emitting them moves document extraction and the readiness probe to this endpoint and this " +
73
57
  "model as well, whatever they used before. If extraction was pointed at a different model, " +
74
58
  "re-point it after migrating.";
75
59
  /**
76
- * Accumulates the four output lists and owns the rules that decide whether a deployment can become
77
- * a slot at all.
78
- *
79
- * Both source parsers drive this; neither decides shape limits, slot occupancy or alias uniqueness
80
- * for itself, so the two cannot drift.
60
+ * Accumulates the output lists and owns the slot rules (shape limits, occupancy, alias uniqueness),
61
+ * so the two source parsers cannot drift.
81
62
  */
82
63
  export class TranslationBuilder {
83
64
  shape;
@@ -105,11 +86,9 @@ export class TranslationBuilder {
105
86
  return this.slots.has(slot);
106
87
  }
107
88
  /**
108
- * Try to turn one upstream deployment into one Makine slot.
109
- *
110
- * On success this records every consumption and every report the slot implies, so a caller
111
- * cannot accept a deployment and then forget to withhold its key. On failure nothing is recorded
112
- * and the caller reports the whole deployment: a partly emitted slot is never produced.
89
+ * Turns one upstream deployment into one Makine slot. On success it records every consumption and
90
+ * report the slot implies, the credential withholding included; on failure it records nothing and
91
+ * the caller reports the whole deployment, so no slot is partly emitted.
113
92
  */
114
93
  claimSlot(candidate) {
115
94
  const variables = SLOT_VARIABLES[candidate.slot];
@@ -159,13 +138,12 @@ export class TranslationBuilder {
159
138
  category: "invalid_value",
160
139
  reason: `Makine accepts a model id of at most ${String(MAX_MODEL_LENGTH)} characters and this ` +
161
140
  `one is ${String(candidate.model.value.length)} ` +
162
- `(packages/executors/src/configuration.ts:248). Emitting it would produce a deployment ` +
141
+ `(packages/executors/src/configuration.ts:235). Emitting it would produce a deployment ` +
163
142
  `that fails to boot, so nothing was emitted for this deployment.`,
164
143
  };
165
144
  }
166
- // On `onprem` the alias variable is not in the closed list, so an alias is never emitted and
167
- // its validity cannot sink the deployment. `reportAliasShapeLimit` below tells the user what
168
- // their application must send instead.
145
+ // On `onprem` the alias is never emitted, so its validity cannot sink the deployment; the
146
+ // `shape_limit` note below says what the application must send instead.
169
147
  if (this.shape === "direct") {
170
148
  if (!isValidModelAlias(candidate.alias.value) || !isEmittableValue(candidate.alias.value)) {
171
149
  return {
@@ -173,7 +151,7 @@ export class TranslationBuilder {
173
151
  category: "invalid_value",
174
152
  reason: `Makine rejects "${candidate.alias.value}" as a model alias at boot: an alias must ` +
175
153
  `start with a letter or digit, use only letters, digits and . _ : / -, and be at most ` +
176
- `128 characters (packages/executors/src/configuration.ts:233). Rename it upstream, or ` +
154
+ `128 characters (packages/executors/src/configuration.ts:220). Rename it upstream, or ` +
177
155
  `choose a different name for the Makine alias.`,
178
156
  };
179
157
  }
@@ -186,7 +164,7 @@ export class TranslationBuilder {
186
164
  reason: `The alias "${candidate.alias.value}" is already claimed by the ${owner} slot. Makine ` +
187
165
  `compares aliases trimmed and lower-cased, and two slots claiming one alias boot ` +
188
166
  `normally and then fail every request for it as "ambiguous_alias" ` +
189
- `(packages/policy-core/src/model-alias.ts:62). Give one of them a different name.`,
167
+ `(packages/policy-core/src/model-alias.ts:49). Give one of them a different name.`,
190
168
  };
191
169
  }
192
170
  }
@@ -196,7 +174,7 @@ export class TranslationBuilder {
196
174
  ok: false,
197
175
  category: "shape_limit",
198
176
  reason: `Makine registers one model per slot, and the ${candidate.slot} slot already holds ` +
199
- `"${taken?.model ?? ""}" (apps/api/src/index.ts:381-446). A second model here is not ` +
177
+ `"${taken?.model ?? ""}" (apps/api/src/index.ts:366-422). A second model here is not ` +
200
178
  `expressible: it was NOT added as an extra alias of the first model, which would route ` +
201
179
  `requests for this deployment to a different model without saying so. Run a second ` +
202
180
  `Makine deployment if you need both.`,
@@ -221,8 +199,7 @@ export class TranslationBuilder {
221
199
  }
222
200
  }
223
201
  if (this.shape === "direct") {
224
- // Portkey pins one string that becomes both the model and the alias. Consuming that leaf
225
- // twice would be harmless for reconciliation but would read as two separate fields.
202
+ // Portkey's pinned model is also the alias; consuming it twice would read as two fields.
226
203
  if (pathsEqual(candidate.alias.path, candidate.model.path)) {
227
204
  this.map(candidate.alias.path, variables.aliases);
228
205
  }
@@ -234,7 +211,7 @@ export class TranslationBuilder {
234
211
  this.note(candidate.alias.path, "shape_limit", `The application will have to send "local-chat" as its model, not ` +
235
212
  `"${candidate.alias.value}". The on-prem compose file does not pass ` +
236
213
  `MAKINE_LOCAL_CHAT_ALIASES into the API container, so the alias falls back to ` +
237
- `"local-chat" (apps/api/src/index.ts:443). Change the model name in your application, ` +
214
+ `"local-chat" (apps/api/src/index.ts:419). Change the model name in your application, ` +
238
215
  `or run with --shape direct where the alias can be set.`);
239
216
  }
240
217
  if (candidate.credential !== undefined) {
@@ -242,9 +219,7 @@ export class TranslationBuilder {
242
219
  this.note(candidate.credential.path, "credential_withheld", describeCredential(candidate.credential.source, variables.credential));
243
220
  }
244
221
  if (this.slots.size > MAX_MODEL_ALIASES_PER_SLOT) {
245
- // Unreachable by construction — there are three slots and one alias each — but the cap is
246
- // Makine's (`packages/executors/src/configuration.ts:234`) and stating it keeps the restated
247
- // rule complete rather than partially copied.
222
+ // Unreachable with three single-alias slots; restates the runtime's alias cap.
248
223
  throw new Error("Model executor must declare 1..20 model aliases.");
249
224
  }
250
225
  return { ok: true };
@@ -260,12 +235,9 @@ export class TranslationBuilder {
260
235
  };
261
236
  }
262
237
  /**
263
- * Builds the lines, in the closed list's order.
264
- *
265
- * A slot's credential line is always emitted, blank. For OpenAI and Anthropic that is a blank the
266
- * user must fill: the runtime registers those slots only when the key is non-empty
267
- * (`apps/api/src/index.ts:382`, `:398`). For the local slot blank is the finished answer — a
268
- * local model server needs no key, and blank reads as absent (`apps/api/src/index.ts:439-442`).
238
+ * Lines in the closed list's order. A slot's credential line is always emitted blank: the runtime
239
+ * registers OpenAI and Anthropic only with a non-empty key, so the user fills it; for the local
240
+ * slot blank is final, since a local server needs no key and blank reads as absent.
269
241
  */
270
242
  emit() {
271
243
  const values = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"translate.js","sourceRoot":"","sources":["../../src/migrate/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAyB,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAqB5B,MAAM,cAAc,GAA8C;IAChE,MAAM,EAAE;QACN,UAAU,EAAE,gBAAgB;QAC5B,KAAK,EAAE,0BAA0B;QACjC,OAAO,EAAE,4BAA4B;KACtC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,mBAAmB;QAC/B,KAAK,EAAE,6BAA6B;QACpC,OAAO,EAAE,+BAA+B;KACzC;IACD,KAAK,EAAE;QACL,UAAU,EAAE,+BAA+B;QA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,CAAC;QAED,MAAM,KAAK,GAAc,EAAE,CAAC;QAC5B,KAAK,MAAM,IAAI,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS;gBAAE,SAAS;YAClC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,mCAAmC,CAAC,CAAC;YAC/E,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAOD,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,OAAyB;IACjE,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -1,9 +1,6 @@
1
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.
2
+ * What `makine migrate` produces. CLI output, not a registered Makine contract; `--json` prints
3
+ * these fields and the default rendering is an env-file fragment built from them.
7
4
  */
8
5
  /**
9
6
  * How the API process is started, which decides which variables can reach it at all.
@@ -15,11 +12,8 @@
15
12
  export type MigrationShape = "onprem" | "direct";
16
13
  export type MigrationSource = "litellm" | "portkey";
17
14
  /**
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.
15
+ * A location in the parsed input, as segments: joined, a key containing `.` (`"gpt-4.1"`) would be
16
+ * indistinguishable from two levels of nesting.
23
17
  */
24
18
  export type PathSegment = string | number;
25
19
  export type InputPath = readonly PathSegment[];
@@ -1 +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,CA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AC;IAC/B,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CAChC"}
@@ -1,9 +1,6 @@
1
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.
2
+ * What `makine migrate` produces. CLI output, not a registered Makine contract; `--json` prints
3
+ * these fields and the default rendering is an env-file fragment built from them.
7
4
  */
8
5
  export {};
9
6
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/migrate/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/migrate/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,29 @@
1
+ export declare const SESSION_DIRECTORY_NAME = ".makine";
2
+ export declare const SESSION_FILE_NAME = "session";
3
+ export interface StoredSession {
4
+ /** The base URL this token authenticates against, normalised. */
5
+ base_url: string;
6
+ token: string;
7
+ workspace_id: string;
8
+ workspace_label: string | null;
9
+ expires_at: string;
10
+ }
11
+ export interface SessionStoreIo {
12
+ env: Record<string, string | undefined>;
13
+ }
14
+ /**
15
+ * Trailing slashes and a default port are not identity, so they are folded away before two base
16
+ * URLs are compared. Anything that does not parse compares only as itself.
17
+ */
18
+ export declare function normalizeBaseUrl(raw: string): string;
19
+ export declare function sessionDirectory(io: SessionStoreIo): string;
20
+ export declare function sessionFilePath(io: SessionStoreIo): string;
21
+ export declare function readStoredSession(io: SessionStoreIo): StoredSession | undefined;
22
+ export declare function writeStoredSession(io: SessionStoreIo, session: StoredSession): void;
23
+ export declare function deleteStoredSession(io: SessionStoreIo): void;
24
+ /** The stored token, but only when it was minted against the base URL about to be called. */
25
+ export declare function storedSessionFor(io: SessionStoreIo, baseUrl: string): {
26
+ session: StoredSession;
27
+ matches: boolean;
28
+ } | undefined;
29
+ //# sourceMappingURL=session-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../src/session-store.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,CAE3D;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,CAE1D;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,cAAc,GAAG,aAAa,GAAG,SAAS,CAiB/E;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CASnF;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,CAE5D;AAED,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,cAAc,EAClB,OAAO,EAAE,MAAM,GACd;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAI1D"}