@hasna/brains 0.0.31 → 0.0.32
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.
|
@@ -15,6 +15,9 @@ declare function parseListFilters(opts: ListModelsOptions): {
|
|
|
15
15
|
status?: ModelStatus;
|
|
16
16
|
limit?: number;
|
|
17
17
|
};
|
|
18
|
+
declare function formatModelTags(tags: string | null | undefined): string;
|
|
19
|
+
declare function addModelTagJson(tags: string | null | undefined, tag: string): string;
|
|
20
|
+
declare function removeModelTagJson(tags: string | null | undefined, tag: string): string;
|
|
18
21
|
export declare function registerModelsCommands(program: Command): void;
|
|
19
|
-
export { parseListFilters, parseListLimit };
|
|
22
|
+
export { addModelTagJson, formatModelTags, parseListFilters, parseListLimit, removeModelTagJson };
|
|
20
23
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAS,eAAe,EAAgB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAS,eAAe,EAAgB,MAAM,mBAAmB,CAAC;AAMzE,KAAK,QAAQ,GAAG,OAAO,eAAe,CAAC,YAAY,CAAC;AACpD,KAAK,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AACrC,KAAK,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAUtC,UAAU,iBAAiB;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,iBAAS,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOxE;AAED,iBAAS,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAiBhH;AAED,iBAAS,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGhE;AAED,iBAAS,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED,iBAAS,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiQ7D;AAED,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -18143,7 +18143,6 @@ function printInfo(message) {
|
|
|
18143
18143
|
|
|
18144
18144
|
// src/cli/commands/models.ts
|
|
18145
18145
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
18146
|
-
|
|
18147
18146
|
// node_modules/openai/internal/qs/formats.mjs
|
|
18148
18147
|
var default_format = "RFC3986";
|
|
18149
18148
|
var formatters = {
|
|
@@ -23972,6 +23971,20 @@ function parseListFilters(opts) {
|
|
|
23972
23971
|
const status = statusRaw;
|
|
23973
23972
|
return { provider, status, limit: limit2 };
|
|
23974
23973
|
}
|
|
23974
|
+
function formatModelTags(tags) {
|
|
23975
|
+
const parsed = parseTagList(tags);
|
|
23976
|
+
return parsed.length > 0 ? parsed.join(", ") : "(none)";
|
|
23977
|
+
}
|
|
23978
|
+
function addModelTagJson(tags, tag) {
|
|
23979
|
+
const existing = parseTagList(tags);
|
|
23980
|
+
if (!existing.includes(tag)) {
|
|
23981
|
+
existing.push(tag);
|
|
23982
|
+
}
|
|
23983
|
+
return JSON.stringify(existing);
|
|
23984
|
+
}
|
|
23985
|
+
function removeModelTagJson(tags, tag) {
|
|
23986
|
+
return JSON.stringify(parseTagList(tags).filter((existingTag) => existingTag !== tag));
|
|
23987
|
+
}
|
|
23975
23988
|
function registerModelsCommands(program2) {
|
|
23976
23989
|
const modelsCmd = program2.command("models").description("Manage tracked fine-tuned models");
|
|
23977
23990
|
const ensureModelExists = async (id) => {
|
|
@@ -24032,7 +24045,7 @@ function registerModelsCommands(program2) {
|
|
|
24032
24045
|
return;
|
|
24033
24046
|
}
|
|
24034
24047
|
console.log();
|
|
24035
|
-
const tagsList =
|
|
24048
|
+
const tagsList = formatModelTags(model.tags);
|
|
24036
24049
|
console.log(` ID: ${model.id}`);
|
|
24037
24050
|
console.log(` Name: ${model.name}`);
|
|
24038
24051
|
console.log(` Display Name: ${model.displayName ?? "(none)"}`);
|
|
@@ -24079,12 +24092,10 @@ function registerModelsCommands(program2) {
|
|
|
24079
24092
|
printError(`Model not found: ${id}`);
|
|
24080
24093
|
process.exit(1);
|
|
24081
24094
|
}
|
|
24082
|
-
const
|
|
24083
|
-
|
|
24084
|
-
|
|
24085
|
-
}
|
|
24086
|
-
await db.update(fineTunedModels).set({ tags: JSON.stringify(existing), updatedAt: Date.now() }).where(eq(fineTunedModels.id, id));
|
|
24087
|
-
printSuccess(`Tag "${tag}" added. Tags: ${existing.join(", ")}`);
|
|
24095
|
+
const tagsJson = addModelTagJson(model.tags, tag);
|
|
24096
|
+
const updated = parseTagList(tagsJson);
|
|
24097
|
+
await db.update(fineTunedModels).set({ tags: tagsJson, updatedAt: Date.now() }).where(eq(fineTunedModels.id, id));
|
|
24098
|
+
printSuccess(`Tag "${tag}" added. Tags: ${updated.join(", ")}`);
|
|
24088
24099
|
} catch (err) {
|
|
24089
24100
|
printError(err instanceof Error ? err.message : String(err));
|
|
24090
24101
|
process.exit(1);
|
|
@@ -24098,9 +24109,9 @@ function registerModelsCommands(program2) {
|
|
|
24098
24109
|
printError(`Model not found: ${id}`);
|
|
24099
24110
|
process.exit(1);
|
|
24100
24111
|
}
|
|
24101
|
-
const
|
|
24102
|
-
const updated =
|
|
24103
|
-
await db.update(fineTunedModels).set({ tags:
|
|
24112
|
+
const tagsJson = removeModelTagJson(model.tags, tag);
|
|
24113
|
+
const updated = parseTagList(tagsJson);
|
|
24114
|
+
await db.update(fineTunedModels).set({ tags: tagsJson, updatedAt: Date.now() }).where(eq(fineTunedModels.id, id));
|
|
24104
24115
|
printSuccess(`Tag "${tag}" removed. Tags: ${updated.join(", ") || "(none)"}`);
|
|
24105
24116
|
} catch (err) {
|
|
24106
24117
|
printError(err instanceof Error ? err.message : String(err));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/brains",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "Fine-tuned model tracker and trainer — wraps OpenAI + Thinker Labs, gathers training data from todos/mementos/conversations/sessions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|