@nexgen-os/mcp 0.5.1 → 0.6.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.
package/README.md CHANGED
@@ -171,6 +171,7 @@ client can ask before calling them.
171
171
  | `add_participant` | A participant joins a project with its place (`join_project()`), given as a point or found through the configured geocoder chain |
172
172
  | `declare_meter` | A meter by its identifier in a scheme, which checks it (`declare_meter()`) |
173
173
  | `install_device` | A device, from a product of the catalogue or with a stated power (`install_device()`) |
174
+ | `set_device_status` | Where a device stands through the works, on the day it happened: `installed`, `in_service`, `out_of_service` (`set_device_status()`) |
174
175
  | `import_project` | A project described as data — participants, meters, devices, identifiers — through the same functions (`importProject()`); given again, it creates only what is new; `dry_run` writes nothing |
175
176
  | `import_project_sheet` | A project sheet ([`@nexgen-os/project-sheet`](../formats/project-sheet/README.md)), as the text of the CSV a spreadsheet saves (`sheet`) or as its `.xlsx` workbook in base64 (`workbook`, the worksheet named by `worksheet`, the first otherwise), each of its projects imported as `import_project` does (`importProjectSheet()`); a sheet with a cell it cannot read is refused whole, `sheet_unreadable`, each problem with its line |
176
177
  | `store_series` | Values through `store()`, each dated at the start of its interval, with their source |
package/dist/server.d.ts CHANGED
@@ -12,7 +12,7 @@ import { type Computations, type Geocoder, type Session } from '@nexgen-os/core'
12
12
  import type { Tool } from './tools/tool.js';
13
13
  export declare const SERVER_NAME = "@nexgen-os/mcp";
14
14
  /** Repeated from `package.json`, so that a bundle without a manifest still says what it is; a test keeps them equal. */
15
- export declare const SERVER_VERSION = "0.5.1";
15
+ export declare const SERVER_VERSION = "0.6.0";
16
16
  export declare const INSTRUCTIONS: string;
17
17
  export interface ServerOptions {
18
18
  /** The modules installed on the database; their tools are offered. None: the core's tools only. */
package/dist/server.js CHANGED
@@ -15,7 +15,7 @@ import { MODULE_TOOLS, moduleToolsFor } from './tools/modules.js';
15
15
  import { WRITE_TOOLS } from './tools/write.js';
16
16
  export const SERVER_NAME = '@nexgen-os/mcp';
17
17
  /** Repeated from `package.json`, so that a bundle without a manifest still says what it is; a test keeps them equal. */
18
- export const SERVER_VERSION = '0.5.1';
18
+ export const SERVER_VERSION = '0.6.0';
19
19
  export const INSTRUCTIONS = [
20
20
  'Nexgen OS is a world model for energy assets in the person\'s own Postgres: organisations, projects, participants, their meters, devices and series. You act as that person: what you see and change is what row level security lets them see and change. There is no agent role and no back door. Dates are ISO, identifiers uuids, a value is dated at the start of its interval, an azimuth in degrees clockwise from true north.',
21
21
  'A first session. (1) status, then list_organisations and list_projects: everything belongs to an organisation. (2) list_participants: a participant without a time zone has no daily readings; say so. (3) Describe with a source: add_participant with its place, declare_meter, install_device, solar_describe_system, store_series or import_series. (4) Compute as a module does: solar_estimate_yield, solar_size, battery_size and charging_size with a criterion the person chose, community_settle, kpis_compute; read back with read_series, solar_estimates, kpis_of. (5) Show what you attached and what the estimate read, then propose with actions_propose; the person validates.',
@@ -16,6 +16,8 @@ const engineName = z.string().regex(/^[a-z0-9_-]+$/)
16
16
  const economics = z.object({
17
17
  offtakePricePerKwh: z.number(), injectionPricePerKwh: z.number(), costPerKwp: z.number(),
18
18
  horizonYears: z.number().int().positive(), discountRate: z.number(), currency: z.string().length(3),
19
+ degradationPctPerYear: z.number().min(0).max(5).optional()
20
+ .describe('The yearly loss of output from ageing, in percent a year (0.5 for 0.5 %/year), as the person or the datasheet states it; omitted, no ageing is counted and the sizing says so'),
19
21
  }).describe('The money of the person, in the currency of the place. Never assumed');
20
22
  export const MODULE_TOOLS = [
21
23
  // ------------------------------------------------------------------- kpis
@@ -71,6 +71,14 @@ export const WRITE_TOOLS = [
71
71
  writes: true,
72
72
  run: ({ db }, a) => core.installDevice(db, a),
73
73
  }),
74
+ tool({
75
+ name: 'set_device_status',
76
+ title: 'Move a device through the works',
77
+ description: 'Where a device stands, moved on a day by a named transition (set_device_status()): planned to installed or in_service, the day becoming its installation date; installed to in_service, or out_of_service when it failed its commissioning; in_service to out_of_service and back. Only on a day that has come, and only what the person says happened: what was done to get there (the commissioning test, its report, the photos) is a step of the commissioning phase and the documents of the device. Removing a device is not this tool. Refuses device_status_invalid, device_day_invalid, device_retired, not_allowed.',
78
+ input: z.object({ device_id: uuid, status: z.enum(['installed', 'in_service', 'out_of_service']), on: date.optional().describe('The day it happened; today otherwise') }),
79
+ writes: true,
80
+ run: ({ db }, a) => core.setDeviceStatus(db, a),
81
+ }),
74
82
  tool({
75
83
  name: 'import_project',
76
84
  title: 'Import a project described as data',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexgen-os/mcp",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "MCP server for Nexgen OS: let an AI agent describe, equip and study energy assets, as the person who asked it, under row level security.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@modelcontextprotocol/sdk": "1.31.0",
50
- "@nexgen-os/core": "^0.5.0",
50
+ "@nexgen-os/core": "^0.6.0",
51
51
  "zod": "4.6.2",
52
52
  "pg": "^8.23.1"
53
53
  }