@astrale-domains/shell 0.1.0-beta.10

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 (95) hide show
  1. package/README.md +71 -0
  2. package/dist/actions/index.js +1 -0
  3. package/dist/actions/user/index.js +1 -0
  4. package/dist/actions/user/resolve-home.js +19 -0
  5. package/dist/application.d.ts +9809 -0
  6. package/dist/application.js +29 -0
  7. package/dist/entrypoints/application.d.ts +1 -0
  8. package/dist/entrypoints/application.js +1 -0
  9. package/dist/entrypoints/runtime.js +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +3 -0
  12. package/dist/mutations/group/index.js +1 -0
  13. package/dist/mutations/group/membership.js +19 -0
  14. package/dist/mutations/space/access.js +23 -0
  15. package/dist/mutations/space/default.js +23 -0
  16. package/dist/mutations/space/index.js +2 -0
  17. package/dist/mutations/user/index.js +1 -0
  18. package/dist/mutations/user/repair.js +83 -0
  19. package/dist/queries/space/access.js +12 -0
  20. package/dist/queries/space/admin.js +20 -0
  21. package/dist/queries/space/index.js +3 -0
  22. package/dist/queries/space/member.js +17 -0
  23. package/dist/queries/user/groups.js +17 -0
  24. package/dist/queries/user/home.js +21 -0
  25. package/dist/queries/user/index.js +5 -0
  26. package/dist/queries/user/owned-spaces.js +17 -0
  27. package/dist/queries/user/profile.js +14 -0
  28. package/dist/queries/user/setup.js +16 -0
  29. package/dist/runtime.d.ts +4 -0
  30. package/dist/runtime.js +18 -0
  31. package/dist/schema/domain/index.d.ts +1665 -0
  32. package/dist/schema/domain/index.js +39 -0
  33. package/dist/schema/group/class.d.ts +323 -0
  34. package/dist/schema/group/class.js +7 -0
  35. package/dist/schema/group/core.d.ts +10 -0
  36. package/dist/schema/group/core.js +14 -0
  37. package/dist/schema/group/index.d.ts +6 -0
  38. package/dist/schema/group/index.js +6 -0
  39. package/dist/schema/group/methods.d.ts +13 -0
  40. package/dist/schema/group/methods.js +22 -0
  41. package/dist/schema/group/policies.d.ts +1 -0
  42. package/dist/schema/group/policies.js +6 -0
  43. package/dist/schema/group/relationships.d.ts +16 -0
  44. package/dist/schema/group/relationships.js +8 -0
  45. package/dist/schema/group/view.d.ts +1 -0
  46. package/dist/schema/group/view.js +6 -0
  47. package/dist/schema/home/index.d.ts +1 -0
  48. package/dist/schema/home/index.js +1 -0
  49. package/dist/schema/home/view.d.ts +1 -0
  50. package/dist/schema/home/view.js +4 -0
  51. package/dist/schema/index.d.ts +6 -0
  52. package/dist/schema/index.js +6 -0
  53. package/dist/schema/setup/functions.d.ts +28 -0
  54. package/dist/schema/setup/functions.js +27 -0
  55. package/dist/schema/setup/index.d.ts +1 -0
  56. package/dist/schema/setup/index.js +1 -0
  57. package/dist/schema/space/class.d.ts +80 -0
  58. package/dist/schema/space/class.js +11 -0
  59. package/dist/schema/space/core.d.ts +8 -0
  60. package/dist/schema/space/core.js +15 -0
  61. package/dist/schema/space/index.d.ts +6 -0
  62. package/dist/schema/space/index.js +6 -0
  63. package/dist/schema/space/methods.d.ts +18 -0
  64. package/dist/schema/space/methods.js +32 -0
  65. package/dist/schema/space/policies.d.ts +4 -0
  66. package/dist/schema/space/policies.js +21 -0
  67. package/dist/schema/space/relationships.d.ts +64 -0
  68. package/dist/schema/space/relationships.js +24 -0
  69. package/dist/schema/space/view.d.ts +1 -0
  70. package/dist/schema/space/view.js +6 -0
  71. package/dist/schema/user/class.d.ts +278 -0
  72. package/dist/schema/user/class.js +11 -0
  73. package/dist/schema/user/index.d.ts +3 -0
  74. package/dist/schema/user/index.js +3 -0
  75. package/dist/schema/user/methods.d.ts +7 -0
  76. package/dist/schema/user/methods.js +11 -0
  77. package/dist/schema/user/view.d.ts +1 -0
  78. package/dist/schema/user/view.js +6 -0
  79. package/dist/workflows/group/assign.js +3 -0
  80. package/dist/workflows/group/change.js +31 -0
  81. package/dist/workflows/group/index.js +3 -0
  82. package/dist/workflows/group/unassign.js +3 -0
  83. package/dist/workflows/index.js +3 -0
  84. package/dist/workflows/setup/admin.js +3 -0
  85. package/dist/workflows/setup/index.js +5 -0
  86. package/dist/workflows/setup/member.js +3 -0
  87. package/dist/workflows/setup/plan.js +88 -0
  88. package/dist/workflows/setup/provision.js +57 -0
  89. package/dist/workflows/setup/run.js +74 -0
  90. package/dist/workflows/space/access.js +41 -0
  91. package/dist/workflows/space/add.js +3 -0
  92. package/dist/workflows/space/default.js +37 -0
  93. package/dist/workflows/space/index.js +4 -0
  94. package/dist/workflows/space/remove.js +3 -0
  95. package/package.json +69 -0
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # Shell Domain
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.
7
+
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.
13
+
14
+ The Methods are:
15
+
16
+ - Group: `assignUser`, `unassignUser`;
17
+ - Space: `addUser`, `removeUser`, `setDefault`; and
18
+ - Application: `install`, `uninstall`.
19
+
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.
24
+
25
+ ## Source ownership
26
+
27
+ - `schema/` owns the complete Domain contract, public Method values, Policies, relationships, DSL
28
+ 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__/`.
39
+
40
+ 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.
43
+
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.
49
+
50
+ ## Execution and evidence
51
+
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.
57
+
58
+ The executable contract lives in Shell's semantic source, public facades, and tests. Product
59
+ decisions, journeys, legacy disposition, dependency gates, and qualification evidence live in
60
+ [`.history/`](.history/). Product Domains intentionally have no `.spec/` tree; Kernel authoring
61
+ values come through semantic `@astrale-os/sdk/*` facades.
62
+
63
+ Domain authors import the schema facade from `@astrale-domains/shell`. Worker deployments import the
64
+ application descriptor from `@astrale-domains/shell/application` and the runtime entrypoint from
65
+ `@astrale-domains/shell/runtime`, so bundling the remote runtime does not traverse the build-only
66
+ schema facade.
67
+
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.
@@ -0,0 +1 @@
1
+ export * from './user/index.js';
@@ -0,0 +1 @@
1
+ export { resolveHomeAction } from './resolve-home.js';
@@ -0,0 +1,19 @@
1
+ import { defineAction } from '@astrale-os/sdk/action';
2
+ import { InvocationError } from '@astrale-os/sdk/execution';
3
+ import { Path } from '@astrale-os/sdk/graph/path';
4
+ import { observeHome } from '#queries/user';
5
+ export const resolveHomeAction = defineAction()('User.resolveHome', async ({ domain, query, self }) => {
6
+ const observed = await query(observeHome, Path.id(self).raw);
7
+ if (observed.spaces.length > 1) {
8
+ throw new InvocationError('CONFLICT', 'The Shell User has more than one default Space.', {
9
+ reason: { code: 'MULTIPLE_DEFAULT_SPACES', details: {} },
10
+ });
11
+ }
12
+ const home = observed.spaces[0];
13
+ if (home !== undefined && home.class !== domain.classes.Space.key) {
14
+ throw new InvocationError('CONFLICT', 'The Shell User default target is not a Shell Space.', {
15
+ reason: { code: 'DEFAULT_SPACE_CLASS_CONFLICT', details: {} },
16
+ });
17
+ }
18
+ return Object.freeze({ userId: self, personalSpaceId: home?.id ?? null });
19
+ });