predicate-skill 2.0.1 → 2.0.2
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.
- package/.claude-plugin/plugin.json +1 -1
- package/cli.bundle.mjs +32 -20
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "predicate",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Local reasoning knowledge graph (RDF/OWL) for AI agents — 9 kg_* MCP tools + cross-platform Stop-hook turn extraction (Claude Code + Gemini CLI + OpenCode) + reasoning bridge for action data.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Nordic Agents Research",
|
package/cli.bundle.mjs
CHANGED
|
@@ -17149,9 +17149,19 @@ var require_src = __commonJS({
|
|
|
17149
17149
|
|
|
17150
17150
|
// ../predicate-cli/src/docker.ts
|
|
17151
17151
|
import { execSync, spawnSync } from "node:child_process";
|
|
17152
|
-
import { existsSync } from "node:fs";
|
|
17153
|
-
import { resolve, dirname } from "node:path";
|
|
17152
|
+
import { existsSync, cpSync } from "node:fs";
|
|
17153
|
+
import { resolve, dirname, join } from "node:path";
|
|
17154
17154
|
import { fileURLToPath } from "node:url";
|
|
17155
|
+
import { homedir } from "node:os";
|
|
17156
|
+
var DOCKER_SHARED_PREFIXES = ["/Users", "/Volumes", "/private", "/tmp", "/var/folders"];
|
|
17157
|
+
function isDockerAccessible(path) {
|
|
17158
|
+
return DOCKER_SHARED_PREFIXES.some((p2) => path.startsWith(p2));
|
|
17159
|
+
}
|
|
17160
|
+
function stageComposeDir(src) {
|
|
17161
|
+
const dest = join(homedir(), ".predicate", "compose");
|
|
17162
|
+
cpSync(src, dest, { recursive: true, force: true });
|
|
17163
|
+
return dest;
|
|
17164
|
+
}
|
|
17155
17165
|
function findComposeDir() {
|
|
17156
17166
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
17157
17167
|
const candidates = [
|
|
@@ -17163,7 +17173,9 @@ function findComposeDir() {
|
|
|
17163
17173
|
resolve(here, "..", "..", "..", "predicate-server")
|
|
17164
17174
|
].filter((p2) => Boolean(p2));
|
|
17165
17175
|
for (const c2 of candidates) {
|
|
17166
|
-
if (c2 && existsSync(resolve(c2, "docker-compose.yml")))
|
|
17176
|
+
if (c2 && existsSync(resolve(c2, "docker-compose.yml"))) {
|
|
17177
|
+
return isDockerAccessible(c2) ? c2 : stageComposeDir(c2);
|
|
17178
|
+
}
|
|
17167
17179
|
}
|
|
17168
17180
|
throw new Error(
|
|
17169
17181
|
`Could not locate docker-compose.yml. Set PREDICATE_COMPOSE_DIR to the directory containing it, or run from the predicate repo root. Searched: ${candidates.join(", ")}`
|
|
@@ -17274,7 +17286,7 @@ function escapeLiteral(value) {
|
|
|
17274
17286
|
|
|
17275
17287
|
// ../predicate-cli/src/commands/init.ts
|
|
17276
17288
|
import { readFileSync, existsSync as existsSync2, statSync } from "node:fs";
|
|
17277
|
-
import { join, dirname as dirname2, resolve as resolve2 } from "node:path";
|
|
17289
|
+
import { join as join2, dirname as dirname2, resolve as resolve2 } from "node:path";
|
|
17278
17290
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
17279
17291
|
import { createInterface } from "node:readline/promises";
|
|
17280
17292
|
var META = "https://predicate.dev/meta#";
|
|
@@ -17290,16 +17302,16 @@ function hasFlag(args, name) {
|
|
|
17290
17302
|
function findCatalogDir() {
|
|
17291
17303
|
const here = dirname2(fileURLToPath2(import.meta.url));
|
|
17292
17304
|
const candidates = [
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17305
|
+
join2(here, "..", "..", "..", "predicate-ontology", "catalog"),
|
|
17306
|
+
join2(here, "..", "predicate-ontology", "catalog"),
|
|
17307
|
+
join2(here, "..", "..", "predicate-ontology", "catalog"),
|
|
17308
|
+
join2(here, "predicate-ontology", "catalog")
|
|
17297
17309
|
];
|
|
17298
|
-
for (const c2 of candidates) if (existsSync2(
|
|
17310
|
+
for (const c2 of candidates) if (existsSync2(join2(c2, "catalog.json"))) return c2;
|
|
17299
17311
|
throw new Error(`catalog directory not found \u2014 checked ${candidates.join(", ")}`);
|
|
17300
17312
|
}
|
|
17301
17313
|
function findMetaTtl(catalogDir) {
|
|
17302
|
-
return
|
|
17314
|
+
return join2(catalogDir, "..", "meta", "predicate-meta.ttl");
|
|
17303
17315
|
}
|
|
17304
17316
|
function help() {
|
|
17305
17317
|
console.log(`predicate init [--mode community|upload|empty] [--ontology NAME] [--file PATH] [--force]
|
|
@@ -17374,7 +17386,7 @@ function validateUserUpload(turtle) {
|
|
|
17374
17386
|
}
|
|
17375
17387
|
async function buildPlanCommunity(ontology) {
|
|
17376
17388
|
const catalogDir = findCatalogDir();
|
|
17377
|
-
const catalog = JSON.parse(readFileSync(
|
|
17389
|
+
const catalog = JSON.parse(readFileSync(join2(catalogDir, "catalog.json"), "utf8"));
|
|
17378
17390
|
const entry = catalog.ontologies.find((o2) => o2.name === ontology);
|
|
17379
17391
|
if (!entry) {
|
|
17380
17392
|
console.error(`predicate init: unknown ontology '${ontology}'. Available: ${catalog.ontologies.map((o2) => o2.name).join(", ")}`);
|
|
@@ -17409,8 +17421,8 @@ async function applyPlan(client, plan, force) {
|
|
|
17409
17421
|
await wipeForInit(client, force);
|
|
17410
17422
|
await loadTtlFile(client, findMetaTtl(plan.catalogDir));
|
|
17411
17423
|
if (plan.kind === "community") {
|
|
17412
|
-
for (const f2 of plan.entry.files) await loadTtlFile(client,
|
|
17413
|
-
if (plan.entry.shapes) await loadTtlFile(client,
|
|
17424
|
+
for (const f2 of plan.entry.files) await loadTtlFile(client, join2(plan.catalogDir, f2));
|
|
17425
|
+
if (plan.entry.shapes) await loadTtlFile(client, join2(plan.catalogDir, plan.entry.shapes));
|
|
17414
17426
|
await writeConfig(client, "community", plan.entry.name);
|
|
17415
17427
|
console.log(`predicate init: ${plan.entry.name} ontology loaded (${plan.entry.description}, license: ${plan.entry.license}).`);
|
|
17416
17428
|
return 0;
|
|
@@ -17429,7 +17441,7 @@ async function applyPlan(client, plan, force) {
|
|
|
17429
17441
|
console.log(`predicate init: uploaded ${plan.abs} (${plan.size} bytes). Schema-learning enabled.`);
|
|
17430
17442
|
return 0;
|
|
17431
17443
|
}
|
|
17432
|
-
await loadTtlFile(client,
|
|
17444
|
+
await loadTtlFile(client, join2(plan.catalogDir, "top.ttl"));
|
|
17433
17445
|
await writeConfig(client, "empty", "top");
|
|
17434
17446
|
console.log(`predicate init: empty mode (meta + top vocabulary loaded). The agent will propose new predicates as needed; sweeper promotes after 3 uses.`);
|
|
17435
17447
|
return 0;
|
|
@@ -17450,7 +17462,7 @@ async function interactive(client, force) {
|
|
|
17450
17462
|
let plan;
|
|
17451
17463
|
if (choice === "1") {
|
|
17452
17464
|
const catalogDir = findCatalogDir();
|
|
17453
|
-
const catalog = JSON.parse(readFileSync(
|
|
17465
|
+
const catalog = JSON.parse(readFileSync(join2(catalogDir, "catalog.json"), "utf8"));
|
|
17454
17466
|
console.log("\nAvailable ontologies:");
|
|
17455
17467
|
for (const o2 of catalog.ontologies) console.log(` - ${o2.name.padEnd(18)} ${o2.description}`);
|
|
17456
17468
|
const name = (await rl.question("\nWhich ontology? ")).trim();
|
|
@@ -28690,7 +28702,7 @@ async function recall(args) {
|
|
|
28690
28702
|
// ../predicate-cli/src/commands/dashboard.ts
|
|
28691
28703
|
import { createServer } from "node:http";
|
|
28692
28704
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
28693
|
-
import { join as
|
|
28705
|
+
import { join as join3, dirname as dirname3 } from "node:path";
|
|
28694
28706
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
28695
28707
|
import { spawn } from "node:child_process";
|
|
28696
28708
|
function parseFlag7(args, name) {
|
|
@@ -28745,11 +28757,11 @@ async function proxyQuery(req, res, fusekiUrl, dataset2) {
|
|
|
28745
28757
|
function findDashboardHtml() {
|
|
28746
28758
|
const here = dirname3(fileURLToPath3(import.meta.url));
|
|
28747
28759
|
const candidates = [
|
|
28748
|
-
|
|
28749
|
-
|
|
28760
|
+
join3(here, "..", "..", "..", "predicate-skill", "dashboard", "index.html"),
|
|
28761
|
+
join3(here, "dashboard", "index.html"),
|
|
28750
28762
|
// bundled cli.bundle.mjs sits next to dashboard/
|
|
28751
|
-
|
|
28752
|
-
|
|
28763
|
+
join3(here, "..", "dashboard", "index.html"),
|
|
28764
|
+
join3(here, "..", "..", "dashboard", "index.html")
|
|
28753
28765
|
];
|
|
28754
28766
|
for (const p2 of candidates) {
|
|
28755
28767
|
try {
|
package/package.json
CHANGED