@nextclaw/service 0.5.0 → 0.6.0-beta.0

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.
@@ -14,7 +14,9 @@ declare class ProjectCommands {
14
14
  list: (options?: ProjectCommandOptions) => Promise<void>;
15
15
  templates: (options?: ProjectCommandOptions) => Promise<void>;
16
16
  create: (name: string, options?: ProjectCreateCommandOptions) => Promise<void>;
17
+ observe: (rootPath: string, options?: ProjectCommandOptions) => Promise<void>;
17
18
  private printCreatedProject;
19
+ private printObservationSummary;
18
20
  private withKernel;
19
21
  }
20
22
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"project-command.controller.d.ts","names":[],"sources":["../../../../src/controllers/commands/project/project-command.controller.ts"],"mappings":";;;KAMY,qBAAA;EACV,IAAA;AAAA;AAAA,KAGU,2BAAA,GAA8B,qBAAA;EACxC,IAAA;EACA,QAAA;AAAA;AAAA,cAGW,eAAA;EAAA,iBACkB,YAAA;cAAA,YAAA,QAAoB,cAAA;EAEjD,IAAA,GAAc,OAAA,GAAS,qBAAA,KAA6B,OAAA;EAiBpD,SAAA,GAAmB,OAAA,GAAS,qBAAA,KAA6B,OAAA;EAazD,MAAA,GACE,IAAA,UACA,OAAA,GAAS,2BAAA,KACR,OAAA;EAAA,QAYK,mBAAA;EAAA,QAQA,UAAA;AAAA"}
1
+ {"version":3,"file":"project-command.controller.d.ts","names":[],"sources":["../../../../src/controllers/commands/project/project-command.controller.ts"],"mappings":";;;KAOY,qBAAA;EACV,IAAA;AAAA;AAAA,KAGU,2BAAA,GAA8B,qBAAA;EACxC,IAAA;EACA,QAAA;AAAA;AAAA,cAGW,eAAA;EAAA,iBACkB,YAAA;cAAA,YAAA,QAAoB,cAAA;EAEjD,IAAA,GAAc,OAAA,GAAS,qBAAA,KAA6B,OAAA;EAiBpD,SAAA,GAAmB,OAAA,GAAS,qBAAA,KAA6B,OAAA;EAazD,MAAA,GACE,IAAA,UACA,OAAA,GAAS,2BAAA,KACR,OAAA;EAYH,OAAA,GAAiB,QAAA,UAAkB,OAAA,GAAS,qBAAA,KAA6B,OAAA;EAAA,QAWjE,mBAAA;EAAA,QAQA,uBAAA;EAAA,QAKA,UAAA;AAAA"}
@@ -41,6 +41,16 @@ var ProjectCommands = class {
41
41
  this.printCreatedProject(project, Boolean(options.json));
42
42
  });
43
43
  };
44
+ observe = async (rootPath, options = {}) => {
45
+ await this.withKernel(async (kernel) => {
46
+ const snapshot = await kernel.projectObservation.observe(rootPath);
47
+ if (options.json) {
48
+ console.log(JSON.stringify(snapshot, null, 2));
49
+ return;
50
+ }
51
+ this.printObservationSummary(snapshot);
52
+ });
53
+ };
44
54
  printCreatedProject = (project, json) => {
45
55
  if (json) {
46
56
  console.log(JSON.stringify(project, null, 2));
@@ -48,6 +58,10 @@ var ProjectCommands = class {
48
58
  }
49
59
  console.log(`Created project "${project.name}" at ${project.rootPath}`);
50
60
  };
61
+ printObservationSummary = (snapshot) => {
62
+ console.log(`${snapshot.project.name}\t${snapshot.dataQuality}\t${snapshot.project.rootPath}`);
63
+ console.log(`work-items: ${snapshot.workItems.length}, artifacts: ${snapshot.artifacts.length}, signals: ${snapshot.signals.length}, requests: ${snapshot.requests.length}`);
64
+ };
51
65
  withKernel = async (action) => {
52
66
  const kernel = this.createKernel();
53
67
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"project-command.controller.js","names":[],"sources":["../../../../src/controllers/commands/project/project-command.controller.ts"],"sourcesContent":["import type {\n CreateProjectInput,\n NextclawKernel,\n ProjectRecord,\n} from \"@nextclaw/kernel\";\n\nexport type ProjectCommandOptions = {\n json?: boolean;\n};\n\nexport type ProjectCreateCommandOptions = ProjectCommandOptions & {\n path?: string;\n template?: \"empty\" | \"knowledge-base\";\n};\n\nexport class ProjectCommands {\n constructor(private readonly createKernel: () => NextclawKernel) {}\n\n list = async (options: ProjectCommandOptions = {}): Promise<void> => {\n await this.withKernel(async (kernel) => {\n const projects = await kernel.projectManager.listProjects();\n if (options.json) {\n console.log(JSON.stringify({ projects, total: projects.length }, null, 2));\n return;\n }\n if (projects.length === 0) {\n console.log(\"No projects registered.\");\n return;\n }\n for (const project of projects) {\n console.log(`${project.name}\\t${project.template ?? \"existing\"}\\t${project.rootPath}`);\n }\n });\n };\n\n templates = async (options: ProjectCommandOptions = {}): Promise<void> => {\n await this.withKernel(async (kernel) => {\n const templates = kernel.projectManager.listTemplates();\n if (options.json) {\n console.log(JSON.stringify({ templates }, null, 2));\n return;\n }\n for (const template of templates) {\n console.log(`${template.id}\\t${template.description}`);\n }\n });\n };\n\n create = async (\n name: string,\n options: ProjectCreateCommandOptions = {},\n ): Promise<void> => {\n await this.withKernel(async (kernel) => {\n const input: CreateProjectInput = {\n name,\n ...(options.path ? { rootPath: options.path } : {}),\n ...(options.template ? { template: options.template } : {}),\n };\n const project = await kernel.projectManager.createProject(input);\n this.printCreatedProject(project, Boolean(options.json));\n });\n };\n\n private printCreatedProject = (project: ProjectRecord, json: boolean): void => {\n if (json) {\n console.log(JSON.stringify(project, null, 2));\n return;\n }\n console.log(`Created project \"${project.name}\" at ${project.rootPath}`);\n };\n\n private withKernel = async <T>(action: (kernel: NextclawKernel) => Promise<T>): Promise<T> => {\n const kernel = this.createKernel();\n try {\n return await action(kernel);\n } finally {\n await kernel.dispose();\n }\n };\n}\n"],"mappings":";AAeA,IAAa,kBAAb,MAA6B;CAC3B,YAAY,cAAqD;AAApC,OAAA,eAAA;;CAE7B,OAAO,OAAO,UAAiC,EAAE,KAAoB;AACnE,QAAM,KAAK,WAAW,OAAO,WAAW;GACtC,MAAM,WAAW,MAAM,OAAO,eAAe,cAAc;AAC3D,OAAI,QAAQ,MAAM;AAChB,YAAQ,IAAI,KAAK,UAAU;KAAE;KAAU,OAAO,SAAS;KAAQ,EAAE,MAAM,EAAE,CAAC;AAC1E;;AAEF,OAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,IAAI,0BAA0B;AACtC;;AAEF,QAAK,MAAM,WAAW,SACpB,SAAQ,IAAI,GAAG,QAAQ,KAAK,IAAI,QAAQ,YAAY,WAAW,IAAI,QAAQ,WAAW;IAExF;;CAGJ,YAAY,OAAO,UAAiC,EAAE,KAAoB;AACxE,QAAM,KAAK,WAAW,OAAO,WAAW;GACtC,MAAM,YAAY,OAAO,eAAe,eAAe;AACvD,OAAI,QAAQ,MAAM;AAChB,YAAQ,IAAI,KAAK,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACnD;;AAEF,QAAK,MAAM,YAAY,UACrB,SAAQ,IAAI,GAAG,SAAS,GAAG,IAAI,SAAS,cAAc;IAExD;;CAGJ,SAAS,OACP,MACA,UAAuC,EAAE,KACvB;AAClB,QAAM,KAAK,WAAW,OAAO,WAAW;GACtC,MAAM,QAA4B;IAChC;IACA,GAAI,QAAQ,OAAO,EAAE,UAAU,QAAQ,MAAM,GAAG,EAAE;IAClD,GAAI,QAAQ,WAAW,EAAE,UAAU,QAAQ,UAAU,GAAG,EAAE;IAC3D;GACD,MAAM,UAAU,MAAM,OAAO,eAAe,cAAc,MAAM;AAChE,QAAK,oBAAoB,SAAS,QAAQ,QAAQ,KAAK,CAAC;IACxD;;CAGJ,uBAA+B,SAAwB,SAAwB;AAC7E,MAAI,MAAM;AACR,WAAQ,IAAI,KAAK,UAAU,SAAS,MAAM,EAAE,CAAC;AAC7C;;AAEF,UAAQ,IAAI,oBAAoB,QAAQ,KAAK,OAAO,QAAQ,WAAW;;CAGzE,aAAqB,OAAU,WAA+D;EAC5F,MAAM,SAAS,KAAK,cAAc;AAClC,MAAI;AACF,UAAO,MAAM,OAAO,OAAO;YACnB;AACR,SAAM,OAAO,SAAS"}
1
+ {"version":3,"file":"project-command.controller.js","names":[],"sources":["../../../../src/controllers/commands/project/project-command.controller.ts"],"sourcesContent":["import type {\n CreateProjectInput,\n NextclawKernel,\n ProjectRecord,\n ProjectObservationSnapshot,\n} from \"@nextclaw/kernel\";\n\nexport type ProjectCommandOptions = {\n json?: boolean;\n};\n\nexport type ProjectCreateCommandOptions = ProjectCommandOptions & {\n path?: string;\n template?: \"empty\" | \"knowledge-base\";\n};\n\nexport class ProjectCommands {\n constructor(private readonly createKernel: () => NextclawKernel) {}\n\n list = async (options: ProjectCommandOptions = {}): Promise<void> => {\n await this.withKernel(async (kernel) => {\n const projects = await kernel.projectManager.listProjects();\n if (options.json) {\n console.log(JSON.stringify({ projects, total: projects.length }, null, 2));\n return;\n }\n if (projects.length === 0) {\n console.log(\"No projects registered.\");\n return;\n }\n for (const project of projects) {\n console.log(`${project.name}\\t${project.template ?? \"existing\"}\\t${project.rootPath}`);\n }\n });\n };\n\n templates = async (options: ProjectCommandOptions = {}): Promise<void> => {\n await this.withKernel(async (kernel) => {\n const templates = kernel.projectManager.listTemplates();\n if (options.json) {\n console.log(JSON.stringify({ templates }, null, 2));\n return;\n }\n for (const template of templates) {\n console.log(`${template.id}\\t${template.description}`);\n }\n });\n };\n\n create = async (\n name: string,\n options: ProjectCreateCommandOptions = {},\n ): Promise<void> => {\n await this.withKernel(async (kernel) => {\n const input: CreateProjectInput = {\n name,\n ...(options.path ? { rootPath: options.path } : {}),\n ...(options.template ? { template: options.template } : {}),\n };\n const project = await kernel.projectManager.createProject(input);\n this.printCreatedProject(project, Boolean(options.json));\n });\n };\n\n observe = async (rootPath: string, options: ProjectCommandOptions = {}): Promise<void> => {\n await this.withKernel(async (kernel) => {\n const snapshot = await kernel.projectObservation.observe(rootPath);\n if (options.json) {\n console.log(JSON.stringify(snapshot, null, 2));\n return;\n }\n this.printObservationSummary(snapshot);\n });\n };\n\n private printCreatedProject = (project: ProjectRecord, json: boolean): void => {\n if (json) {\n console.log(JSON.stringify(project, null, 2));\n return;\n }\n console.log(`Created project \"${project.name}\" at ${project.rootPath}`);\n };\n\n private printObservationSummary = (snapshot: ProjectObservationSnapshot): void => {\n console.log(`${snapshot.project.name}\\t${snapshot.dataQuality}\\t${snapshot.project.rootPath}`);\n console.log(`work-items: ${snapshot.workItems.length}, artifacts: ${snapshot.artifacts.length}, signals: ${snapshot.signals.length}, requests: ${snapshot.requests.length}`);\n };\n\n private withKernel = async <T>(action: (kernel: NextclawKernel) => Promise<T>): Promise<T> => {\n const kernel = this.createKernel();\n try {\n return await action(kernel);\n } finally {\n await kernel.dispose();\n }\n };\n}\n"],"mappings":";AAgBA,IAAa,kBAAb,MAA6B;CAC3B,YAAY,cAAqD;AAApC,OAAA,eAAA;;CAE7B,OAAO,OAAO,UAAiC,EAAE,KAAoB;AACnE,QAAM,KAAK,WAAW,OAAO,WAAW;GACtC,MAAM,WAAW,MAAM,OAAO,eAAe,cAAc;AAC3D,OAAI,QAAQ,MAAM;AAChB,YAAQ,IAAI,KAAK,UAAU;KAAE;KAAU,OAAO,SAAS;KAAQ,EAAE,MAAM,EAAE,CAAC;AAC1E;;AAEF,OAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,IAAI,0BAA0B;AACtC;;AAEF,QAAK,MAAM,WAAW,SACpB,SAAQ,IAAI,GAAG,QAAQ,KAAK,IAAI,QAAQ,YAAY,WAAW,IAAI,QAAQ,WAAW;IAExF;;CAGJ,YAAY,OAAO,UAAiC,EAAE,KAAoB;AACxE,QAAM,KAAK,WAAW,OAAO,WAAW;GACtC,MAAM,YAAY,OAAO,eAAe,eAAe;AACvD,OAAI,QAAQ,MAAM;AAChB,YAAQ,IAAI,KAAK,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACnD;;AAEF,QAAK,MAAM,YAAY,UACrB,SAAQ,IAAI,GAAG,SAAS,GAAG,IAAI,SAAS,cAAc;IAExD;;CAGJ,SAAS,OACP,MACA,UAAuC,EAAE,KACvB;AAClB,QAAM,KAAK,WAAW,OAAO,WAAW;GACtC,MAAM,QAA4B;IAChC;IACA,GAAI,QAAQ,OAAO,EAAE,UAAU,QAAQ,MAAM,GAAG,EAAE;IAClD,GAAI,QAAQ,WAAW,EAAE,UAAU,QAAQ,UAAU,GAAG,EAAE;IAC3D;GACD,MAAM,UAAU,MAAM,OAAO,eAAe,cAAc,MAAM;AAChE,QAAK,oBAAoB,SAAS,QAAQ,QAAQ,KAAK,CAAC;IACxD;;CAGJ,UAAU,OAAO,UAAkB,UAAiC,EAAE,KAAoB;AACxF,QAAM,KAAK,WAAW,OAAO,WAAW;GACtC,MAAM,WAAW,MAAM,OAAO,mBAAmB,QAAQ,SAAS;AAClE,OAAI,QAAQ,MAAM;AAChB,YAAQ,IAAI,KAAK,UAAU,UAAU,MAAM,EAAE,CAAC;AAC9C;;AAEF,QAAK,wBAAwB,SAAS;IACtC;;CAGJ,uBAA+B,SAAwB,SAAwB;AAC7E,MAAI,MAAM;AACR,WAAQ,IAAI,KAAK,UAAU,SAAS,MAAM,EAAE,CAAC;AAC7C;;AAEF,UAAQ,IAAI,oBAAoB,QAAQ,KAAK,OAAO,QAAQ,WAAW;;CAGzE,2BAAmC,aAA+C;AAChF,UAAQ,IAAI,GAAG,SAAS,QAAQ,KAAK,IAAI,SAAS,YAAY,IAAI,SAAS,QAAQ,WAAW;AAC9F,UAAQ,IAAI,eAAe,SAAS,UAAU,OAAO,eAAe,SAAS,UAAU,OAAO,aAAa,SAAS,QAAQ,OAAO,cAAc,SAAS,SAAS,SAAS;;CAG9K,aAAqB,OAAU,WAA+D;EAC5F,MAAM,SAAS,KAAK,cAAc;AAClC,MAAI;AACF,UAAO,MAAM,OAAO,OAAO;YACnB;AACR,SAAM,OAAO,SAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/service",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-beta.0",
4
4
  "private": false,
5
5
  "description": "NextClaw long-running service host and runtime lifecycle.",
6
6
  "type": "module",
@@ -42,31 +42,31 @@
42
42
  "chokidar": "^3.6.0",
43
43
  "commander": "^12.1.0",
44
44
  "jszip": "^3.10.1",
45
- "@nextclaw/channel-extension-dingtalk": "0.2.41",
46
- "@nextclaw/channel-extension-email": "0.2.41",
45
+ "@nextclaw/channel-extension-dingtalk": "0.2.42-beta.0",
46
+ "@nextclaw/channel-extension-email": "0.2.42-beta.0",
47
+ "@nextclaw/channel-extension-discord": "0.2.42-beta.0",
47
48
  "@nextclaw/channel-extension-feishu": "0.2.31",
48
- "@nextclaw/channel-extension-qq": "0.2.30",
49
- "@nextclaw/channel-extension-discord": "0.2.41",
50
- "@nextclaw/channel-extension-slack": "0.2.41",
51
- "@nextclaw/channel-extension-telegram": "0.2.41",
52
- "@nextclaw/channel-extension-wecom": "0.2.41",
49
+ "@nextclaw/channel-extension-telegram": "0.2.42-beta.0",
50
+ "@nextclaw/channel-extension-wecom": "0.2.42-beta.0",
53
51
  "@nextclaw/channel-extension-weixin": "0.2.31",
54
- "@nextclaw/channel-extension-whatsapp": "0.2.41",
55
- "@nextclaw/client-sdk": "0.10.0",
56
- "@nextclaw/core": "0.17.15",
57
- "@nextclaw/ncp": "0.10.0",
58
- "@nextclaw/mcp": "0.3.42",
59
- "@nextclaw/ncp-agent-runtime": "0.4.21",
60
- "@nextclaw/ncp-mcp": "0.2.42",
52
+ "@nextclaw/channel-extension-slack": "0.2.42-beta.0",
53
+ "@nextclaw/client-sdk": "0.11.0-beta.0",
54
+ "@nextclaw/channel-extension-whatsapp": "0.2.42-beta.0",
55
+ "@nextclaw/core": "0.17.16-beta.0",
56
+ "@nextclaw/kernel": "0.15.0-beta.0",
57
+ "@nextclaw/mcp": "0.3.43-beta.0",
61
58
  "@nextclaw/ncp-toolkit": "0.6.23",
62
- "@nextclaw/kernel": "0.14.0",
63
- "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.3.42",
64
- "@nextclaw/nextclaw-hermes-acp-bridge": "0.3.21",
65
- "@nextclaw/remote": "0.3.53",
59
+ "@nextclaw/ncp-mcp": "0.2.43-beta.0",
60
+ "@nextclaw/ncp-agent-runtime": "0.4.22-beta.0",
66
61
  "@nextclaw/nextclaw-ncp-runtime-http-client": "0.3.22",
67
- "@nextclaw/server": "0.21.0",
68
- "@nextclaw/runtime": "0.4.41",
69
- "@nextclaw/shared": "0.4.30"
62
+ "@nextclaw/remote": "0.3.54-beta.0",
63
+ "@nextclaw/runtime": "0.4.42-beta.0",
64
+ "@nextclaw/nextclaw-hermes-acp-bridge": "0.3.21",
65
+ "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.3.43-beta.0",
66
+ "@nextclaw/shared": "0.4.30",
67
+ "@nextclaw/server": "0.22.0-beta.0",
68
+ "@nextclaw/ncp": "0.10.0",
69
+ "@nextclaw/channel-extension-qq": "0.2.30"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/node": "^20.17.6",