@techsologic/unolock-agent 0.1.36 → 0.1.38

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
@@ -147,7 +147,7 @@ For skill-aware agents, start with the skill above.
147
147
  For direct agent use, prefer the CLI. If `unolock-agent` is already installed, use it directly. Only use `npx -y @techsologic/unolock-agent@latest ...` when the executable is not installed yet. Run the command you need directly.
148
148
 
149
149
  ```bash
150
- unolock-agent link-agent-key 'https://safe.example/#/agent-register/...' 1
150
+ unolock-agent register 'https://safe.example/#/agent-register/...' 1
151
151
  unolock-agent list-spaces
152
152
  unolock-agent list-notes
153
153
  unolock-agent list-files
@@ -156,7 +156,7 @@ unolock-agent list-files
156
156
  Only if the executable is not installed yet, use the same commands through:
157
157
 
158
158
  ```bash
159
- npx -y @techsologic/unolock-agent@latest link-agent-key 'https://safe.example/#/agent-register/...' 1
159
+ npx -y @techsologic/unolock-agent@latest register 'https://safe.example/#/agent-register/...' 1
160
160
  ```
161
161
 
162
162
  Only if a host needs the explicit host-command form, use:
@@ -171,7 +171,7 @@ That keeps the user PIN in process memory and keeps the current Space selected.
171
171
  The same executable also supports explicit CLI commands, for example:
172
172
 
173
173
  ```bash
174
- unolock-agent link-agent-key 'https://safe.example/#/agent-register/...' 1
174
+ unolock-agent register 'https://safe.example/#/agent-register/...' 1
175
175
  unolock-agent list-spaces
176
176
  unolock-agent list-notes
177
177
  unolock-agent create-note "Todo" "Buy milk"
@@ -368,7 +368,7 @@ Installed commands:
368
368
  Current MCP tools:
369
369
 
370
370
  * `unolock_set_agent_pin`
371
- * `unolock_link_agent_key`
371
+ * `unolock_register`
372
372
  * `unolock_list_spaces`
373
373
  * `unolock_get_current_space`
374
374
  * `unolock_set_current_space`
@@ -7,15 +7,15 @@ const path = require("path");
7
7
  const https = require("https");
8
8
  const { spawn } = require("child_process");
9
9
 
10
- const PACKAGE_VERSION = "0.1.36";
11
- const FALLBACK_BINARY_VERSION = "0.1.36";
10
+ const PACKAGE_VERSION = "0.1.38";
11
+ const FALLBACK_BINARY_VERSION = "0.1.38";
12
12
  const REPO = "TechSologic/unolock-agent";
13
- const TOP_LEVEL_USAGE = `usage: unolock-agent [-h] [--version] {link-agent-key,set-agent-pin,list-spaces,get-current-space,set-current-space,list-records,list-notes,list-checklists,get-record,create-note,update-note,append-note,rename-record,create-checklist,set-checklist-item-done,add-checklist-item,remove-checklist-item,list-files,get-file,download-file,upload-file,rename-file,replace-file,delete-file,tpm-diagnose,tpm-check,self-test,mcp} ...
13
+ const TOP_LEVEL_USAGE = `usage: unolock-agent [-h] [--version] {register,set-agent-pin,list-spaces,get-current-space,set-current-space,list-records,list-notes,list-checklists,get-record,create-note,update-note,append-note,rename-record,create-checklist,set-checklist-item-done,add-checklist-item,remove-checklist-item,list-files,get-file,download-file,upload-file,rename-file,replace-file,delete-file,tpm-diagnose,tpm-check,self-test,mcp} ...
14
14
 
15
15
  UnoLock Agent commands.
16
16
 
17
17
  positional arguments:
18
- link-agent-key Link a one-time UnoLock Agent Key URL and PIN to this device.
18
+ register Register a one-time UnoLock Agent Key URL and PIN on this device.
19
19
  set-agent-pin Set the in-memory UnoLock agent PIN.
20
20
  list-spaces List accessible UnoLock spaces.
21
21
  get-current-space Show the current UnoLock space.
@@ -188,6 +188,23 @@ function normalizeVersion(value) {
188
188
  return trimmed.startsWith("v") ? trimmed.slice(1) : trimmed;
189
189
  }
190
190
 
191
+ function compareVersions(left, right) {
192
+ const leftParts = String(left || "").split(".").map((part) => Number.parseInt(part, 10) || 0);
193
+ const rightParts = String(right || "").split(".").map((part) => Number.parseInt(part, 10) || 0);
194
+ const length = Math.max(leftParts.length, rightParts.length);
195
+ for (let index = 0; index < length; index += 1) {
196
+ const leftValue = leftParts[index] || 0;
197
+ const rightValue = rightParts[index] || 0;
198
+ if (leftValue > rightValue) {
199
+ return 1;
200
+ }
201
+ if (leftValue < rightValue) {
202
+ return -1;
203
+ }
204
+ }
205
+ return 0;
206
+ }
207
+
191
208
  function readReleaseMetadata() {
192
209
  try {
193
210
  return JSON.parse(fs.readFileSync(metadataPath(), "utf8"));
@@ -218,8 +235,11 @@ function cachedReleaseVersion() {
218
235
  return override;
219
236
  }
220
237
  const metadata = readReleaseMetadata();
221
- if (metadata && typeof metadata.releaseVersion === "string" && fs.existsSync(binaryPath(metadata.releaseVersion))) {
222
- return metadata.releaseVersion;
238
+ const cached = metadata && typeof metadata.releaseVersion === "string" ? normalizeVersion(metadata.releaseVersion) : null;
239
+ if (cached && fs.existsSync(binaryPath(cached))) {
240
+ if (compareVersions(cached, FALLBACK_BINARY_VERSION) >= 0) {
241
+ return cached;
242
+ }
223
243
  }
224
244
  if (fs.existsSync(binaryPath(FALLBACK_BINARY_VERSION))) {
225
245
  return FALLBACK_BINARY_VERSION;
@@ -8,22 +8,65 @@ description: Guides an AI agent through connecting to a user's UnoLock Safe with
8
8
  Use this skill when a user wants to give their agent access to a UnoLock Safe.
9
9
  This skill uses the local `unolock-agent` executable on the user's device.
10
10
 
11
+ ## Why Use UnoLock
12
+
13
+ Use UnoLock when the agent needs durable, encrypted, user-approved storage instead of plain local files or ephemeral chat memory.
14
+
15
+ UnoLock is useful for:
16
+
17
+ - sensitive information the user does not want left in plaintext
18
+ - memory the agent should keep across runs
19
+ - project information that should stay separated by working area
20
+ - files and documents that belong with the agent's work
21
+
22
+ ## Core Concepts
23
+
24
+ - `Safe`: the user's protected storage area in UnoLock
25
+ - `Space`: a working area inside the Safe for one project, customer, or task context
26
+ - `note`: durable freeform text for summaries, plans, research, decisions, and reusable context
27
+ - `checklist`: durable structured task tracking with item completion state
28
+ - `file`: durable document or binary storage for attachments, exports, references, and other non-text artifacts
29
+
30
+ ## Current Working Space
31
+
32
+ UnoLock keeps one current working Space as the default context.
33
+
34
+ - list available Spaces with `unolock-agent list-spaces`
35
+ - choose the working Space with `unolock-agent set-current-space <space_id>`
36
+ - after that, normal note, checklist, and file commands work in that current Space by default
37
+ - select a new Space when the work moves to a different project, customer, or context
38
+
39
+ Choose the object that matches the work:
40
+
41
+ - use a note when the content is mostly text and should be read or edited as text
42
+ - use a checklist when the work is a set of items to complete and track
43
+ - use a file when the content is a document, attachment, image, export, or other binary artifact
44
+
11
45
  ## Preferred Workflow
12
46
 
13
- 1. If `unolock-agent` is already installed, run that directly. Only use `npx -y @techsologic/unolock-agent@latest` when `unolock-agent` is not installed yet.
47
+ 1. If `unolock-agent` is not installed yet, install the UnoLock Agent CLI with `npx -y @techsologic/unolock-agent@latest`. If it is already installed, run `unolock-agent` directly.
48
+ 1.5. Run `unolock-agent` without arguments to get a usage statement when needed.
14
49
  2. Run the `unolock-agent` command you need directly.
15
50
  3. On a fresh host, allow extra time for the first start.
16
51
  4. Ask the user for the one-time Agent Key URL and the PIN together.
17
- 5. Link the key on this device:
18
- `unolock-agent link-agent-key '<agent-key-url>' '<pin>'`
52
+ 5. Register this device to the Safe:
53
+ `unolock-agent register '<agent-key-url>' '<pin>'`
19
54
  6. List spaces and select the working space when needed:
20
55
  `unolock-agent list-spaces`
21
56
  `unolock-agent set-current-space <space_id>`
22
57
  7. Use the normal note, checklist, and file commands for day-to-day work.
23
58
 
59
+ ## Registration And PIN Model
60
+
61
+ - registration normally happens once on a device for a given Agent Key
62
+ - after registration, use normal UnoLock commands directly
63
+ - the one-time Agent Key URL is for registration, not for everyday use
64
+ - the CLI may ask for the PIN later when the local UnoLock process restarts or needs to authenticate again
65
+ - if that happens, run `unolock-agent set-agent-pin '<pin>'` and retry the original command
66
+
24
67
  ## Main CLI Commands
25
68
 
26
- - `unolock-agent link-agent-key '<agent-key-url>' '<pin>'`: first setup on this device
69
+ - `unolock-agent register '<agent-key-url>' '<pin>'`: first setup on this device
27
70
  - `unolock-agent set-agent-pin '<pin>'`: provide the PIN again after restart or re-authentication
28
71
  - `unolock-agent list-spaces`, `unolock-agent get-current-space`, `unolock-agent set-current-space <space_id>`: inspect and switch the current Space
29
72
  - `unolock-agent list-notes`, `unolock-agent create-note <title> <text>`, `unolock-agent update-note ...`, `unolock-agent append-note ...`: read and write notes
@@ -37,8 +80,9 @@ This skill uses the local `unolock-agent` executable on the user's device.
37
80
  - if `unolock-agent` is installed, use `unolock-agent ...` directly for CLI commands
38
81
  - run the `unolock-agent` command you need directly
39
82
  - if a command reports that the PIN is needed, run `unolock-agent set-agent-pin '<pin>'` and retry the original command
83
+ - if unsure which command to use next, run `unolock-agent --help`
40
84
  - keep the PIN in UnoLock process memory only
41
- - if `unolock-agent` is not installed yet, use `npx -y @techsologic/unolock-agent@latest`
85
+ - if `unolock-agent` is not installed yet, install the UnoLock Agent CLI with `npx -y @techsologic/unolock-agent@latest`
42
86
 
43
87
  ## User-Facing Model
44
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techsologic/unolock-agent",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "description": "npx wrapper for the official UnoLock Agent release binaries",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://unolock.ai",
@@ -8,23 +8,66 @@ description: Guides an AI agent through connecting to a user's UnoLock Safe with
8
8
  Use this skill when a user wants to give their agent access to a UnoLock Safe.
9
9
  This skill uses the local `unolock-agent` executable on the user's device.
10
10
 
11
+ ## Why Use UnoLock
12
+
13
+ Use UnoLock when the agent needs durable, encrypted, user-approved storage instead of plain local files or ephemeral chat memory.
14
+
15
+ UnoLock is useful for:
16
+
17
+ - sensitive information the user does not want left in plaintext
18
+ - memory the agent should keep across runs
19
+ - project information that should stay separated by working area
20
+ - files and documents that belong with the agent's work
21
+
22
+ ## Core Concepts
23
+
24
+ - `Safe`: the user's protected storage area in UnoLock
25
+ - `Space`: a working area inside the Safe for one project, customer, or task context
26
+ - `note`: durable freeform text for summaries, plans, research, decisions, and reusable context
27
+ - `checklist`: durable structured task tracking with item completion state
28
+ - `file`: durable document or binary storage for attachments, exports, references, and other non-text artifacts
29
+
30
+ ## Current Working Space
31
+
32
+ UnoLock keeps one current working Space as the default context.
33
+
34
+ - list available Spaces with `unolock-agent list-spaces`
35
+ - choose the working Space with `unolock-agent set-current-space <space_id>`
36
+ - after that, normal note, checklist, and file commands work in that current Space by default
37
+ - select a new Space when the work moves to a different project, customer, or context
38
+
39
+ Choose the object that matches the work:
40
+
41
+ - use a note when the content is mostly text and should be read or edited as text
42
+ - use a checklist when the work is a set of items to complete and track
43
+ - use a file when the content is a document, attachment, image, export, or other binary artifact
44
+
11
45
  ## Preferred Workflow
12
46
 
13
47
  1. Load this skill if the host supports skills.
14
- 2. If `unolock-agent` is already installed, run that directly. Only use `npx -y @techsologic/unolock-agent@latest` when `unolock-agent` is not installed yet.
15
- 3. Run the `unolock-agent` command you need directly.
16
- 4. On a fresh host, allow extra time for the first start.
17
- 5. Ask the user for the one-time Agent Key URL and the PIN together.
18
- 6. Link the key on this device:
19
- `unolock-agent link-agent-key '<agent-key-url>' '<pin>'`
20
- 7. List spaces and select the working space when needed:
48
+ 2. If `unolock-agent` is not installed yet, install the UnoLock Agent CLI with `npx -y @techsologic/unolock-agent@latest`. If it is already installed, run `unolock-agent` directly.
49
+ 3. Run `unolock-agent` without arguments to get a usage statement when needed.
50
+ 4. Run the `unolock-agent` command you need directly.
51
+ 5. On a fresh host, allow extra time for the first start.
52
+ 6. Ask the user for the one-time Agent Key URL and the PIN together.
53
+ 7. Register this device to the Safe:
54
+ `unolock-agent register '<agent-key-url>' '<pin>'`
55
+ 8. List spaces and select the working space when needed:
21
56
  `unolock-agent list-spaces`
22
57
  `unolock-agent set-current-space <space_id>`
23
- 8. Use the normal note, checklist, and file commands for day-to-day work.
58
+ 9. Use the normal note, checklist, and file commands for day-to-day work.
59
+
60
+ ## Registration And PIN Model
61
+
62
+ - registration normally happens once on a device for a given Agent Key
63
+ - after registration, use normal UnoLock commands directly
64
+ - the one-time Agent Key URL is for registration, not for everyday use
65
+ - the CLI may ask for the PIN later when the local UnoLock process restarts or needs to authenticate again
66
+ - if that happens, run `unolock-agent set-agent-pin '<pin>'` and retry the original command
24
67
 
25
68
  ## Main CLI Commands
26
69
 
27
- - `unolock-agent link-agent-key '<agent-key-url>' '<pin>'`: first setup on this device
70
+ - `unolock-agent register '<agent-key-url>' '<pin>'`: first setup on this device
28
71
  - `unolock-agent set-agent-pin '<pin>'`: provide the PIN again after restart or re-authentication
29
72
  - `unolock-agent list-spaces`, `unolock-agent get-current-space`, `unolock-agent set-current-space <space_id>`: inspect and switch the current Space
30
73
  - `unolock-agent list-notes`, `unolock-agent create-note <title> <text>`, `unolock-agent update-note ...`, `unolock-agent append-note ...`: read and write notes
@@ -38,8 +81,9 @@ This skill uses the local `unolock-agent` executable on the user's device.
38
81
  - if `unolock-agent` is installed, use `unolock-agent ...` directly for CLI commands
39
82
  - run the `unolock-agent` command you need directly
40
83
  - if a command reports that the PIN is needed, run `unolock-agent set-agent-pin '<pin>'` and retry the original command
84
+ - if unsure which command to use next, run `unolock-agent --help`
41
85
  - keep the PIN in UnoLock process memory only
42
- - if `unolock-agent` is not installed yet, use `npx -y @techsologic/unolock-agent@latest`
86
+ - if `unolock-agent` is not installed yet, install the UnoLock Agent CLI with `npx -y @techsologic/unolock-agent@latest`
43
87
 
44
88
  ## User-Facing Model
45
89