@uns-kit/cli 2.0.51 → 2.0.52

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.
@@ -64,6 +64,11 @@ export function generateAgentsMarkdown(bundle) {
64
64
  ["Template", bundle.scaffold.template],
65
65
  ]),
66
66
  "",
67
+ "## Bundle Source",
68
+ "",
69
+ "- Read `service.bundle.json` first when planning or generating service-specific code; it is the project source of truth.",
70
+ "- Keep `SERVICE_SPEC.md` and this file aligned with `service.bundle.json` when the bundle changes.",
71
+ "",
67
72
  "## Project Context",
68
73
  ...renderStringList(bundle.docs.agents.projectContext),
69
74
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uns-kit/cli",
3
- "version": "2.0.51",
3
+ "version": "2.0.52",
4
4
  "description": "Command line scaffolding tool for UNS applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,13 +26,13 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "azure-devops-node-api": "^15.1.1",
29
- "@uns-kit/core": "2.0.51"
29
+ "@uns-kit/core": "2.0.52"
30
30
  },
31
31
  "unsKitPackages": {
32
- "@uns-kit/core": "2.0.51",
33
- "@uns-kit/api": "2.0.51",
34
- "@uns-kit/cron": "2.0.51",
35
- "@uns-kit/database": "2.0.51"
32
+ "@uns-kit/core": "2.0.52",
33
+ "@uns-kit/api": "2.0.52",
34
+ "@uns-kit/cron": "2.0.52",
35
+ "@uns-kit/database": "2.0.52"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsc -p tsconfig.build.json",
@@ -19,13 +19,13 @@
19
19
  "password": "secret"
20
20
  },
21
21
  "infra": {
22
- "host": "localhost:1883"
22
+ "host": "localhost"
23
23
  },
24
24
  "output": {
25
- "host": "localhost:1883"
25
+ "host": "localhost"
26
26
  },
27
27
  "input": {
28
- "host": "localhost:1883"
28
+ "host": "localhost"
29
29
  },
30
30
  "devops": {
31
31
  "provider": "azure-devops",
@@ -1,14 +1,23 @@
1
- import { UnsProxyProcess } from "@uns-kit/core";
1
+ import { ConfigFile, UnsProxyProcess } from "@uns-kit/core";
2
+ import type { ISO8601 } from "@uns-kit/core/uns/uns-interfaces.js";
2
3
 
3
4
  async function main(): Promise<void> {
4
- const name = "__APP_NAME__";
5
- const process = new UnsProxyProcess("localhost:1883", {
6
- processName: name,
5
+ const config = await ConfigFile.loadConfig();
6
+ const processName = config.uns.processName ?? "__APP_NAME__";
7
+ const unsProcess = new UnsProxyProcess(config.infra.host ?? "localhost", {
8
+ processName,
7
9
  });
8
10
 
9
- const proxy = await process.createMqttProxy("ts-output");
11
+ const mqttOutput = await unsProcess.createUnsMqttProxy(
12
+ config.output?.host ?? "localhost",
13
+ "defaultOutput",
14
+ config.uns.instanceMode ?? "wait",
15
+ config.uns.handover ?? true,
16
+ );
10
17
 
11
- await proxy.publishMqttMessage({
18
+ const time = new Date().toISOString() as ISO8601;
19
+
20
+ await mqttOutput.publishMqttMessage({
12
21
  topic: "example/site/area/line/",
13
22
  asset: "demo-asset",
14
23
  objectType: "utility-resource",
@@ -17,9 +26,8 @@ async function main(): Promise<void> {
17
26
  attribute: "status",
18
27
  description: "Service startup marker",
19
28
  data: {
20
- time: new Date().toISOString(),
29
+ time,
21
30
  value: "started",
22
- uom: "state",
23
31
  dataGroup: "runtime",
24
32
  },
25
33
  validityMode: "lifecycle",
@@ -27,7 +35,7 @@ async function main(): Promise<void> {
27
35
  },
28
36
  });
29
37
 
30
- console.log(`UNS process '${name}' is ready. Edit src/index.ts to add your logic.`);
38
+ console.log(`UNS process '${processName}' is ready. Edit src/index.ts to add your logic.`);
31
39
  }
32
40
 
33
41
  void main();