@codiac.io/codiac-cli 1.3.253 → 1.3.254

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 (31) hide show
  1. package/README.md +502 -163
  2. package/dist/apis/codiac-relay/gen/client.d.ts +12 -1
  3. package/dist/apis/codiac-relay/gen/client.js +23 -0
  4. package/dist/apis/codiac-relay/gen/client.js.map +1 -1
  5. package/dist/apis/codiac-relay/gen/contracts/types.gen.d.ts +120 -0
  6. package/dist/apis/codiac-relay/gen/contracts/types.gen.js.map +1 -1
  7. package/dist/apis/codiac-relay/i-client.d.ts +11 -0
  8. package/dist/apis/codiac-relay-nats/gen/client.d.ts +15 -0
  9. package/dist/apis/codiac-relay-nats/gen/client.js +27 -0
  10. package/dist/apis/codiac-relay-nats/gen/client.js.map +1 -1
  11. package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.d.ts +49 -0
  12. package/dist/commands/ai/model/attach.d.ts +37 -0
  13. package/dist/commands/ai/model/attach.js +173 -0
  14. package/dist/commands/ai/model/attach.js.map +1 -0
  15. package/dist/commands/ai/model/install.d.ts +105 -0
  16. package/dist/commands/ai/model/install.js +655 -0
  17. package/dist/commands/ai/model/install.js.map +1 -0
  18. package/dist/commands/ai/model/list.d.ts +37 -0
  19. package/dist/commands/ai/model/list.js +160 -0
  20. package/dist/commands/ai/model/list.js.map +1 -0
  21. package/dist/commands/ai/model/uninstall.d.ts +40 -0
  22. package/dist/commands/ai/model/uninstall.js +144 -0
  23. package/dist/commands/ai/model/uninstall.js.map +1 -0
  24. package/dist/commands/ai/model/view.d.ts +35 -0
  25. package/dist/commands/ai/model/view.js +143 -0
  26. package/dist/commands/ai/model/view.js.map +1 -0
  27. package/dist/uilogic/model-spec.d.ts +40 -0
  28. package/dist/uilogic/model-spec.js +71 -0
  29. package/dist/uilogic/model-spec.js.map +1 -0
  30. package/oclif.manifest.json +568 -1
  31. package/package.json +1 -1
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const core_1 = require("@oclif/core");
5
+ const YAML = require("yaml");
6
+ const jmespath = require("jmespath");
7
+ const _ = require("lodash");
8
+ const command_base_exec_1 = require("../../../command-base-exec");
9
+ const type_safety_utils_1 = require("../../../uilogic/type-safety-utils");
10
+ var ViewOutputFormatsEnum;
11
+ (function (ViewOutputFormatsEnum) {
12
+ ViewOutputFormatsEnum["text"] = "text";
13
+ ViewOutputFormatsEnum["json"] = "json";
14
+ ViewOutputFormatsEnum["yaml"] = "yaml";
15
+ })(ViewOutputFormatsEnum || (ViewOutputFormatsEnum = {}));
16
+ class AiModelView extends command_base_exec_1.CommandBaseExec {
17
+ constructor() {
18
+ super(...arguments);
19
+ this._outputFormat = ViewOutputFormatsEnum.text;
20
+ }
21
+ captureArgs() {
22
+ var _a;
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const { flags } = yield this.parse(AiModelView);
25
+ let partial = {};
26
+ if (flags.enterpriseCode)
27
+ partial.enterprise = flags.enterpriseCode;
28
+ if (flags.model)
29
+ partial.model = flags.model.trim();
30
+ if (flags.cabinet)
31
+ partial.cabinet = flags.cabinet;
32
+ if (flags.output) {
33
+ this._outputFormat = (_a = type_safety_utils_1.TypeSafetyUtils.toEnum(ViewOutputFormatsEnum, flags.output)) !== null && _a !== void 0 ? _a : ViewOutputFormatsEnum.text;
34
+ }
35
+ else if (!_.isEmpty(flags.query)) {
36
+ this._outputFormat = ViewOutputFormatsEnum.json;
37
+ }
38
+ else {
39
+ this._outputFormat = ViewOutputFormatsEnum.text;
40
+ }
41
+ this._query = flags.query;
42
+ return [partial, false];
43
+ });
44
+ }
45
+ buildCandidate_silently(partial, _rootMap) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ if (partial.model == undefined || _.isEmpty(partial.model))
48
+ throw new Error("Must specify a model handle (--model <handle>).");
49
+ return Object.assign({ enterprise: partial.enterprise, model: partial.model }, (partial.cabinet ? { cabinet: partial.cabinet } : {}));
50
+ });
51
+ }
52
+ buildCandidate_interactively(partial, _rootMap, _takeDefaults) {
53
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
54
+ // A model handle is required; prompt for it when omitted rather than failing.
55
+ if (partial.model == undefined || _.isEmpty(partial.model)) {
56
+ const typed = yield this._ui.prompt('model', 'Handle of the model to view:', true);
57
+ partial.model = (typed !== null && typed !== void 0 ? typed : '').trim();
58
+ }
59
+ return this.buildCandidate_silently(partial, _rootMap);
60
+ });
61
+ }
62
+ buildCommandString(candidate, cmd) {
63
+ cmd.push("-e", candidate.enterprise);
64
+ cmd.push("-m", candidate.model);
65
+ if (candidate.cabinet)
66
+ cmd.push("-c", candidate.cabinet);
67
+ if (this._outputFormat !== ViewOutputFormatsEnum.text)
68
+ cmd.push("-o", this._outputFormat);
69
+ if (this._query)
70
+ cmd.push("-q", this._query);
71
+ cmd.push("--silent");
72
+ return cmd;
73
+ }
74
+ // NOTE: find-one over the SYNC `get.ai-model-list` read — there is no per-handle read endpoint in
75
+ // this slice, so we list (cabinet-filtered when given) and select the matching handle client-side.
76
+ executeTask(candidate) {
77
+ var _a, _b;
78
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
+ const result = yield this.genRelayClient.Call.aiModelList({ enterprise: candidate.enterprise, cabinet: candidate.cabinet });
80
+ if (result.error) {
81
+ this.logger.error(`Error reading models for [${candidate.enterprise}]: ${(_a = result.message) !== null && _a !== void 0 ? _a : ''}`, result.error);
82
+ throw result.error;
83
+ }
84
+ const models = (_b = result.output) !== null && _b !== void 0 ? _b : [];
85
+ const model = models.find(m => m.handle === candidate.model);
86
+ if (model == undefined) {
87
+ throw new Error(`No model with handle [${candidate.model}] found for enterprise [${candidate.enterprise}]${candidate.cabinet ? ` in cabinet [${candidate.cabinet}]` : ''}.`);
88
+ }
89
+ let data = model;
90
+ if (this._query && !_.isEmpty(this._query.trim())) {
91
+ data = jmespath.search(model, this._query);
92
+ }
93
+ switch (this._outputFormat) {
94
+ case ViewOutputFormatsEnum.json:
95
+ this._ui.dataOutput(JSON.stringify(data !== null && data !== void 0 ? data : null, undefined, 2));
96
+ break;
97
+ case ViewOutputFormatsEnum.yaml:
98
+ this._ui.dataOutput(YAML.stringify(data !== null && data !== void 0 ? data : null, { indent: 2 }));
99
+ break;
100
+ case ViewOutputFormatsEnum.text:
101
+ default:
102
+ this.renderText(model);
103
+ break;
104
+ }
105
+ });
106
+ }
107
+ renderText(m) {
108
+ this._ui.userMessage(`${this._styler.hilite(m.handle)}`);
109
+ this._ui.userMessage(` mode: ${m.mode}`);
110
+ this._ui.userMessage(` cabinet: ${m.cabinet}`);
111
+ this._ui.userMessage(` endpoint: ${this._styler.hilite(m.endpoint)}`);
112
+ this._ui.userMessage(` exposure: ${m.exposure}`);
113
+ this._ui.userMessage(` status: ${m.status}`);
114
+ }
115
+ }
116
+ exports.default = AiModelView;
117
+ AiModelView.description = 'Shows the details of a single provisioned model (served or BYO) by its handle.';
118
+ AiModelView.flags = {
119
+ help: core_1.Flags.help({ char: 'h' }),
120
+ enterpriseCode: core_1.Flags.string({ char: 'e', required: false, description: 'Code name identifying the target enterprise.' }),
121
+ model: core_1.Flags.string({ char: 'm', description: 'Handle of the model to view.' }),
122
+ cabinet: core_1.Flags.string({ char: 'c', description: 'Cabinet the model lives in (resolves a served endpoint to that cabinet\'s in-cluster service DNS).' }),
123
+ output: core_1.Flags.string({
124
+ char: 'o',
125
+ description: "Format in which to render the result.",
126
+ options: Object.keys(ViewOutputFormatsEnum),
127
+ }),
128
+ query: core_1.Flags.string({
129
+ char: 'q',
130
+ description: "JMESPath expression to reshape the result (see jmespath.org).",
131
+ }),
132
+ silent: core_1.Flags.boolean({ exclusive: ["echo", "to-script"], description: 'Executes without any user interaction; fails on missing or invalid arguments.' }),
133
+ echo: core_1.Flags.boolean({ exclusive: ["to-script", "silent"], description: 'Renders the equivalent non-interactive command for future use before executing.' }),
134
+ "to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Renders the equivalent non-interactive command without executing it.' }),
135
+ };
136
+ AiModelView.args = {};
137
+ AiModelView.examples = [
138
+ { description: "View a model by handle.", command: "<%= config.bin %> <%= command.id %> -e ben -m qwen3-dev" },
139
+ { description: "View as JSON.", command: "<%= config.bin %> <%= command.id %> -e ben -m qwen3-dev -o json" },
140
+ { description: "Just the endpoint.", command: "<%= config.bin %> <%= command.id %> -e ben -m qwen3-dev -q endpoint" },
141
+ { description: "Non-interactive invocation.", command: "<%= config.bin %> <%= command.id %> -e ben -m qwen3-dev --silent" },
142
+ ];
143
+ //# sourceMappingURL=view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/commands/ai/model/view.ts"],"names":[],"mappings":";;;AAAA,sCAA6C;AAC7C,6BAA6B;AAC7B,qCAAqC;AACrC,4BAA6B;AAG7B,kEAAgF;AAEhF,0EAAqE;AAGrE,IAAK,qBAIJ;AAJD,WAAK,qBAAqB;IACxB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,sCAAe,CAAA;AACjB,CAAC,EAJI,qBAAqB,KAArB,qBAAqB,QAIzB;AAWD,MAAqB,WAAY,SAAQ,mCAAkC;IAA3E;;QAIU,kBAAa,GAA0B,qBAAqB,CAAC,IAAI,CAAC;IAoH5E,CAAC;IArFc,WAAW;;;YACtB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAEhD,IAAI,OAAO,GAA+B,EAAE,CAAC;YAC7C,IAAI,KAAK,CAAC,cAAc;gBAAE,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC;YACpE,IAAI,KAAK,CAAC,KAAK;gBAAE,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACpD,IAAI,KAAK,CAAC,OAAO;gBAAE,OAAO,CAAC,OAAO,GAAG,KAAK,C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T,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;KAC5C,CAAC;IACF,KAAK,EAAE,YAAK,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,+DAA+D;KAC7E,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,+EAA+E,EAAE,CAAC;IACzJ,IAAI,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,iFAAiF,EAAE,CAAC;IAC3J,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,sEAAsE,EAAE,CAAC;CACnJ,CAAC;AAEK,gBAAI,GAAG,EAAE,CAAC;AAEV,oBAAQ,GAAsB;IACnC,EAAE,WAAW,EAAE,yBAAyB,EAAE,OAAO,EAAE,yDAAyD,EAAE;IAC9G,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,iEAAiE,EAAE;IAC5G,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,qEAAqE,EAAE;IACrH,EAAE,WAAW,EAAE,6BAA6B,EAAE,OAAO,EAAE,kEAAkE,EAAE;CAC5H,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Centralizes the license-clean, in-cluster-servable LLM catalog plus the BYO
3
+ * (bring-your-own OpenAI-compatible endpoint) option. Pure function — no `this`,
4
+ * no I/O, no `_ui`. Callers (silent and interactive install flows alike) use this
5
+ * as the single source of truth so the two flows cannot drift on the default
6
+ * Ollama tag, natural runtime tier, or license of a given model kind.
7
+ *
8
+ * Catalog policy (see plan 22, Global Constraints): Apache/MIT-first, and
9
+ * **never Llama** (its 700M-MAU cap makes it not license-clean for this product).
10
+ */
11
+ export type ModelKind = 'qwen3' | 'gpt-oss' | 'glm' | 'deepseek-r1' | 'byo';
12
+ export type RuntimeTier = 'cpu' | 'gpu';
13
+ export interface ModelSpec {
14
+ /** The catalog identifier the CLI/relay key everything off of. */
15
+ kind: ModelKind;
16
+ /** Ollama tag pulled + served for this catalog entry. Absent for `byo` — a BYO
17
+ * endpoint is registered, not served, so there is no image to pull. */
18
+ defaultTag?: string;
19
+ /** The sizing the served catalog picks by default: `cpu` for models that run
20
+ * acceptably CPU-only, `gpu` for models that really want an accelerator. */
21
+ runtimeTier: RuntimeTier;
22
+ /** True when the model is impractical CPU-only and effectively needs a GPU node
23
+ * pool — surfaced so the install flow can steer `--runtime gpu`. */
24
+ minGpu?: boolean;
25
+ /** SPDX-ish license identifier, or `"varies"` when it differs per tag
26
+ * (DeepSeek-R1 distills carry the license of their base model). */
27
+ license: string;
28
+ /** Whether this kind is installable in this slice. */
29
+ supported: boolean;
30
+ }
31
+ /**
32
+ * Resolves a catalog entry for a model kind. Mirrors `resolveFrameworkSpec`:
33
+ * throws for an unknown kind rather than returning an unsupported placeholder.
34
+ */
35
+ export declare function resolveModelSpec(kind: string): ModelSpec;
36
+ /** True when `kind` is a servable catalog model (excludes `byo`, which is
37
+ * registered via `--source byo`, not chosen from the served catalog). */
38
+ export declare function isServedModelKind(kind: string): boolean;
39
+ /** The served catalog kinds, in a stable order, for interactive model selection. */
40
+ export declare function supportedModelKinds(): Exclude<ModelKind, 'byo'>[];
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supportedModelKinds = exports.isServedModelKind = exports.resolveModelSpec = void 0;
4
+ /** The served catalog (everything except `byo`), keyed by kind. */
5
+ const SERVED_CATALOG = {
6
+ 'qwen3': {
7
+ kind: 'qwen3',
8
+ defaultTag: 'qwen3:8b',
9
+ runtimeTier: 'cpu',
10
+ license: 'Apache-2.0',
11
+ supported: true,
12
+ },
13
+ 'gpt-oss': {
14
+ kind: 'gpt-oss',
15
+ defaultTag: 'gpt-oss:20b',
16
+ runtimeTier: 'gpu',
17
+ minGpu: true,
18
+ license: 'Apache-2.0',
19
+ supported: true,
20
+ },
21
+ 'glm': {
22
+ kind: 'glm',
23
+ defaultTag: 'glm4:9b',
24
+ runtimeTier: 'gpu',
25
+ minGpu: true,
26
+ license: 'MIT',
27
+ supported: true,
28
+ },
29
+ 'deepseek-r1': {
30
+ kind: 'deepseek-r1',
31
+ defaultTag: 'deepseek-r1:8b',
32
+ runtimeTier: 'cpu',
33
+ license: 'varies',
34
+ supported: true,
35
+ },
36
+ };
37
+ /** The BYO pseudo-kind: a registered OpenAI-compatible endpoint. No served tag,
38
+ * so runtime tier is not meaningful (defaulted to `cpu` purely to satisfy the
39
+ * shape — nothing is scheduled for a BYO model). */
40
+ const BYO_SPEC = {
41
+ kind: 'byo',
42
+ runtimeTier: 'cpu',
43
+ license: 'n/a',
44
+ supported: true,
45
+ };
46
+ /**
47
+ * Resolves a catalog entry for a model kind. Mirrors `resolveFrameworkSpec`:
48
+ * throws for an unknown kind rather than returning an unsupported placeholder.
49
+ */
50
+ function resolveModelSpec(kind) {
51
+ if (kind === 'byo')
52
+ return Object.assign({}, BYO_SPEC);
53
+ const spec = SERVED_CATALOG[kind];
54
+ if (spec == undefined)
55
+ throw new Error(`Unknown model kind: ${kind}`);
56
+ return Object.assign({}, spec);
57
+ }
58
+ exports.resolveModelSpec = resolveModelSpec;
59
+ /** True when `kind` is a servable catalog model (excludes `byo`, which is
60
+ * registered via `--source byo`, not chosen from the served catalog). */
61
+ function isServedModelKind(kind) {
62
+ return Object.prototype.hasOwnProperty.call(SERVED_CATALOG, kind);
63
+ }
64
+ exports.isServedModelKind = isServedModelKind;
65
+ /** The served catalog kinds, in a stable order, for interactive model selection. */
66
+ function supportedModelKinds() {
67
+ return Object.keys(SERVED_CATALOG)
68
+ .filter(k => SERVED_CATALOG[k].supported);
69
+ }
70
+ exports.supportedModelKinds = supportedModelKinds;
71
+ //# sourceMappingURL=model-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-spec.js","sourceRoot":"","sources":["../../src/uilogic/model-spec.ts"],"names":[],"mappings":";;;AAiCA,mEAAmE;AACnE,MAAM,cAAc,GAAiD;IACnE,OAAO,EAAE;QACP,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,UAAU;QACtB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,IAAI;KAChB;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,aAAa;QACzB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,IAAI;KAChB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,IAAI;KAChB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,gBAAgB;QAC5B,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,QAAQ;QACjB,SAAS,EAAE,IAAI;KAChB;CACF,CAAC;AAEF;;qDAEqD;AACrD,MAAM,QAAQ,GAAc;IAC1B,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,IAAI,IAAI,KAAK,KAAK;QAAE,yBAAY,QAAQ,EAAG;IAC3C,MAAM,IAAI,GAAI,cAA4C,CAAC,IAAI,CAAC,CAAC;IACjE,IAAI,IAAI,IAAI,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;IACtE,yBAAY,IAA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