@githolon/dsl 0.25.0 → 0.27.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/dart/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 0.23.0
|
|
2
|
+
|
|
3
|
+
- `NomosBridge.shareWith` — one-call cross-custody share (sign quote + deliver recordShare to the subjects home). Closes the shared-with-me loop.
|
|
4
|
+
|
|
5
|
+
## 0.22.0
|
|
6
|
+
|
|
7
|
+
- `NomosBridge.offerIntent` (canonical write verb; `offerDirective` kept as alias) + one-call `NomosBridge.createWorkspace` (sign + relay a control-plane offer).
|
|
8
|
+
|
|
9
|
+
## 0.21.0
|
|
10
|
+
- `NomosBridge.noteLocalSpan(...)` — inject a locally-measured span (e.g. the Dart-side durable save, the
|
|
11
|
+
"saved to disk" number) into the span stream so it appears on the flame chart AND the per-phase stats
|
|
12
|
+
exactly like a kernel span. Additive; used by `nomos_flutter`'s durable-save-on-write.
|
|
13
|
+
|
|
1
14
|
## 0.20.2
|
|
2
15
|
- `NomosBridge.connect` accepts the internal `allowUnborn` opt-in used by `NomosScope.home`, so the
|
|
3
16
|
home-birth ceremony can boot a local bridge before the home workspace has a remote main. The default
|
|
@@ -408,6 +408,126 @@ class NomosBridge {
|
|
|
408
408
|
return r['head'].toString();
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
+
/// UNDO the most-recent action via the kernel STRIKE primitive (the fold drops the struck intent by parity).
|
|
412
|
+
/// [scope] `'all'` undoes any author's most-recent action; `'user'` only THIS replica's own. [actions] is the
|
|
413
|
+
/// app's set of undoable directive ids (so undo never strikes a framework/control intent). [domain] +
|
|
414
|
+
/// [directiveId] name the law's strike directive (default `todo`/`undo`). Returns `{ok, undone, head}` (ok
|
|
415
|
+
/// false + reason when there's nothing to undo). REDO is [redoMostRecent] — it strikes the strike.
|
|
416
|
+
/// OFFER AN INTENT — the write verb. Plan a directive (domain/directiveId/payload) as the verified [actor];
|
|
417
|
+
/// the holon encodes the v2 offer envelope via the single codec and admits it. Returns the new local head.
|
|
418
|
+
/// (This is the canonical name; [offerDirective] is the legacy alias the generated clients still call.)
|
|
419
|
+
Future<String> offerIntent({
|
|
420
|
+
required String domain,
|
|
421
|
+
required String directiveId,
|
|
422
|
+
required Object? payload,
|
|
423
|
+
String? actor,
|
|
424
|
+
String? domainHash,
|
|
425
|
+
}) =>
|
|
426
|
+
offerDirective(
|
|
427
|
+
domain: domain,
|
|
428
|
+
directiveId: directiveId,
|
|
429
|
+
payload: payload,
|
|
430
|
+
actor: actor,
|
|
431
|
+
domainHash: domainHash);
|
|
432
|
+
|
|
433
|
+
/// MAKE A WORKSPACE — the one-call tenant path. A child workspace under a platform/[parent] is a SIGNED
|
|
434
|
+
/// control-plane offer; the holon seals `createWorkspace` (or [directiveId] `birthChild`) with the
|
|
435
|
+
/// requester's device key ([authorSecret], as [actor], e.g. `user:<uid>`) and relays it to the parent's
|
|
436
|
+
/// gateway. Returns the worker verdict (`{ok, status, body}`). The tenant move is one line:
|
|
437
|
+
/// `await bridge.createWorkspace(name: 'foo', parent: 'my-platform', actor: 'user:$uid', authorSecret: key)`.
|
|
438
|
+
Future<Map<String, Object?>> createWorkspace({
|
|
439
|
+
required String parent,
|
|
440
|
+
required String actor,
|
|
441
|
+
required String authorSecret,
|
|
442
|
+
String? name,
|
|
443
|
+
Object? payload,
|
|
444
|
+
String directiveId = 'createWorkspace',
|
|
445
|
+
String? domainHash,
|
|
446
|
+
String? authToken,
|
|
447
|
+
}) async {
|
|
448
|
+
final r = _asMap(await _call('createWorkspace', {
|
|
449
|
+
'parent': parent,
|
|
450
|
+
'actor': actor,
|
|
451
|
+
'authorSecret': authorSecret,
|
|
452
|
+
if (name != null) 'name': name,
|
|
453
|
+
if (payload != null) 'payload': payload,
|
|
454
|
+
'directiveId': directiveId,
|
|
455
|
+
if (domainHash != null) 'domainHash': domainHash,
|
|
456
|
+
if (authToken != null) 'authToken': authToken,
|
|
457
|
+
}));
|
|
458
|
+
return (r['verdict'] as Map?)?.cast<String, Object?>() ?? r;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/// SHARE a workspace/record with a user — the one-call cross-custody grant that lands in their home's
|
|
462
|
+
/// "shared-with-me" list. This holon signs a quote `<asserterWorkspace>:<object>#<relation>@<subject>` with
|
|
463
|
+
/// [authorSecret] (the asserting owner's device key — the signature IS the grant) and delivers a
|
|
464
|
+
/// `recordShare` to the subject's home; the home's gate verifies it (no key needed there). Live authority
|
|
465
|
+
/// stays the forward Check on the asserter when the user opens it. Returns the worker verdict; an unborn
|
|
466
|
+
/// home (the user never logged in) comes back `{ok:false, needsHomeBirth:true}`.
|
|
467
|
+
/// `await bridge.shareWith(subject:'user:bob', relation:'editor', authorSecret: key, asserterPrincipal:'user:ada', homeLawHash: h)`.
|
|
468
|
+
Future<Map<String, Object?>> shareWith({
|
|
469
|
+
required String subject,
|
|
470
|
+
required String relation,
|
|
471
|
+
required String authorSecret,
|
|
472
|
+
required String asserterPrincipal,
|
|
473
|
+
required String homeLawHash,
|
|
474
|
+
String object = 'workspace:self',
|
|
475
|
+
String? asserterWorkspace,
|
|
476
|
+
String? attestedAt,
|
|
477
|
+
String? authToken,
|
|
478
|
+
}) async {
|
|
479
|
+
final r = _asMap(await _call('shareWith', {
|
|
480
|
+
'subject': subject,
|
|
481
|
+
'relation': relation,
|
|
482
|
+
'authorSecret': authorSecret,
|
|
483
|
+
'asserterPrincipal': asserterPrincipal,
|
|
484
|
+
'homeLawHash': homeLawHash,
|
|
485
|
+
'object': object,
|
|
486
|
+
if (asserterWorkspace != null) 'asserterWorkspace': asserterWorkspace,
|
|
487
|
+
if (attestedAt != null) 'attestedAt': attestedAt,
|
|
488
|
+
if (authToken != null) 'authToken': authToken,
|
|
489
|
+
}));
|
|
490
|
+
return (r['verdict'] as Map?)?.cast<String, Object?>() ?? r;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
Future<Map<String, Object?>> undoMostRecent({
|
|
494
|
+
String scope = 'all',
|
|
495
|
+
List<String>? actions,
|
|
496
|
+
String domain = '',
|
|
497
|
+
String directiveId = 'undo',
|
|
498
|
+
}) async =>
|
|
499
|
+
_asMap(await _call('undoMostRecent', {
|
|
500
|
+
'scope': scope,
|
|
501
|
+
if (actions != null) 'actions': actions,
|
|
502
|
+
'domain': domain,
|
|
503
|
+
'directiveId': directiveId,
|
|
504
|
+
}));
|
|
505
|
+
|
|
506
|
+
/// REDO the most-recent undo (strike the strike → its target re-applies). Same [scope]/[domain]/[directiveId]
|
|
507
|
+
/// as [undoMostRecent]. Returns `{ok, redone, head}`.
|
|
508
|
+
Future<Map<String, Object?>> redoMostRecent({
|
|
509
|
+
String scope = 'all',
|
|
510
|
+
String domain = '',
|
|
511
|
+
String directiveId = 'undo',
|
|
512
|
+
}) async =>
|
|
513
|
+
_asMap(await _call('redoMostRecent', {
|
|
514
|
+
'scope': scope,
|
|
515
|
+
'domain': domain,
|
|
516
|
+
'directiveId': directiveId,
|
|
517
|
+
}));
|
|
518
|
+
|
|
519
|
+
/// HISTORY of one aggregate (a todo) — the full action timeline from the ledger: every intent that touched
|
|
520
|
+
/// it + the strikes that retract them (undo/restore/redo), oldest→newest. Each entry:
|
|
521
|
+
/// `{id, who, mine, at(ms), action, fields[], done?, text?, removed?, marker, isStrike, targetAction, struck}`.
|
|
522
|
+
/// The caller formats the labels (created / renamed / done / deleted / restored / undone). No extra read —
|
|
523
|
+
/// who/when ride inside the intent id.
|
|
524
|
+
Future<List<Map<String, Object?>>> historyOf(String aggregateId) async {
|
|
525
|
+
final r = _asMap(await _call('historyOf', {'aggregateId': aggregateId}));
|
|
526
|
+
return ((r['entries'] as List?) ?? const [])
|
|
527
|
+
.map((e) => (e as Map).cast<String, Object?>())
|
|
528
|
+
.toList();
|
|
529
|
+
}
|
|
530
|
+
|
|
411
531
|
/// Mint an ed25519 DEVICE KEY in-kernel → `{secret, public}` (base64). The SECRET stays on this device
|
|
412
532
|
/// (persist it in secure storage); pass it to [connect] as `authorSecret` (or per-offer `signWith`) so the
|
|
413
533
|
/// holon SIGNS each intent. The PUBLIC half is what gets enrolled so the gate re-verifies the signature on
|
package/dart/pubspec.yaml
CHANGED
|
@@ -11,7 +11,7 @@ description: >-
|
|
|
11
11
|
Nomos 2 Dart frontend types — the hand-written kernel wire types plus the
|
|
12
12
|
code-generated per-domain aggregate + directive-payload types. (De)serializes
|
|
13
13
|
the EXACT serde JSON the Rust kernel + projection produce/consume.
|
|
14
|
-
version: 0.
|
|
14
|
+
version: 0.23.0
|
|
15
15
|
|
|
16
16
|
environment:
|
|
17
17
|
sdk: ^3.5.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@githolon/dsl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nomos 2 domain-authoring DSL: aggregates + directives in TS, executed and encoded to the Rust kernel's wire shapes.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/codegen_ts.ts
CHANGED
|
@@ -432,7 +432,7 @@ export function generateTsClient(modules: readonly DomainModule[], opts: TsClien
|
|
|
432
432
|
|
|
433
433
|
// ── DERIVED BIRTH LANES (sharding §10 RATIFIED, slice 1) ──
|
|
434
434
|
// A `workspaceType(...).hasMany(...)` taxonomy DERIVES typed birth helpers over
|
|
435
|
-
// the EXISTING birth machinery (the boot lane + the parent's
|
|
435
|
+
// the EXISTING birth machinery (the boot lane + the parent's birthChild/createWorkspace
|
|
436
436
|
// governance offers, `POST /v2/workspaces/...` — derived, never forked). Fully typesafe
|
|
437
437
|
// per Jack's ruling: the caller passes LOGICAL names
|
|
438
438
|
// (parent param named after the parent TYPE); the `p--ws` composition is internal
|
package/src/framework/home.ts
CHANGED
|
@@ -84,9 +84,9 @@ export function writeHomeOwner(p: { principal: string; homeName: string; bornAt:
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
* `seedHomeOwner` — the
|
|
88
|
-
* the fixed singleton id.
|
|
89
|
-
* lane
|
|
87
|
+
* `seedHomeOwner` — the genesis directive that stamps the home's owner + its self-committed `homeName` at
|
|
88
|
+
* the fixed singleton id. It is authored by the birth/genesis chain and structurally refused on the open
|
|
89
|
+
* session lane. `.ensures` (a deterministic-keyed singleton). The `homeName`
|
|
90
90
|
* is caller-supplied but the {@link homeNameBindsOwner} invariant proves it `== home-<sha256(principal)>`,
|
|
91
91
|
* so a squatter cannot claim a name slot that doesn't hash to ITS own owner.
|
|
92
92
|
*/
|
|
@@ -334,10 +334,9 @@ export const QuotaGrant = aggregate("QuotaGrant", {
|
|
|
334
334
|
});
|
|
335
335
|
|
|
336
336
|
/**
|
|
337
|
-
* PlatformGrant —
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
* grants — authority is a law-state fact, never a worker config.
|
|
337
|
+
* PlatformGrant — legacy audit surface for platform invites. Platform creation now rides
|
|
338
|
+
* {@link birthChild} with genesis data and is gated by `#creator`; any remaining PlatformGrant rows are
|
|
339
|
+
* inert compatibility/audit data, never a worker config.
|
|
341
340
|
*/
|
|
342
341
|
export const PlatformGrant = aggregate("PlatformGrant", {
|
|
343
342
|
/** The auth-provider principal uid invited to create platforms. */
|