diff --git a/dist/__tests__/plugin-manifest-parity.test.d.ts b/dist/__tests__/plugin-manifest-parity.test.d.ts new file mode 100644 index 0000000..9f3ee9f --- /dev/null +++ b/dist/__tests__/plugin-manifest-parity.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=plugin-manifest-parity.test.d.ts.map \ No newline at end of file diff --git a/dist/__tests__/plugin-manifest-parity.test.d.ts.map b/dist/__tests__/plugin-manifest-parity.test.d.ts.map new file mode 100644 index 0000000..466c29f --- /dev/null +++ b/dist/__tests__/plugin-manifest-parity.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin-manifest-parity.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/plugin-manifest-parity.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/__tests__/plugin-manifest-parity.test.js b/dist/__tests__/plugin-manifest-parity.test.js new file mode 100644 index 0000000..a338706 --- /dev/null +++ b/dist/__tests__/plugin-manifest-parity.test.js @@ -0,0 +1,25 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const strict_1 = __importDefault(require("node:assert/strict")); +const node_fs_1 = __importDefault(require("node:fs")); +const rootManifest = JSON.parse(node_fs_1.default.readFileSync("openclaw.plugin.json", "utf8")); +const distManifest = JSON.parse(node_fs_1.default.readFileSync("dist/openclaw.plugin.json", "utf8")); +strict_1.default.deepEqual(distManifest.tools, rootManifest.tools); +strict_1.default.deepEqual(distManifest.configSchema, rootManifest.configSchema); +strict_1.default.equal(distManifest.main, "index.js"); +for (const property of [ + "companyBrainContextMode", + "companyBrainContextAccountId", + "companyBrainContextSearch", + "companyBrainContextFactsLimit", + "companyBrainContextEventsLimit", + "companyBrainContextMaxChars", +]) { + strict_1.default.ok(distManifest.configSchema.properties[property], `dist manifest is missing ${property}`); +} +strict_1.default.ok(distManifest.tools.includes("cortex_insights"), "dist manifest is missing cortex_insights"); +console.log("plugin-manifest-parity tests passed"); +//# sourceMappingURL=plugin-manifest-parity.test.js.map \ No newline at end of file diff --git a/dist/__tests__/plugin-manifest-parity.test.js.map b/dist/__tests__/plugin-manifest-parity.test.js.map new file mode 100644 index 0000000..b91891f --- /dev/null +++ b/dist/__tests__/plugin-manifest-parity.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin-manifest-parity.test.js","sourceRoot":"","sources":["../../src/__tests__/plugin-manifest-parity.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,sDAAyB;AAEzB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAE,CAAC,YAAY,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,CAAC;AACjF,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAE,CAAC,YAAY,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtF,gBAAM,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;AACzD,gBAAM,CAAC,SAAS,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;AACvE,gBAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAE5C,KAAK,MAAM,QAAQ,IAAI;IACrB,yBAAyB;IACzB,8BAA8B;IAC9B,2BAA2B;IAC3B,+BAA+B;IAC/B,gCAAgC;IAChC,6BAA6B;CAC9B,EAAE,CAAC;IACF,gBAAM,CAAC,EAAE,CACP,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,EAC9C,4BAA4B,QAAQ,EAAE,CACvC,CAAC;AACJ,CAAC;AAED,gBAAM,CAAC,EAAE,CACP,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAC9C,0CAA0C,CAC3C,CAAC;AAEF,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/openclaw.plugin.json b/dist/openclaw.plugin.json index 7227341..e818a09 100644 --- a/dist/openclaw.plugin.json +++ b/dist/openclaw.plugin.json @@ -1,7 +1,7 @@ { "id": "cortex", "name": "Memory (Cortex)", - "description": "Cortex memory engine \u2014 retrieval, storage, and lifecycle management for evaOS", + "description": "Cortex memory engine — retrieval, storage, and lifecycle management for evaOS", "version": "1.0.0", "kind": "memory", "main": "index.js", @@ -15,6 +15,7 @@ "cortex_add_commitment", "cortex_update_commitment", "cortex_list_commitments", + "cortex_insights", "company_brain_accounts_list", "company_brain_account_brief", "company_brain_account_timeline", @@ -49,7 +50,7 @@ }, "shadowMode": { "type": "boolean", - "description": "Shadow mode \u2014 capture runs extraction but skips storage (dry-run, default: false)" + "description": "Shadow mode — capture runs extraction but skips storage (dry-run, default: false)" }, "retrievalBudget": { "type": "number", @@ -67,6 +68,62 @@ "thorough" ], "description": "Retrieval mode for memory search (default: fast)" + }, + "injectionFormat": { + "type": "string", + "enum": [ + "v1", + "v2" + ], + "default": "v1", + "description": "Memory injection format version" + }, + "showConflicts": { + "type": "boolean", + "default": true, + "description": "Show conflict markers in v2 format" + }, + "showRelations": { + "type": "boolean", + "default": true, + "description": "Show relation hints in v2 format" + }, + "dedup": { + "type": "boolean", + "default": true, + "description": "Deduplicate similar memories in v2 format" + }, + "companyBrainContextMode": { + "type": "string", + "enum": [ + "off", + "auto" + ], + "default": "off", + "description": "Opt-in account-scoped Company Brain context injection mode" + }, + "companyBrainContextAccountId": { + "type": "string", + "description": "Stable Company Brain account ID to inject when companyBrainContextMode is auto" + }, + "companyBrainContextSearch": { + "type": "string", + "description": "Account search text used with company_brain_accounts_list when no account ID is configured" + }, + "companyBrainContextFactsLimit": { + "type": "number", + "default": 25, + "description": "Max account facts to request for Company Brain context" + }, + "companyBrainContextEventsLimit": { + "type": "number", + "default": 10, + "description": "Max action-readiness events to request for Company Brain context" + }, + "companyBrainContextMaxChars": { + "type": "number", + "default": 6000, + "description": "Max characters for the Company Brain context block" } }, "required": [] diff --git a/package.json b/package.json index 419f9a6..79e9cb3 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build": "tsc", - "test": "npm run build && node dist/__tests__/memory-context-format.test.js && node dist/__tests__/company-brain-tools.test.js && node dist/__tests__/company-brain-context-format.test.js", + "build": "tsc && node scripts/sync-dist-manifest.mjs", + "test": "npm run build && node dist/__tests__/memory-context-format.test.js && node dist/__tests__/company-brain-tools.test.js && node dist/__tests__/company-brain-context-format.test.js && node dist/__tests__/plugin-manifest-parity.test.js", "company-brain:canary": "node scripts/company-brain-canary.mjs", "prepublishOnly": "npm run build" }, diff --git a/scripts/sync-dist-manifest.mjs b/scripts/sync-dist-manifest.mjs new file mode 100644 index 0000000..3923846 --- /dev/null +++ b/scripts/sync-dist-manifest.mjs @@ -0,0 +1,8 @@ +import { readFileSync, writeFileSync } from "node:fs"; + +const manifest = JSON.parse(readFileSync("openclaw.plugin.json", "utf8")); + +writeFileSync( + "dist/openclaw.plugin.json", + `${JSON.stringify({ ...manifest, main: "index.js" }, null, 2)}\n`, +); diff --git a/src/__tests__/plugin-manifest-parity.test.ts b/src/__tests__/plugin-manifest-parity.test.ts new file mode 100644 index 0000000..122df71 --- /dev/null +++ b/src/__tests__/plugin-manifest-parity.test.ts @@ -0,0 +1,30 @@ +import assert from "node:assert/strict"; +import fs from "node:fs"; + +const rootManifest = JSON.parse(fs.readFileSync("openclaw.plugin.json", "utf8")); +const distManifest = JSON.parse(fs.readFileSync("dist/openclaw.plugin.json", "utf8")); + +assert.deepEqual(distManifest.tools, rootManifest.tools); +assert.deepEqual(distManifest.configSchema, rootManifest.configSchema); +assert.equal(distManifest.main, "index.js"); + +for (const property of [ + "companyBrainContextMode", + "companyBrainContextAccountId", + "companyBrainContextSearch", + "companyBrainContextFactsLimit", + "companyBrainContextEventsLimit", + "companyBrainContextMaxChars", +]) { + assert.ok( + distManifest.configSchema.properties[property], + `dist manifest is missing ${property}`, + ); +} + +assert.ok( + distManifest.tools.includes("cortex_insights"), + "dist manifest is missing cortex_insights", +); + +console.log("plugin-manifest-parity tests passed");