@hasna/project 0.1.5 → 0.1.7
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/dist/cli/commands/projects.d.ts.map +1 -1
- package/dist/cli/index.js +9 -2
- package/dist/db/projects.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/mcp/index.js +15 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0DzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0DzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyrB9D"}
|
package/dist/cli/index.js
CHANGED
|
@@ -36369,7 +36369,13 @@ function listProjects(filter = {}, db) {
|
|
|
36369
36369
|
const where = conditions.length ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
36370
36370
|
const limit = filter.limit ?? 100;
|
|
36371
36371
|
const offset = filter.offset ?? 0;
|
|
36372
|
-
|
|
36372
|
+
let rows = d.query(`SELECT * FROM projects ${where} ORDER BY name ASC LIMIT ? OFFSET ?`).all(...params, limit, offset);
|
|
36373
|
+
if (filter.tags && filter.tags.length > 0) {
|
|
36374
|
+
rows = rows.filter((row) => {
|
|
36375
|
+
const rowTags = row.tags ? JSON.parse(row.tags) : [];
|
|
36376
|
+
return filter.tags.every((t) => rowTags.includes(t));
|
|
36377
|
+
});
|
|
36378
|
+
}
|
|
36373
36379
|
return rows.map(rowToProject);
|
|
36374
36380
|
}
|
|
36375
36381
|
function updateProject(id, input, db) {
|
|
@@ -46429,7 +46435,8 @@ function registerProjectCommands(program2) {
|
|
|
46429
46435
|
cmd.command("list").description("List projects").option("--status <status>", "Filter by status (active|archived)").option("--tags <tags>", "Filter by tags (comma-separated)").option("--limit <n>", "Max results", "50").option("--json", "Output raw JSON").action((opts) => {
|
|
46430
46436
|
const filter = {
|
|
46431
46437
|
status: opts.status,
|
|
46432
|
-
limit: parseInt(opts.limit, 10)
|
|
46438
|
+
limit: parseInt(opts.limit, 10),
|
|
46439
|
+
tags: opts.tags ? opts.tags.split(",").map((t8) => t8.trim()) : undefined
|
|
46433
46440
|
};
|
|
46434
46441
|
const projects = listProjects(filter);
|
|
46435
46442
|
if (opts.json || process.env["PROJECTS_JSON"]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/db/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAE7D,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,EAEP,aAAa,EACb,mBAAmB,EACnB,OAAO,EAEP,aAAa,EACd,MAAM,mBAAmB,CAAC;AAc3B,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK5C;AAwBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAmD/E;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAMpE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAM5E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,Q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E,CAAC,EAAE,QAAQ,GACZ,OAAO,CAqBT;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAMjE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAMnE;AAeD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,CAoC9E;AAOD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,aAAa,EACxB,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAST;AAED,wBAAgB,eAAe,CAC7B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACjE,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAST;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,EAAE,CAMpF"}
|
package/dist/index.js
CHANGED
|
@@ -22645,7 +22645,13 @@ function listProjects(filter = {}, db) {
|
|
|
22645
22645
|
const where = conditions.length ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
22646
22646
|
const limit = filter.limit ?? 100;
|
|
22647
22647
|
const offset = filter.offset ?? 0;
|
|
22648
|
-
|
|
22648
|
+
let rows = d.query(`SELECT * FROM projects ${where} ORDER BY name ASC LIMIT ? OFFSET ?`).all(...params, limit, offset);
|
|
22649
|
+
if (filter.tags && filter.tags.length > 0) {
|
|
22650
|
+
rows = rows.filter((row) => {
|
|
22651
|
+
const rowTags = row.tags ? JSON.parse(row.tags) : [];
|
|
22652
|
+
return filter.tags.every((t) => rowTags.includes(t));
|
|
22653
|
+
});
|
|
22654
|
+
}
|
|
22649
22655
|
return rows.map(rowToProject);
|
|
22650
22656
|
}
|
|
22651
22657
|
function updateProject(id, input, db) {
|
package/dist/mcp/index.js
CHANGED
|
@@ -37798,7 +37798,13 @@ function listProjects(filter = {}, db) {
|
|
|
37798
37798
|
const where = conditions.length ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
37799
37799
|
const limit = filter.limit ?? 100;
|
|
37800
37800
|
const offset = filter.offset ?? 0;
|
|
37801
|
-
|
|
37801
|
+
let rows = d.query(`SELECT * FROM projects ${where} ORDER BY name ASC LIMIT ? OFFSET ?`).all(...params, limit, offset);
|
|
37802
|
+
if (filter.tags && filter.tags.length > 0) {
|
|
37803
|
+
rows = rows.filter((row) => {
|
|
37804
|
+
const rowTags = row.tags ? JSON.parse(row.tags) : [];
|
|
37805
|
+
return filter.tags.every((t) => rowTags.includes(t));
|
|
37806
|
+
});
|
|
37807
|
+
}
|
|
37802
37808
|
return rows.map(rowToProject);
|
|
37803
37809
|
}
|
|
37804
37810
|
function updateProject(id, input, db) {
|
|
@@ -47373,6 +47379,11 @@ ${summary}` }] };
|
|
|
47373
47379
|
});
|
|
47374
47380
|
}
|
|
47375
47381
|
|
|
47382
|
+
// src/lib/status.ts
|
|
47383
|
+
function touchLastOpened(projectId) {
|
|
47384
|
+
getDatabase().run("UPDATE projects SET last_opened_at = ? WHERE id = ?", [new Date().toISOString(), projectId]);
|
|
47385
|
+
}
|
|
47386
|
+
|
|
47376
47387
|
// src/lib/generate.ts
|
|
47377
47388
|
import { writeFileSync as writeFileSync6, existsSync as existsSync8, readFileSync as readFileSync6 } from "fs";
|
|
47378
47389
|
import { join as join9 } from "path";
|
|
@@ -47592,9 +47603,10 @@ server.tool("projects_create", "Register a new project. Returns the project with
|
|
|
47592
47603
|
});
|
|
47593
47604
|
server.tool("projects_list", "List all registered projects", {
|
|
47594
47605
|
status: exports_external.enum(["active", "archived"]).optional().describe("Filter by status"),
|
|
47606
|
+
tags: exports_external.array(exports_external.string()).optional().describe("Filter by tags (AND \u2014 all tags must match)"),
|
|
47595
47607
|
limit: exports_external.number().optional().describe("Max results (default 50)")
|
|
47596
47608
|
}, async (input) => {
|
|
47597
|
-
const projects = listProjects({ status: input.status, limit: input.limit ?? 50 });
|
|
47609
|
+
const projects = listProjects({ status: input.status, tags: input.tags, limit: input.limit ?? 50 });
|
|
47598
47610
|
return {
|
|
47599
47611
|
content: [{ type: "text", text: JSON.stringify(projects, null, 2) }]
|
|
47600
47612
|
};
|
|
@@ -47680,6 +47692,7 @@ server.tool("projects_open", "Get the local path of a project so an AI agent can
|
|
|
47680
47692
|
isError: true
|
|
47681
47693
|
};
|
|
47682
47694
|
}
|
|
47695
|
+
touchLastOpened(project.id);
|
|
47683
47696
|
return {
|
|
47684
47697
|
content: [
|
|
47685
47698
|
{
|
package/package.json
CHANGED