@astrale-domains/shell 0.1.0-beta.11 → 0.1.0-beta.13

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.
Files changed (59) hide show
  1. package/README.md +63 -42
  2. package/dist/actions/index.d.ts +1 -0
  3. package/dist/actions/user/index.d.ts +1 -0
  4. package/dist/actions/user/resolve-home.d.ts +3 -0
  5. package/dist/application.d.ts +5 -9808
  6. package/dist/application.js +9 -8
  7. package/dist/entrypoints/runtime.d.ts +1 -0
  8. package/dist/index.d.ts +0 -2
  9. package/dist/index.js +0 -2
  10. package/dist/mutations/group/index.d.ts +1 -0
  11. package/dist/mutations/group/membership.d.ts +19 -0
  12. package/dist/mutations/space/access.d.ts +25 -0
  13. package/dist/mutations/space/default.d.ts +19 -0
  14. package/dist/mutations/space/index.d.ts +2 -0
  15. package/dist/mutations/user/index.d.ts +1 -0
  16. package/dist/mutations/user/repair.d.ts +37 -0
  17. package/dist/queries/space/access.d.ts +9 -0
  18. package/dist/queries/space/admin.d.ts +9 -0
  19. package/dist/queries/space/index.d.ts +3 -0
  20. package/dist/queries/space/member.d.ts +9 -0
  21. package/dist/queries/user/groups.d.ts +9 -0
  22. package/dist/queries/user/home.d.ts +9 -0
  23. package/dist/queries/user/index.d.ts +5 -0
  24. package/dist/queries/user/owned-spaces.d.ts +9 -0
  25. package/dist/queries/user/profile.d.ts +4 -0
  26. package/dist/queries/user/profile.js +1 -1
  27. package/dist/queries/user/setup.d.ts +13 -0
  28. package/dist/runtime.d.ts +10 -4
  29. package/dist/runtime.js +13 -14
  30. package/dist/schema/domain/index.d.ts +68 -1639
  31. package/dist/schema/domain/index.js +3 -2
  32. package/dist/schema/group/class.d.ts +13 -321
  33. package/dist/schema/group/class.js +3 -2
  34. package/dist/schema/group/methods.d.ts +2 -2
  35. package/dist/schema/group/methods.js +1 -5
  36. package/dist/schema/space/class.d.ts +10 -78
  37. package/dist/schema/space/class.js +3 -2
  38. package/dist/schema/space/methods.d.ts +4 -4
  39. package/dist/schema/space/methods.js +1 -5
  40. package/dist/schema/user/class.d.ts +14 -274
  41. package/dist/schema/user/class.js +5 -5
  42. package/dist/workflows/group/assign.d.ts +3 -0
  43. package/dist/workflows/group/change.d.ts +6 -0
  44. package/dist/workflows/group/index.d.ts +3 -0
  45. package/dist/workflows/group/unassign.d.ts +3 -0
  46. package/dist/workflows/index.d.ts +3 -0
  47. package/dist/workflows/setup/admin.d.ts +3 -0
  48. package/dist/workflows/setup/index.d.ts +5 -0
  49. package/dist/workflows/setup/member.d.ts +3 -0
  50. package/dist/workflows/setup/plan.d.ts +18 -0
  51. package/dist/workflows/setup/provision.d.ts +5 -0
  52. package/dist/workflows/setup/run.d.ts +7 -0
  53. package/dist/workflows/space/access.d.ts +7 -0
  54. package/dist/workflows/space/add.d.ts +3 -0
  55. package/dist/workflows/space/default.d.ts +3 -0
  56. package/dist/workflows/space/default.js +1 -1
  57. package/dist/workflows/space/index.d.ts +4 -0
  58. package/dist/workflows/space/remove.d.ts +3 -0
  59. package/package.json +14 -6
package/README.md CHANGED
@@ -1,59 +1,66 @@
1
1
  # Shell Domain
2
2
 
3
- Shell is the minimal Kernel-native application plane. Its durable model is one `User` interface,
4
- the concrete `User`, `Group`, `Space`, and `Application` Node Classes, eight relationships, five
5
- Policies, two Functions, seven Methods, five Kernel View declarations, and four deterministic Core
6
- nodes.
3
+ Shell is the minimal Kernel-native application plane. Its durable model is the concrete `User`,
4
+ `Group`, and `Space` Node Classes, five relationships, four Policies, two Functions, six Methods,
5
+ four Kernel View declarations, and three deterministic Core nodes.
7
6
 
8
- The `ensureUser` Function is the Shell-owned identity genesis boundary. It idempotently provisions an
9
- externally identified `User`, their personal `Space`, and both ownership/default relationships under
10
- the installed Shell Domain's authority. `ensureAdministrator` idempotently assigns one existing User
11
- to Shell's administrator Group. Both keep product mutation under Shell authority while allowing an
12
- authenticated genesis operator to request the transition.
7
+ Identity registration and Shell business setup are separate boundaries. A real external user first
8
+ creates a local key and self-provisions that key as the exact Shell `User` Class. The CLI journey is:
9
+
10
+ ```sh
11
+ astrale identity create alice
12
+ astrale identity register alice \
13
+ --class /:shell.astrale.ai:class.User \
14
+ --props '{"shell.astrale.ai:class.User.property.displayName":"Alice"}' \
15
+ --as <root> -i <instance>
16
+ ```
17
+
18
+ Under the current public contract, Root submits the self-proven registration for each Shell User;
19
+ it does not author that User's Shell memberships or Space facts. Root calls `setupAdmin` only to
20
+ converge the first administrator, using the exact registered issuer and subject returned by
21
+ `identity register`. After that, an authenticated Shell administrator calls `setupMember` or
22
+ `setupAdmin` for subsequent registered Users. Both setup Functions are authorized by
23
+ `maySetupUsers` against membership in the Core Administrators Group.
24
+ They converge the User profile, personal Space, ownership/default facts, Members membership, and—only
25
+ for `setupAdmin`—Administrators membership. They do not create credentials, grant humans dynamic
26
+ `can_*` authority, infer identity from a local CLI name, or replace self-proven registration.
13
27
 
14
28
  The Methods are:
15
29
 
16
- - Group: `assignUser`, `unassignUser`;
17
- - Space: `addUser`, `removeUser`, `setDefault`; and
18
- - Application: `install`, `uninstall`.
30
+ - User: `resolveHome`;
31
+ - Group: `assignUser`, `unassignUser`; and
32
+ - Space: `addUser`, `removeUser`, `setDefault`.
19
33
 
20
- Installation authors the `admin`, `member`, `default-space`, and `shell` Core. An authenticated genesis
21
- operator may invoke `ensureUser`, but cannot mutate Shell Classes directly. The remote handler performs
22
- the atomic identity provisioning as Shell, then callers assign the User explicitly to a Group. Shell
23
- infers no authority from email, claims, path spelling, or creation order.
34
+ Installation authors the `admin`, `member`, and `default-space` Core nodes. Shell infers no authority
35
+ from email, claims, path spelling, creation order, or a successful handler-local boolean.
24
36
 
25
37
  ## Source ownership
26
38
 
27
39
  - `schema/` owns the complete Domain contract, public Method values, Policies, relationships, DSL
28
40
  Views, and Core graph;
29
- - `rules/` owns synchronous classifications, decisions, normalization, and result projection;
30
- - `queries/` owns canonical single and composite graph observations plus explicit bounded continuation
31
- pagination when a business observation requires the complete set;
32
- - `mutations/` owns canonical atomic graph changes and their expected rejection evidence;
33
- - `workflows/` owns replay-shaped multi-step business journeys and unknown-outcome recovery;
34
- - `functions/` binds the Function and each Method to a rule, workflow, or direct operation;
35
- - `utils/` owns only the shared graph-endpoint and bounded-query mechanics used by independent
36
- submodules; and
37
- - root `tests/` owns cross-layer and system evidence, while each semantic submodule owns focused
38
- evidence in `__tests__/`.
41
+ - `queries/` owns canonical graph observations through the invocation-bound Query executor;
42
+ - `mutations/` owns canonical graph changes and exact preconditions;
43
+ - `actions/` owns the single-operation `User.resolveHome` implementation;
44
+ - `workflows/` owns setup, Group membership, and Space access/default journeys plus
45
+ unknown-outcome observation; and
46
+ - each semantic owner keeps focused evidence in its own `__tests__/` directory, while root tests
47
+ remain reserved for cross-layer or physical evidence.
39
48
 
40
49
  No current responsibility earns a `states/`, `capabilities/`, `integrations/`, `migrations/`,
41
- `views/`, `ui/`, or root `scripts/` source layer. DSL View declarations remain in Schema; a future
42
- frontend projection or UI must establish its own concrete responsibility before adding those layers.
50
+ `views/`, or `ui/` source layer. DSL View declarations remain in Schema; a future frontend
51
+ projection or UI must establish its own concrete responsibility before adding those layers.
43
52
 
44
- Shell never re-declares shared metadata properties. `Group` and `Space` currently name `K.Named`
45
- and `K.Descriptable` in their `implements` lists because the current DSL makes only `K.Node`
46
- intrinsic and Core-property admission otherwise rejects `name` and `description`. Removing those
47
- interface references awaits the recorded Kernel authoring-default decision; no timestamps are
48
- authored by Shell.
53
+ Shell never re-declares shared metadata properties. `Group` and `Space` name `K.Named` and
54
+ `K.Descriptable` in their `implements` lists because those Kernel Classes own the admitted
55
+ `name` and `description` properties; no timestamps are authored by Shell.
49
56
 
50
57
  ## Execution and evidence
51
58
 
52
- `ShellDomain` is the complete remote product implementation. Its exact handler map proves that the
53
- genesis Functions and all seven Methods are served from the same immutable publication. The handlers use
54
- the SDK's canonical Auth, Query, Mutation, Result, Workflow, and Step contracts. `ensureUser` relies on
55
- the Kernel provision operation's stable idempotency key; the SDK's current inline Step runner does not
56
- claim process-restart replay on its own.
59
+ `application.ts` and `runtime.ts` form the complete remote product implementation. Runtime admission
60
+ is exhaustive: `User.resolveHome` is one Action, and both setup Functions plus all five mutating
61
+ Methods are Workflows. They use the SDK's canonical Auth, Query, Mutation, Result, Workflow, and Step
62
+ contracts. Named Workflow steps describe semantic operations but do not claim process-restart
63
+ durability, exactly-once execution, compensation, or crash recovery.
57
64
 
58
65
  The executable contract lives in Shell's semantic source, public facades, and tests. Product
59
66
  decisions, journeys, legacy disposition, dependency gates, and qualification evidence live in
@@ -65,7 +72,21 @@ application descriptor from `@astrale-domains/shell/application` and the runtime
65
72
  `@astrale-domains/shell/runtime`, so bundling the remote runtime does not traverse the build-only
66
73
  schema facade.
67
74
 
68
- The source, deterministic Knowledge linter, TypeScript package, unit/cross-layer tests, and remote Shell
69
- contract are qualified locally. Installed-instance, released-package, browser, and live
70
- credential journeys are separate evidence levels and are not claimed here. Shell does not broker
71
- authentication tokens; standard Domain token exchange is owned by Protocol, Server, and SDK.
75
+ ### Publication boundary
76
+
77
+ `@astrale-domains/shell` is an executable platform package and a deliberate exception to the normal
78
+ Domain publication product. It publishes the remote Shell application and runtime needed by platform
79
+ Worker deployments through the explicit `./application` and `./runtime` subpaths, while its root remains
80
+ Schema-only. Its build therefore compiles the explicit roots in `tsconfig.package.json` and applies
81
+ Shell-owned checks to the emitted platform closure. Tarball qualification then verifies the exact
82
+ exports, isolated entrypoints, absence of source maps, and an install using only public npm
83
+ dependencies.
84
+
85
+ The generic `astrale-domain package` command remains Schema-only and exposes only the Domain root plus
86
+ package metadata. This Shell exception must not be copied to ordinary product Domains or used to
87
+ weaken that SDK contract. Deployment consumers must use the explicit executable subpaths so a linked
88
+ schema import cannot traverse Shell's private application or runtime implementation.
89
+
90
+ Source, package, and deterministic test qualification remain distinct from installed-instance,
91
+ released-package, browser, and live-credential evidence. Shell does not broker authentication
92
+ tokens; standard Domain token exchange is owned by Protocol, Server, and SDK.
@@ -0,0 +1 @@
1
+ export * from './user/index.js';
@@ -0,0 +1 @@
1
+ export { resolveHomeAction } from './resolve-home.js';
@@ -0,0 +1,3 @@
1
+ import { type ActionDefinition } from '@astrale-os/sdk/action';
2
+ import type { ShellSchema } from '#schema';
3
+ export declare const resolveHomeAction: ActionDefinition<typeof ShellSchema, 'User.resolveHome'>;