n8n-nodes-lifespace 0.1.24 → 0.2.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 +114 -40
- package/dist/credentials/LifeSpaceAgentExecutionApi.credentials.js +11 -29
- package/dist/credentials/LifeSpaceAgentExecutionApi.credentials.js.map +1 -1
- package/dist/credentials/LifeSpaceApi.credentials.js +4 -4
- package/dist/credentials/LifeSpaceApi.credentials.js.map +1 -1
- package/dist/credentials/LifeSpaceWebhookApi.credentials.js +1 -1
- package/dist/credentials/LifeSpaceWebhookApi.credentials.js.map +1 -1
- package/dist/nodes/LifeSpace/LifeSpace.node.js +181 -19
- package/dist/nodes/LifeSpace/LifeSpace.node.js.map +1 -1
- package/dist/nodes/LifeSpaceAgentTool/LifeSpaceAgentTool.node.js +218 -2
- package/dist/nodes/LifeSpaceAgentTool/LifeSpaceAgentTool.node.js.map +1 -1
- package/dist/nodes/LifeSpaceCancelAuthorization/LifeSpaceCancelAuthorization.node.d.ts +6 -0
- package/dist/nodes/LifeSpaceCancelAuthorization/LifeSpaceCancelAuthorization.node.js +53 -0
- package/dist/nodes/LifeSpaceCancelAuthorization/LifeSpaceCancelAuthorization.node.js.map +1 -0
- package/dist/nodes/LifeSpaceCancelAuthorizationTool/LifeSpaceCancelAuthorizationTool.node.d.ts +5 -0
- package/dist/nodes/LifeSpaceCancelAuthorizationTool/LifeSpaceCancelAuthorizationTool.node.js +67 -0
- package/dist/nodes/LifeSpaceCancelAuthorizationTool/LifeSpaceCancelAuthorizationTool.node.js.map +1 -0
- package/dist/nodes/LifeSpaceConfirmAuthorization/LifeSpaceConfirmAuthorization.node.d.ts +6 -0
- package/dist/nodes/LifeSpaceConfirmAuthorization/LifeSpaceConfirmAuthorization.node.js +73 -0
- package/dist/nodes/LifeSpaceConfirmAuthorization/LifeSpaceConfirmAuthorization.node.js.map +1 -0
- package/dist/nodes/LifeSpaceConfirmAuthorizationTool/LifeSpaceConfirmAuthorizationTool.node.d.ts +5 -0
- package/dist/nodes/LifeSpaceConfirmAuthorizationTool/LifeSpaceConfirmAuthorizationTool.node.js +68 -0
- package/dist/nodes/LifeSpaceConfirmAuthorizationTool/LifeSpaceConfirmAuthorizationTool.node.js.map +1 -0
- package/dist/nodes/LifeSpaceDelegation/LifeSpaceDelegation.node.d.ts +6 -0
- package/dist/nodes/LifeSpaceDelegation/LifeSpaceDelegation.node.js +264 -0
- package/dist/nodes/LifeSpaceDelegation/LifeSpaceDelegation.node.js.map +1 -0
- package/dist/nodes/LifeSpaceDelegation/lifespace.dark.svg +14 -0
- package/dist/nodes/LifeSpaceDelegation/lifespace.svg +14 -0
- package/dist/nodes/LifeSpaceDenyAuthorization/LifeSpaceDenyAuthorization.node.d.ts +6 -0
- package/dist/nodes/LifeSpaceDenyAuthorization/LifeSpaceDenyAuthorization.node.js +56 -0
- package/dist/nodes/LifeSpaceDenyAuthorization/LifeSpaceDenyAuthorization.node.js.map +1 -0
- package/dist/nodes/LifeSpaceRequestAuthorization/LifeSpaceRequestAuthorization.node.d.ts +5 -0
- package/dist/nodes/LifeSpaceRequestAuthorization/LifeSpaceRequestAuthorization.node.js +122 -0
- package/dist/nodes/LifeSpaceRequestAuthorization/LifeSpaceRequestAuthorization.node.js.map +1 -0
- package/dist/nodes/LifeSpaceTool/LifeSpaceTool.node.js +1 -1
- package/dist/nodes/LifeSpaceTool/LifeSpaceTool.node.js.map +1 -1
- package/dist/nodes/LifeSpaceWorkflow/LifeSpaceWorkflow.node.js +38 -3
- package/dist/nodes/LifeSpaceWorkflow/LifeSpaceWorkflow.node.js.map +1 -1
- package/dist/nodes/authorization/lifeSpaceAuthorizationRequest.d.ts +20 -0
- package/dist/nodes/authorization/lifeSpaceAuthorizationRequest.js +88 -0
- package/dist/nodes/authorization/lifeSpaceAuthorizationRequest.js.map +1 -0
- package/dist/nodes/shared/lifeSpaceExecutionAuthority.d.ts +1 -4
- package/dist/nodes/shared/lifeSpaceExecutionAuthority.js +14 -45
- package/dist/nodes/shared/lifeSpaceExecutionAuthority.js.map +1 -1
- package/dist/package.json +56 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +56 -12
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ You must be an n8n instance Owner or Admin.
|
|
|
29
29
|
To pin a release, use for example:
|
|
30
30
|
|
|
31
31
|
```text
|
|
32
|
-
n8n-nodes-lifespace@0.1.
|
|
32
|
+
n8n-nodes-lifespace@0.1.25
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Self-hosted n8n: manual npm installation
|
|
@@ -44,26 +44,53 @@ Restart n8n afterwards. In queue mode, install the package anywhere that may exe
|
|
|
44
44
|
|
|
45
45
|
## Quick start
|
|
46
46
|
|
|
47
|
-
LifeSpace
|
|
47
|
+
LifeSpace exposes separate Service, Agent, and Webhook-signing credentials in n8n.
|
|
48
48
|
|
|
49
|
-
For
|
|
49
|
+
For ordinary owner-controlled automation, create a **LifeSpace Service API** credential containing:
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
- **API Base URL** — the LifeSpace Core API root;
|
|
52
|
+
- **Service API Token** — an opaque `lsp_svc_*` token.
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
- **Identity API Base URL**;
|
|
55
|
-
- the server-only Application credential `lsa_*`;
|
|
56
|
-
- the registered LifeSpace `agt_*` Agent ID.
|
|
54
|
+
This is the normal scheduled/system workflow mode where `Principal = Actor = Service`. Existing `lsp_pat_*` tokens remain accepted by LifeSpace only as migration credentials until they are rotated or revoked.
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
For AI Agent execution, create a **LifeSpace Agent API** credential containing only:
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
- **API Base URL** — the LifeSpace Core API root;
|
|
59
|
+
- **Agent API Credential** — an opaque `lsp_agt_*` credential.
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
The adapter no longer asks for an Identity API URL, an `lsa_*` Application credential, or a separate `agt_*` Agent ID. The `lsp_agt_*` credential already authenticates the current Application + Agent Actor to Core.
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
Agent execution has two authority profiles:
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
```text
|
|
66
|
+
Direct Agent
|
|
67
|
+
lsp_agt_* -> Principal=Agent / Actor=Agent
|
|
68
|
+
-> uses only the Agent's own current Data Grant / model authority
|
|
69
|
+
|
|
70
|
+
User Delegation
|
|
71
|
+
lsp_agt_* + explicit dlg_*
|
|
72
|
+
-> Principal=User / Actor=Agent
|
|
73
|
+
-> Core resolves and rechecks the current Delegation chain
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
An Agent API credential never grants User authority by itself. When a LifeSpace Agent Tool lacks sufficient direct Agent authority, it returns a structured `authorizationRequired` scope. **LifeSpace Request Authorization** can create or reuse a pending `arq_*` request from that exact scope. Confirming the request issues the required independent `dlg_*` Delegation(s) atomically after current User authority is rechecked.
|
|
77
|
+
|
|
78
|
+
The authorization node surface is:
|
|
79
|
+
|
|
80
|
+
- **LifeSpace Request Authorization** — AI Tool; creates/reuses a pending request but grants no authority;
|
|
81
|
+
- **LifeSpace Confirm Authorization** — workflow node;
|
|
82
|
+
- **LifeSpace Confirm Authorization Tool** — AI Tool for Human Review flows;
|
|
83
|
+
- **LifeSpace Deny Authorization** — workflow node for an explicit user rejection;
|
|
84
|
+
- **LifeSpace Cancel Authorization** — workflow node;
|
|
85
|
+
- **LifeSpace Cancel Authorization Tool** — AI Tool when the Agent no longer needs the request.
|
|
86
|
+
|
|
87
|
+
The trusted `Principal User ID` on Request Authorization is workflow configuration and is never exposed as an AI Tool argument. Runtime represented execution uses the explicit `dlg_*`; the adapter does not send an arbitrary `principalUserId` to Core.
|
|
88
|
+
|
|
89
|
+
Credentials are secrets. Store them only in n8n credentials; do not put `lsp_svc_*`, legacy `lsp_pat_*`, `lsp_agt_*`, `lsa_*`, Agent JWTs, or signing secrets in workflow fields, URLs, source files, or workflow exports.
|
|
90
|
+
|
|
91
|
+
A **LifeSpace Trigger** additionally uses a **LifeSpace Webhook Signing** credential containing the endpoint-scoped HMAC signing secret. This is deliberately separate from the Service API credential: the Service API Token authenticates outbound n8n → LifeSpace API calls and Runtime Discovery, while the signing secret verifies inbound LifeSpace → n8n deliveries and rotates with its Webhook Endpoint.
|
|
92
|
+
|
|
93
|
+
Runtime Discovery determines which Spaces, Record Types, fields, queries, Actions, and relation lookup capabilities the current execution context can use. Human workflow nodes use the Service API credential. Agent nodes use the Agent API credential. Execution authorization is always enforced by LifeSpace from verified Application / Principal / Actor context, credential scope, Application × Model Access, current Space/Data Grant authority, published model semantics, and the explicitly selected Delegation when represented User authority is used.
|
|
67
94
|
|
|
68
95
|
## Generated Record UX
|
|
69
96
|
|
|
@@ -80,8 +107,6 @@ Agent-facing TemporalRange values deliberately use Human end semantics: `{ "kind
|
|
|
80
107
|
|
|
81
108
|
For Update/Delete/Action, the Agent Tool still requires a stable `recordId`. If it is not already known, the Agent should call the matching Query Tool first; the mutation Tool does not guess which record the user meant.
|
|
82
109
|
|
|
83
|
-
|
|
84
|
-
|
|
85
110
|
The node displays the authorized human-readable `spaceName` when present while continuing to submit the stable `spc_*` ID.
|
|
86
111
|
|
|
87
112
|
For the human **LifeSpace** workflow node and Trigger composition, Record Type is the LifeSpace `modelKey` (for example `task`). Design-time options, expressions, Trigger output and downstream Record nodes use that plain value. CRUD calls go directly to `/spaces/{spaceId}/models/{modelKey}/records/...`, so execution adds no Discovery request and the adapter maintains no modelKey-to-route mapping. Existing `lsrt1...` workflow values are decoded only as a deprecated read-compatibility path and are never emitted or written by new configuration. The native **LifeSpace Agent Tool** deliberately treats Record Type as a structural design-time choice and stores a private pinned semantic snapshot behind that selection; the user-facing choice still displays the LifeSpace Record Type.
|
|
@@ -90,7 +115,9 @@ Current Calendar models expose the canonical `capabilityBindings.calendar.rangeF
|
|
|
90
115
|
|
|
91
116
|
## LifeSpace contract compatibility
|
|
92
117
|
|
|
93
|
-
This package follows the current LifeSpace Core Kernel `0.
|
|
118
|
+
This package follows the current LifeSpace Core Kernel `0.46.0` contract family on `main`. Integration/Eventing is independently versioned at `0.3.0`.
|
|
119
|
+
|
|
120
|
+
The current authority model separates verified Application / Principal / Actor context, supports Agent-as-Principal and bounded Delegation chains, and requires an explicit current `dlg_*` whenever an Agent executes under represented User authority. The adapter consumes the platform contract; it does not mint its own represented-user tokens or maintain a second authorization state.
|
|
94
121
|
|
|
95
122
|
The UX depends on these Kernel capabilities:
|
|
96
123
|
|
|
@@ -107,13 +134,17 @@ The UX depends on these Kernel capabilities:
|
|
|
107
134
|
- `0.28.0`: bounded batch Reference Resolution for relation IDs;
|
|
108
135
|
- `0.29.0`: canonical ordinary-record `referenceLabel` semantics plus `record` / `record_list` lookup and resolution;
|
|
109
136
|
- `0.30.0`: explicit paginated Change History collection and Model Control Plane ownership split;
|
|
110
|
-
- `0.31.0`: Integration/Eventing wire representation moves to the independent Integration/Eventing `0.1.0` contract while Core remains the Runtime authority
|
|
111
|
-
- `0.32.0`: `modelKey` becomes the sole Runtime address and canonical CRUD/Action paths move under `/models/{modelKey}/records
|
|
112
|
-
- `0.33.0`: canonical structural `timeRanges` become available in progressive semantic detail without implying an overlap query API
|
|
113
|
-
- `0.34.0`: explicit `eq/lt/lte/gt/gte` comparison transports, first-class `createdAt` / `updatedAt` envelope comparisons and Core-owned datetime local-date-window conversion become discoverable
|
|
114
|
-
- `0.35.0`: grouped `query.capabilityQueries` introduced capability-owned compatibility queries
|
|
115
|
-
- `0.36.0`: `query.canonical` unifies Search, typed Boolean Filter, multi-Sort and cursor Pagination behind `POST .../records/query`; Runtime Discovery also exposes canonical `instant`, `range<date>`, `range<instant>`, `temporal_range` field types and the Calendar `rangeField` binding
|
|
116
|
-
- `0.40.0`: Authority v2 separates verified Application / Principal / Actor from the explicit opaque Delegation selector
|
|
137
|
+
- `0.31.0`: Integration/Eventing wire representation moves to the independent Integration/Eventing `0.1.0` contract while Core remains the Runtime authority;
|
|
138
|
+
- `0.32.0`: `modelKey` becomes the sole Runtime address and canonical CRUD/Action paths move under `/models/{modelKey}/records`;
|
|
139
|
+
- `0.33.0`: canonical structural `timeRanges` become available in progressive semantic detail without implying an overlap query API;
|
|
140
|
+
- `0.34.0`: explicit `eq/lt/lte/gt/gte` comparison transports, first-class `createdAt` / `updatedAt` envelope comparisons and Core-owned datetime local-date-window conversion become discoverable;
|
|
141
|
+
- `0.35.0`: grouped `query.capabilityQueries` introduced capability-owned compatibility queries;
|
|
142
|
+
- `0.36.0`: `query.canonical` unifies Search, typed Boolean Filter, multi-Sort and cursor Pagination behind `POST .../records/query`; Runtime Discovery also exposes canonical `instant`, `range<date>`, `range<instant>`, `temporal_range` field types and the Calendar `rangeField` binding;
|
|
143
|
+
- `0.40.0`: Authority v2 separates verified Application / Principal / Actor from the explicit opaque Delegation selector and adds first-class atomic `POST /spaces/{spaceId}/models/batch` for 1-20 create/update/delete operations;
|
|
144
|
+
- `0.43.0`: atomic `POST /spaces/{spaceId}/delegations/batch` materializes 1-20 independent Delegations for one confirmed business intent;
|
|
145
|
+
- `0.44.0`: first-class opaque `lsp_agt_*` Agent API credentials authenticate Application + Agent Actor directly at Core;
|
|
146
|
+
- `0.45.0`: transport-independent `arq_*` Authorization Request lifecycle with request/confirm/deny/cancel and atomic Delegation materialization;
|
|
147
|
+
- `0.46.0`: first-class non-atomic `POST /spaces/{spaceId}/models/bulk` with independent per-item outcomes and `blk_*` correlation, while `/models/batch` remains the atomic `cgs_*` ChangeSet profile.
|
|
117
148
|
|
|
118
149
|
The adapter prefers the `0.27+` progressive flow while configuring a node:
|
|
119
150
|
|
|
@@ -138,7 +169,7 @@ Ordinary Record CRUD/Action routes remain model-contract surfaces derived from p
|
|
|
138
169
|
New Workflow and Agent configurations expose one query model:
|
|
139
170
|
|
|
140
171
|
- **Search** is a top-level retrieval facet when the selected Record Type publishes searchable fields.
|
|
141
|
-
- **Filters** expose
|
|
172
|
+
- **Filters** expose Filter Groups. Each group has its own **Match: All / Any** and vertically stacked **Field**, **Operator**, and string/expression **Value** controls; multiple groups compose with AND. Field choices come from Discovery, and Operator choices reload from the selected field using n8n's row-relative dynamic-option dependency.
|
|
142
173
|
- Temporal range **Overlaps** is projected for human workflows as paired **Overlaps Start** + **Overlaps End** conditions in the same group. The adapter validates the pair and lowers it to one canonical `overlaps` range predicate. Date pairs use the current n8n workflow timezone unless **Options → Viewing Timezone** overrides it.
|
|
143
174
|
- **Sorts** come from `query.canonical.sort.fields` and preserve user priority.
|
|
144
175
|
- **Return All**, **Limit**, and the optional opaque **Cursor** use canonical cursor pagination.
|
|
@@ -183,9 +214,19 @@ Credentials are intentionally static secure configuration and are not workflow-e
|
|
|
183
214
|
|
|
184
215
|
The normal n8n-facing resource is **Record**. LifeSpace still owns **Model** semantics internally; the adapter uses **Record Type** for the workflow-facing selection.
|
|
185
216
|
|
|
186
|
-
Supported human Workflow operations include ordinary Record CRUD/Query/Action
|
|
217
|
+
Supported human Workflow operations include ordinary Record CRUD/Query/Action.
|
|
218
|
+
|
|
219
|
+
For **Create / Update / Delete**, **Batch Processing** is an independent transport/performance option under Record Options and defaults **On**:
|
|
187
220
|
|
|
188
|
-
|
|
221
|
+
- **Batch Processing = On, Atomic Consistency = Off** — the default. The node sends one bounded non-atomic LifeSpace Bulk request for 1-20 input items. Each item has an independent result, so valid items may succeed while invalid/stale/unauthorized items fail.
|
|
222
|
+
- **Batch Processing = On, Atomic Consistency = On** — the node sends one atomic LifeSpace Batch request. The whole batch commits or rolls back together and successful commit returns one shared `changeSetId`.
|
|
223
|
+
- **Batch Processing = Off** — the node returns to per-item execution.
|
|
224
|
+
|
|
225
|
+
The human Record node is structurally pinned to one Space and one Record Type, so its Batch Processing surface batches incoming items for that selected model. It does not expose a separate mixed-model JSON Batch UI in 0.2.0.
|
|
226
|
+
|
|
227
|
+
Update/Delete `Version` remains optional in all modes. In per-item mode, omission keeps the historical behavior of reading the current record immediately before mutation. In Bulk/Batch Processing, omission is sent to Core for set-wise current-version resolution, avoiding an N-read HTTP waterfall.
|
|
228
|
+
|
|
229
|
+
The native Agent Tool supports Query/Create/Update/Delete/Action plus **Create Records (Batch)** for 1-20 records of its pinned Record Type. Agent Batch Create remains atomic; Agent Update/Delete are ordinary single-record Tool operations in this release.
|
|
189
230
|
|
|
190
231
|
Ordinary Record operations remain:
|
|
191
232
|
|
|
@@ -238,9 +279,11 @@ At execution time Create uses the already-configured Record Type selector and se
|
|
|
238
279
|
|
|
239
280
|
LifeSpace uses optimistic concurrency.
|
|
240
281
|
|
|
241
|
-
By default the node reads the current Record version immediately before Update/Delete and sends that version with the mutation. This keeps the ordinary n8n UI free from mandatory internal `version` entry while preserving stale-write protection for the actual mutation race.
|
|
282
|
+
By default the node reads the current Record version immediately before Update/Delete when executing per item and sends that version with the mutation. This keeps the ordinary n8n UI free from mandatory internal `version` entry while preserving stale-write protection for the actual mutation race.
|
|
283
|
+
|
|
284
|
+
When Batch Processing is enabled and no explicit version is configured, Core resolves current versions set-wise as part of Bulk/Batch preparation rather than forcing one HTTP pre-read per item.
|
|
242
285
|
|
|
243
|
-
Update does not add a Runtime Discovery request before the mutation.
|
|
286
|
+
Update does not add a Runtime Discovery request before the mutation. Core validates Calendar and other Capability semantics against the resulting mutation.
|
|
244
287
|
|
|
245
288
|
If a workflow intentionally needs to bind a known version, add **Concurrency Options → Version**.
|
|
246
289
|
|
|
@@ -249,14 +292,13 @@ If a workflow intentionally needs to bind a known version, add **Concurrency Opt
|
|
|
249
292
|
List / Query exposes the single LifeSpace Canonical Query model:
|
|
250
293
|
|
|
251
294
|
- optional **Search** over fields published as searchable;
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
- string/expression values that are parsed back to canonical scalar values, with canonical JSON text for structured Range/TemporalRange/`within` operands;
|
|
295
|
+
- **Filter Groups**, where each group chooses **Match All / Match Any** and groups compose with AND;
|
|
296
|
+
- Discovery-backed **Field** and **Operator** selectors plus string/expression **Value** controls that are parsed back to canonical typed values;
|
|
255
297
|
- ordered **Sorts** generated from canonical sortable fields;
|
|
256
298
|
- optional **Viewing Timezone** context when sorting a `temporal_range` field;
|
|
257
299
|
- **Return All**, **Limit**, and an optional opaque **Cursor**.
|
|
258
300
|
|
|
259
|
-
The node sends one structured `POST .../records/query` request per page.
|
|
301
|
+
The node sends one structured `POST .../records/query` request per page. Core remains responsible for final contract validation, timezone/DST conversion, authorization, null-last ordering and cursor identity. Stored workflows using previous query controls remain execution-compatible through hidden adapter fallbacks.
|
|
260
302
|
|
|
261
303
|
New configurations do not expose Standard Query or Capability Query. Stored workflows that explicitly selected the previous Capability Query remain executable through a hidden compatibility path.
|
|
262
304
|
|
|
@@ -286,7 +328,9 @@ Use normal Record operations when possible because they benefit from Runtime Dis
|
|
|
286
328
|
|
|
287
329
|
Use **LifeSpace Agent Tool** when connecting LifeSpace to an n8n AI Agent. This is a separate native AiTool surface rather than the human workflow node running through `usableAsTool`.
|
|
288
330
|
|
|
289
|
-
Configure the Tool's structural scope — Space, Record Type and operation — in the node. Selecting the Record Type loads the current LifeSpace semantic detail and pins the model version, `schemaHash`, fields/query/action semantics and Space label into the workflow. At runtime the Tool derives its model-facing name, description and input schema from that saved snapshot, so `supplyData()` performs zero Runtime Discovery requests. Reselect Record Type to refresh the pinned contract after a LifeSpace model change.
|
|
331
|
+
Attach a **LifeSpace Agent API** credential. Configure the Tool's structural scope — Space, Record Type and operation — in the node. Selecting the Record Type loads the current LifeSpace semantic detail and pins the model version, `schemaHash`, fields/query/action semantics and Space label into the workflow. At runtime the Tool derives its model-facing name, description and input schema from that saved snapshot, so `supplyData()` performs zero Runtime Discovery requests. Reselect Record Type to refresh the pinned contract after a LifeSpace model change.
|
|
332
|
+
|
|
333
|
+
Direct Agent calls use the Agent's own current authority. The Tool schema also accepts `delegationId` for represented User execution. If direct authority is insufficient and no valid represented delegation was supplied, the Tool returns the exact `authorizationRequired` scope that can be passed to **LifeSpace Request Authorization**.
|
|
290
334
|
|
|
291
335
|
For Canonical Query, the model receives semantic inputs such as:
|
|
292
336
|
|
|
@@ -306,6 +350,35 @@ The adapter validates fields and operators against `query.canonical` and compile
|
|
|
306
350
|
|
|
307
351
|
Create/Update schemas are generated from writable model fields. Optional fields that the model does not provide are omitted rather than synthesized as empty values. Actions remain metadata-driven, and adding a future Record Type does not require a model-specific `create_*` or `query_*` node implementation.
|
|
308
352
|
|
|
353
|
+
## Use LifeSpace Authorization Request nodes
|
|
354
|
+
|
|
355
|
+
The Authorization Request flow keeps LifeSpace as the authority source of truth across AI, n8n Chat, and deterministic workflow transports.
|
|
356
|
+
|
|
357
|
+
A typical Agent flow is:
|
|
358
|
+
|
|
359
|
+
```text
|
|
360
|
+
LifeSpace Agent Tool
|
|
361
|
+
-> insufficient direct Agent authority
|
|
362
|
+
-> returns authorizationRequired
|
|
363
|
+
|
|
364
|
+
LifeSpace Request Authorization
|
|
365
|
+
-> creates/reuses pending arq_*
|
|
366
|
+
-> returns canonical confirmation projection
|
|
367
|
+
-> grants no authority
|
|
368
|
+
|
|
369
|
+
Human review / trusted workflow decision
|
|
370
|
+
-> Confirm / Deny
|
|
371
|
+
|
|
372
|
+
Confirm
|
|
373
|
+
-> rechecks current User authority
|
|
374
|
+
-> atomically creates required independent dlg_*
|
|
375
|
+
-> Agent retries business operation with explicit delegationId
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
For AI-mediated Human Review, the confirmation projection displayed to the user must come from the canonical Authorization Request response and is validated again on confirmation. Deterministic trusted workflow transports may use the `arq_*` request identity directly according to the LifeSpace contract.
|
|
379
|
+
|
|
380
|
+
`denied` means the intended User explicitly rejected the request. `cancelled` means the requesting Agent/Application no longer needs the pending request. They are intentionally different lifecycle outcomes.
|
|
381
|
+
|
|
309
382
|
## Use the LifeSpace Trigger
|
|
310
383
|
|
|
311
384
|
The **LifeSpace Trigger** receives signed LifeSpace Domain Event webhooks.
|
|
@@ -320,7 +393,7 @@ One Webhook Endpoint can therefore carry events for multiple Record Types throug
|
|
|
320
393
|
### Trigger setup
|
|
321
394
|
|
|
322
395
|
1. Add a **LifeSpace Trigger** node.
|
|
323
|
-
2. Attach a **LifeSpace API** credential. The Trigger uses it only for Runtime Discovery and normal LifeSpace API context.
|
|
396
|
+
2. Attach a **LifeSpace Service API** credential. The Trigger uses it only for Runtime Discovery and normal LifeSpace API context.
|
|
324
397
|
3. Attach a **LifeSpace Webhook Signing** credential containing the signing secret for this Webhook Endpoint.
|
|
325
398
|
4. Choose the **Space** from Runtime Discovery.
|
|
326
399
|
5. Choose one or more **Record Types**.
|
|
@@ -339,15 +412,16 @@ Webhook Endpoint / Event Subscription creation is intentionally not performed by
|
|
|
339
412
|
|
|
340
413
|
## What the package provides
|
|
341
414
|
|
|
342
|
-
- **LifeSpace API** credential for Service Principal authentication and Runtime Discovery;
|
|
343
|
-
- **LifeSpace
|
|
415
|
+
- **LifeSpace Service API** credential for Service Principal authentication and Runtime Discovery using canonical `lsp_svc_*` tokens, with legacy `lsp_pat_*` accepted only by LifeSpace during migration;
|
|
416
|
+
- **LifeSpace Agent API** credential using one opaque `lsp_agt_*` secret for direct Agent and represented User/Agent execution;
|
|
344
417
|
- **LifeSpace Webhook Signing** credential for endpoint-scoped inbound HMAC verification;
|
|
345
|
-
- **LifeSpace** human workflow node with Discovery-driven Record operations,
|
|
346
|
-
- **LifeSpace Agent Tool** native AiTool with Discovery-driven semantic schemas and bounded same-model Batch Create;
|
|
418
|
+
- **LifeSpace** human workflow node with Discovery-driven Record operations, default non-atomic Bulk Processing, optional Atomic Consistency, and Advanced API Request;
|
|
419
|
+
- **LifeSpace Agent Tool** native AiTool with Discovery-driven semantic schemas, direct Agent authority, explicit represented-user Delegation selection, and bounded same-model atomic Batch Create;
|
|
420
|
+
- **LifeSpace Request/Confirm/Deny/Cancel Authorization** nodes and Tools for the `arq_*` user-confirmation lifecycle;
|
|
347
421
|
- **LifeSpace Trigger** with signed multi-Record-Type Domain Event filtering;
|
|
348
422
|
- shared thin adapter projection from LifeSpace Runtime Discovery into human n8n controls and model-facing Tool schemas.
|
|
349
423
|
|
|
350
|
-
The human
|
|
424
|
+
The human Record node uses one selected Space and Record Type. With Batch Processing enabled it groups 1-20 incoming items into one LifeSpace request: non-atomic `/models/bulk` by default, or atomic `/models/batch` when Atomic Consistency is enabled. It does not emulate Bulk by issuing N HTTP mutation calls.
|
|
351
425
|
|
|
352
426
|
LifeSpace remains authoritative for validation, authorization, defaults, Mutation Authority, Action semantics, query/time semantics, relation semantics and event contracts. Runtime Discovery and Relation Target Lookup are current capability/reference projections, not execution-authorization proofs.
|
|
353
427
|
|
|
@@ -401,4 +475,4 @@ The adapter now consumes generic `person`, `person_list`, `record` and `record_l
|
|
|
401
475
|
|
|
402
476
|
## License
|
|
403
477
|
|
|
404
|
-
MIT
|
|
478
|
+
MIT
|
|
@@ -4,63 +4,45 @@ exports.LifeSpaceAgentExecutionApi = void 0;
|
|
|
4
4
|
class LifeSpaceAgentExecutionApi {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.name = 'lifeSpaceAgentExecutionApi';
|
|
7
|
-
this.displayName = 'LifeSpace
|
|
7
|
+
this.displayName = 'LifeSpace Agent API';
|
|
8
8
|
this.icon = {
|
|
9
9
|
light: 'file:lifespace.svg',
|
|
10
10
|
dark: 'file:lifespace.dark.svg',
|
|
11
11
|
};
|
|
12
|
-
this.documentationUrl = 'https://github.com/huangshirui/LifeSpace/blob/main/docs/
|
|
12
|
+
this.documentationUrl = 'https://github.com/huangshirui/LifeSpace/blob/main/docs/service-authentication.md';
|
|
13
13
|
this.properties = [
|
|
14
14
|
{
|
|
15
|
-
displayName: '
|
|
15
|
+
displayName: 'API Base URL',
|
|
16
16
|
name: 'coreBaseUrl',
|
|
17
17
|
type: 'string',
|
|
18
18
|
default: '',
|
|
19
19
|
placeholder: 'https://core.example.com/api/v1',
|
|
20
20
|
required: true,
|
|
21
|
-
description: 'LifeSpace Core API root used by
|
|
21
|
+
description: 'LifeSpace Core API root used by Agent requests',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
displayName: '
|
|
25
|
-
name: '
|
|
26
|
-
type: 'string',
|
|
27
|
-
default: '',
|
|
28
|
-
placeholder: 'https://identity.example.com',
|
|
29
|
-
required: true,
|
|
30
|
-
description: 'LifeSpace Identity origin. Do not include /internal/v1/agent-tokens',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
displayName: 'Application Credential',
|
|
34
|
-
name: 'applicationSecret',
|
|
24
|
+
displayName: 'Agent API Credential',
|
|
25
|
+
name: 'agentSecret',
|
|
35
26
|
type: 'string',
|
|
36
27
|
typeOptions: { password: true },
|
|
37
28
|
default: '',
|
|
38
|
-
placeholder: '
|
|
39
|
-
required: true,
|
|
40
|
-
description: 'Server-only trusted LifeSpace Application credential used only to mint short-lived delegated Agent execution tokens',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
displayName: 'Agent ID',
|
|
44
|
-
name: 'agentId',
|
|
45
|
-
type: 'string',
|
|
46
|
-
default: '',
|
|
47
|
-
placeholder: 'agt_...',
|
|
29
|
+
placeholder: 'lsp_agt_...',
|
|
48
30
|
required: true,
|
|
49
|
-
description: 'LifeSpace Agent
|
|
31
|
+
description: 'Opaque LifeSpace Agent API credential bound to one Application and Agent identity',
|
|
50
32
|
},
|
|
51
33
|
];
|
|
52
34
|
this.authenticate = {
|
|
53
35
|
type: 'generic',
|
|
54
36
|
properties: {
|
|
55
37
|
headers: {
|
|
56
|
-
Authorization: '=Bearer {{$credentials.
|
|
38
|
+
Authorization: '=Bearer {{$credentials.agentSecret}}',
|
|
57
39
|
},
|
|
58
40
|
},
|
|
59
41
|
};
|
|
60
42
|
this.test = {
|
|
61
43
|
request: {
|
|
62
|
-
baseURL: '={{$credentials.
|
|
63
|
-
url: '/
|
|
44
|
+
baseURL: '={{$credentials.coreBaseUrl.replace(/\\/$/, "")}}',
|
|
45
|
+
url: '/status',
|
|
64
46
|
method: 'GET',
|
|
65
47
|
},
|
|
66
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifeSpaceAgentExecutionApi.credentials.js","sourceRoot":"","sources":["../../credentials/LifeSpaceAgentExecutionApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,0BAA0B;IAAvC;QACE,SAAI,GAAG,4BAA4B,CAAC;QAEpC,gBAAW,GAAG
|
|
1
|
+
{"version":3,"file":"LifeSpaceAgentExecutionApi.credentials.js","sourceRoot":"","sources":["../../credentials/LifeSpaceAgentExecutionApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,0BAA0B;IAAvC;QACE,SAAI,GAAG,4BAA4B,CAAC;QAEpC,gBAAW,GAAG,qBAAqB,CAAC;QAEpC,SAAI,GAAG;YACL,KAAK,EAAE,oBAAoB;YAC3B,IAAI,EAAE,yBAAyB;SACvB,CAAC;QAEX,qBAAgB,GAAG,mFAAmF,CAAC;QAEvG,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iCAAiC;gBAC9C,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD;gBACE,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,aAAa;gBAC1B,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,mFAAmF;aACjG;SACF,CAAC;QAEF,iBAAY,GAAyB;YACnC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,aAAa,EAAE,sCAAsC;iBACtD;aACF;SACF,CAAC;QAEF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,mDAAmD;gBAC5D,GAAG,EAAE,SAAS;gBACd,MAAM,EAAE,KAAK;aACd;SACF,CAAC;IACJ,CAAC;CAAA;AAlDD,gEAkDC"}
|
|
@@ -4,7 +4,7 @@ exports.LifeSpaceApi = void 0;
|
|
|
4
4
|
class LifeSpaceApi {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.name = 'lifeSpaceApi';
|
|
7
|
-
this.displayName = 'LifeSpace API';
|
|
7
|
+
this.displayName = 'LifeSpace Service API';
|
|
8
8
|
this.icon = {
|
|
9
9
|
light: 'file:lifespace.svg',
|
|
10
10
|
dark: 'file:lifespace.dark.svg',
|
|
@@ -16,7 +16,7 @@ class LifeSpaceApi {
|
|
|
16
16
|
name: 'baseUrl',
|
|
17
17
|
type: 'string',
|
|
18
18
|
default: '',
|
|
19
|
-
placeholder: 'https://
|
|
19
|
+
placeholder: 'https://core.example.com/api/v1',
|
|
20
20
|
required: true,
|
|
21
21
|
description: 'LifeSpace Core API root. Do not include a Space or Record Type path.',
|
|
22
22
|
},
|
|
@@ -26,9 +26,9 @@ class LifeSpaceApi {
|
|
|
26
26
|
type: 'string',
|
|
27
27
|
typeOptions: { password: true },
|
|
28
28
|
default: '',
|
|
29
|
-
placeholder: '
|
|
29
|
+
placeholder: 'lsp_svc_...',
|
|
30
30
|
required: true,
|
|
31
|
-
description: 'Opaque LifeSpace Service API Token used by n8n for API calls and Runtime Discovery',
|
|
31
|
+
description: 'Opaque LifeSpace Service API Token used by n8n for API calls and Runtime Discovery. Legacy lsp_pat_* tokens remain accepted by LifeSpace during migration.',
|
|
32
32
|
},
|
|
33
33
|
];
|
|
34
34
|
this.authenticate = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifeSpaceApi.credentials.js","sourceRoot":"","sources":["../../credentials/LifeSpaceApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,YAAY;IAAzB;QACE,SAAI,GAAG,cAAc,CAAC;QAEtB,gBAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"LifeSpaceApi.credentials.js","sourceRoot":"","sources":["../../credentials/LifeSpaceApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,YAAY;IAAzB;QACE,SAAI,GAAG,cAAc,CAAC;QAEtB,gBAAW,GAAG,uBAAuB,CAAC;QAEtC,SAAI,GAAG;YACL,KAAK,EAAE,oBAAoB;YAC3B,IAAI,EAAE,yBAAyB;SACvB,CAAC;QAEX,qBAAgB,GAAG,mFAAmF,CAAC;QAEvG,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iCAAiC;gBAC9C,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,sEAAsE;aACpF;YACD;gBACE,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,aAAa;gBAC1B,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,4JAA4J;aAC1K;SACF,CAAC;QAEF,iBAAY,GAAyB;YACnC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,aAAa,EAAE,gCAAgC;iBAChD;aACF;SACF,CAAC;QAEF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,+CAA+C;gBACxD,GAAG,EAAE,gBAAgB;gBACrB,MAAM,EAAE,KAAK;aACd;SACF,CAAC;IACJ,CAAC;CAAA;AAlDD,oCAkDC"}
|
|
@@ -4,7 +4,7 @@ exports.LifeSpaceWebhookApi = void 0;
|
|
|
4
4
|
class LifeSpaceWebhookApi {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.name = 'lifeSpaceWebhookApi';
|
|
7
|
-
this.displayName = 'LifeSpace Webhook
|
|
7
|
+
this.displayName = 'LifeSpace Webhook Signing';
|
|
8
8
|
this.icon = {
|
|
9
9
|
light: 'file:lifespace.svg',
|
|
10
10
|
dark: 'file:lifespace.dark.svg',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifeSpaceWebhookApi.credentials.js","sourceRoot":"","sources":["../../credentials/LifeSpaceWebhookApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAAG,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"LifeSpaceWebhookApi.credentials.js","sourceRoot":"","sources":["../../credentials/LifeSpaceWebhookApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAAG,qBAAqB,CAAC;QAI7B,gBAAW,GAAG,2BAA2B,CAAC;QAE1C,SAAI,GAAG;YACL,KAAK,EAAE,oBAAoB;YAC3B,IAAI,EAAE,yBAAyB;SACvB,CAAC;QAEX,qBAAgB,GAAG,sEAAsE,CAAC;QAE1F,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iCAAiC;gBAC9C,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oGAAoG;aAClH;SACF,CAAC;IACJ,CAAC;CAAA;AA1BD,kDA0BC"}
|