@ibgib/web-gib 0.0.42 → 0.0.44

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 (33) hide show
  1. package/dist/AUTO-GENERATED-version.d.mts +1 -1
  2. package/dist/AUTO-GENERATED-version.mjs +1 -1
  3. package/dist/api/commands/ui/ui-index.mjs +2 -2
  4. package/dist/api/commands/ui/ui-index.mjs.map +1 -1
  5. package/dist/api/commands/ui/update-css-variables.d.mts +13 -1
  6. package/dist/api/commands/ui/update-css-variables.d.mts.map +1 -1
  7. package/dist/api/commands/ui/update-css-variables.mjs +46 -36
  8. package/dist/api/commands/ui/update-css-variables.mjs.map +1 -1
  9. package/dist/identity/identity-constants.d.mts +72 -0
  10. package/dist/identity/identity-constants.d.mts.map +1 -0
  11. package/dist/identity/identity-constants.mjs +94 -0
  12. package/dist/identity/identity-constants.mjs.map +1 -0
  13. package/dist/identity/identity-types.d.mts +214 -0
  14. package/dist/identity/identity-types.d.mts.map +1 -0
  15. package/dist/identity/identity-types.mjs +17 -0
  16. package/dist/identity/identity-types.mjs.map +1 -0
  17. package/dist/ui/ui-helpers.d.mts +31 -0
  18. package/dist/ui/ui-helpers.d.mts.map +1 -1
  19. package/dist/ui/ui-helpers.mjs +50 -1
  20. package/dist/ui/ui-helpers.mjs.map +1 -1
  21. package/package.json +5 -5
  22. package/src/AUTO-GENERATED-version.mts +1 -1
  23. package/src/api/commands/ui/ui-index.mts +2 -2
  24. package/src/api/commands/ui/update-css-variables.mts +53 -35
  25. package/src/identity/identity-constants.mts +107 -0
  26. package/src/identity/identity-types.mts +250 -0
  27. package/src/ui/ui-helpers.mts +57 -1
  28. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-core/templates/constants.mts.template +1 -1
  29. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-core/templates/helpers.web.mts.template +3 -3
  30. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-core/templates/index.mts.template +1 -1
  31. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-core/templates/types.mts.template +1 -115
  32. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-witness/templates/witness/app/app-v1.mts.template +1 -1
  33. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-witness/templates/witness/app/helper.mts.template +1 -1
@@ -10,5 +10,5 @@
10
10
  /**
11
11
  * this is the version of this package, auto-updated in the build process
12
12
  */
13
- export declare const AUTO_GENERATED_VERSION = "0.0.42";
13
+ export declare const AUTO_GENERATED_VERSION = "0.0.44";
14
14
  //# sourceMappingURL=AUTO-GENERATED-version.d.mts.map
@@ -10,5 +10,5 @@
10
10
  /**
11
11
  * this is the version of this package, auto-updated in the build process
12
12
  */
13
- export const AUTO_GENERATED_VERSION = '0.0.42';
13
+ export const AUTO_GENERATED_VERSION = '0.0.44';
14
14
  //# sourceMappingURL=AUTO-GENERATED-version.mjs.map
@@ -1,5 +1,5 @@
1
- import { updateCSSVariablesFunctionInfo } from './update-css-variables.mjs';
1
+ // import { updateCSSVariablesFunctionInfo } from './update-css-variables.mjs';
2
2
  export const UIAgentFunctionInfos = [
3
- updateCSSVariablesFunctionInfo,
3
+ // updateCSSVariablesFunctionInfo,
4
4
  ];
5
5
  //# sourceMappingURL=ui-index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ui-index.mjs","sourceRoot":"","sources":["../../../../src/api/commands/ui/ui-index.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAE5E,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IACxD,8BAA8B;CACjC,CAAC"}
1
+ {"version":3,"file":"ui-index.mjs","sourceRoot":"","sources":["../../../../src/api/commands/ui/ui-index.mts"],"names":[],"mappings":"AACA,+EAA+E;AAE/E,MAAM,CAAC,MAAM,oBAAoB,GAA2B;AACxD,kCAAkC;CACrC,CAAC"}
@@ -41,8 +41,20 @@ export interface UpdateCSSVariablesCommandData extends CommandDataBase<typeof CM
41
41
  */
42
42
  declare function updateCSSVariablesViaCmd(opts: UpdateCSSVariablesOpts): Promise<void>;
43
43
  /**
44
- * API function info for the updateCSSVariables command.
44
+ * Factory function to get an API function info for the updateCSSVariables
45
+ * command. This enables an agent to update the {@link cssVariables} to create
46
+ * dynamic themes, which in turn enables users to use natural language to change
47
+ * the theme.
48
+ *
49
+ * initially this was just {@link VALID_CSS_VARIABLES}, but we have changed
50
+ * this to be a dynamic factory function driven by this {@link cssVariables}.
45
51
  */
52
+ export declare function getFunctionInfo_updateCSSVariablesFunctionInfo({ cssVariables, }: {
53
+ /**
54
+ * list of variables that the agent has access to change.
55
+ */
56
+ cssVariables: string[];
57
+ }): APIFunctionInfo<typeof updateCSSVariablesViaCmd>;
46
58
  export declare const updateCSSVariablesFunctionInfo: APIFunctionInfo<typeof updateCSSVariablesViaCmd>;
47
59
  export {};
48
60
  //# sourceMappingURL=update-css-variables.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-css-variables.d.mts","sourceRoot":"","sources":["../../../../src/api/commands/ui/update-css-variables.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAgBvD;;GAEG;AACH,QAAA,MAAM,YAAY,OAAO,CAAC;AAE1B;;GAEG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,EAAoB,CAAC;AAiChD;;;GAGG;AACH,MAAM,WAAW,sBACb,SAAQ,eAAe,CAAC,OAAO,YAAY,EAAE,OAAO,aAAa,CAAC;IAClE;;;OAGG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC3C;AAGD;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,eAAe,CAAC,OAAO,YAAY,EAAE,OAAO,aAAa,CAAC;IAC7G;;OAEG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED;;;;GAIG;AACH,iBAAS,wBAAwB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAa7E;AA8CD;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,eAAe,CAAC,OAAO,wBAAwB,CA8B3F,CAAC"}
1
+ {"version":3,"file":"update-css-variables.d.mts","sourceRoot":"","sources":["../../../../src/api/commands/ui/update-css-variables.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAgBvD;;GAEG;AACH,QAAA,MAAM,YAAY,OAAO,CAAC;AAE1B;;GAEG;AACH,QAAA,MAAM,aAAa,EAAE,MAAM,EAAoB,CAAC;AAiChD;;;GAGG;AACH,MAAM,WAAW,sBACb,SAAQ,eAAe,CAAC,OAAO,YAAY,EAAE,OAAO,aAAa,CAAC;IAClE;;;OAGG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC3C;AAGD;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,eAAe,CAAC,OAAO,YAAY,EAAE,OAAO,aAAa,CAAC;IAC7G;;OAEG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED;;;;GAIG;AACH,iBAAS,wBAAwB,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAa7E;AA6CD;;;;;;;;GAQG;AACH,wBAAgB,8CAA8C,CAAC,EAC3D,YAAY,GACf,EAAE;IACC;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B,GAAG,eAAe,CAAC,OAAO,wBAAwB,CAAC,CAgCnD;AAED,eAAO,MAAM,8BAA8B,kDAEzC,CAAC"}
@@ -3,9 +3,8 @@ import { GLOBAL_LOG_A_LOT } from "../../../constants.mjs";
3
3
  import { COMMAND_BASE_SCHEMA_PROPERTIES } from "../command-constants.mjs";
4
4
  import { getCommandService } from "../command-service-v1.mjs";
5
5
  import { FUNCTION_CALL_EXAMPLES_HEADER } from "../../api-constants.mjs";
6
- import { UI_THEME_INFO_KEY, VALID_CSS_VARIABLES } from "../../../ui/ui-constants.mjs";
7
- import { storagePut } from "../../../storage/storage-helpers.web.mjs";
8
- import { getExistingUIInfo } from "../../../ui/ui-helpers.mjs";
6
+ import { VALID_CSS_VARIABLES } from "../../../ui/ui-constants.mjs";
7
+ import { getExistingUIInfo, putUIInfoInStore } from "../../../ui/ui-helpers.mjs";
9
8
  import { getGlobalDbName, getGlobalStoreName } from "../../../helpers.web.mjs";
10
9
  const logalot = GLOBAL_LOG_A_LOT;
11
10
  // #region constants
@@ -84,7 +83,7 @@ async function updateCSSVariablesImpl(opts) {
84
83
  }
85
84
  // update the theme in the options
86
85
  const dbName = getGlobalDbName();
87
- const storeName = await getGlobalStoreName();
86
+ const storeName = getGlobalStoreName();
88
87
  const existingUIInfo = await getExistingUIInfo({ dbName, storeName }) ?? { cssVariableOverrides: {}, };
89
88
  const newUIInfo = {
90
89
  ...existingUIInfo,
@@ -93,11 +92,10 @@ async function updateCSSVariablesImpl(opts) {
93
92
  ...opts.cssVariables,
94
93
  },
95
94
  };
96
- await storagePut({
95
+ await putUIInfoInStore({
97
96
  dbName,
98
- storeName: await getGlobalStoreName(),
99
- key: UI_THEME_INFO_KEY,
100
- value: JSON.stringify(newUIInfo),
97
+ storeName,
98
+ newUIInfo,
101
99
  });
102
100
  }
103
101
  catch (error) {
@@ -111,35 +109,47 @@ async function updateCSSVariablesImpl(opts) {
111
109
  }
112
110
  }
113
111
  /**
114
- * API function info for the updateCSSVariables command.
112
+ * Factory function to get an API function info for the updateCSSVariables
113
+ * command. This enables an agent to update the {@link cssVariables} to create
114
+ * dynamic themes, which in turn enables users to use natural language to change
115
+ * the theme.
116
+ *
117
+ * initially this was just {@link VALID_CSS_VARIABLES}, but we have changed
118
+ * this to be a dynamic factory function driven by this {@link cssVariables}.
115
119
  */
116
- export const updateCSSVariablesFunctionInfo = {
117
- nameOrId: FUNCTION_NAME,
118
- fnViaCmd: updateCSSVariablesViaCmd,
119
- functionImpl: updateCSSVariablesImpl,
120
- cmd: CMD_CATEGORY,
121
- cmdModifiers: CMD_MODIFIERS,
122
- schema: {
123
- name: FUNCTION_NAME,
124
- description: FUNCTION_DESCRIPTION,
125
- parameters: {
126
- type: 'object',
127
- properties: {
128
- ...COMMAND_BASE_SCHEMA_PROPERTIES,
129
- cssVariables: {
130
- type: 'object',
131
- description: 'CSS variables to update when theming or otherwise changing these visual aspects of the web app per user preferences or the user directly asking for it. (atow there are no preferences saved or anything, so this is just user-driven if they ask for it.)',
132
- properties: Object.fromEntries(VALID_CSS_VARIABLES.map(varName => [
133
- varName,
134
- {
135
- type: 'string',
136
- description: `configurable css variable`,
137
- },
138
- ])),
139
- }
120
+ export function getFunctionInfo_updateCSSVariablesFunctionInfo({ cssVariables, }) {
121
+ return {
122
+ nameOrId: FUNCTION_NAME,
123
+ fnViaCmd: updateCSSVariablesViaCmd,
124
+ functionImpl: updateCSSVariablesImpl,
125
+ cmd: CMD_CATEGORY,
126
+ cmdModifiers: CMD_MODIFIERS,
127
+ schema: {
128
+ name: FUNCTION_NAME,
129
+ description: FUNCTION_DESCRIPTION,
130
+ parameters: {
131
+ type: 'object',
132
+ properties: {
133
+ ...COMMAND_BASE_SCHEMA_PROPERTIES,
134
+ cssVariables: {
135
+ type: 'object',
136
+ description: 'CSS variables to update when theming or otherwise changing these visual aspects of the web app per user preferences or the user directly asking for it. (atow there are no preferences saved or anything, so this is just user-driven if they ask for it.)',
137
+ properties: Object.fromEntries(cssVariables.map(varName => [
138
+ varName,
139
+ {
140
+ type: 'string',
141
+ description: `configurable css variable`,
142
+ },
143
+ ])),
144
+ }
145
+ },
146
+ required: ['cssVariables'],
140
147
  },
141
- required: ['cssVariables'],
142
148
  },
143
- },
144
- };
149
+ };
150
+ }
151
+ ;
152
+ export const updateCSSVariablesFunctionInfo = getFunctionInfo_updateCSSVariablesFunctionInfo({
153
+ cssVariables: VALID_CSS_VARIABLES,
154
+ });
145
155
  //# sourceMappingURL=update-css-variables.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-css-variables.mjs","sourceRoot":"","sources":["../../../../src/api/commands/ui/update-css-variables.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,iDAAiD,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC,oBAAoB;AACpB;;GAEG;AACH,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C;;GAEG;AACH,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;GAEG;AACH,MAAM,aAAa,GAAa,CAAC,aAAa,CAAC,CAAC;AAEhD,MAAM,uBAAuB,GAAoC;IAC7D,YAAY,EAAE;QACV,gCAAgC,EAAE,SAAS;QAC3C,0BAA0B,EAAE,OAAO;QACnC,4BAA4B,EAAE,SAAS;QACvC,4BAA4B,EAAE,KAAK;QACnC,4BAA4B,EAAE,OAAO;Q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BAAsB;IACpC,GAAG,EAAE,YAAY;IACjB,YAAY,EAAE,aAAa;IAC3B,MAAM,EAAE;QACJ,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,oBAAoB;QACjC,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,GAAG,8BAA8B;gBACjC,YAAY,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,4PAA4P;oBACzQ,UAAU,EAAE,MAAM,CAAC,WAAW,CAC1B,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC/B,OAAO;wBACP;4BACI,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,2BAA2B;yBAC3C;qBACJ,CAAC,CACL;iBACJ;aACJ;YACD,QAAQ,EAAE,CAAC,cAAc,CAAC;SAC7B;KACJ;CACJ,CAAC"}
1
+ {"version":3,"file":"update-css-variables.mjs","sourceRoot":"","sources":["../../../../src/api/commands/ui/update-css-variables.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,iDAAiD,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGtF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC,oBAAoB;AACpB;;GAEG;AACH,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C;;GAEG;AACH,MAA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AC,CAAC;QAAC,CAAC;IACpD,CAAC;AACL,CAAC;AAGD;;;;;;;;GAQG;AACH,MAAM,UAAU,8CAA8C,CAAC,EAC3D,YAAY,GAMf;IACG,OAAO;QACH,QAAQ,EAAE,aAAa;QACvB,QAAQ,EAAE,wBAAwB;QAClC,YAAY,EAAE,sBAAsB;QACpC,GAAG,EAAE,YAAY;QACjB,YAAY,EAAE,aAAa;QAC3B,MAAM,EAAE;YACJ,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,oBAAoB;YACjC,UAAU,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,GAAG,8BAA8B;oBACjC,YAAY,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,4PAA4P;wBACzQ,UAAU,EAAE,MAAM,CAAC,WAAW,CAC1B,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;4BACxB,OAAO;4BACP;gCACI,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,2BAA2B;6BAC3C;yBACJ,CAAC,CACL;qBACJ;iBACJ;gBACD,QAAQ,EAAE,CAAC,cAAc,CAAC;aAC7B;SACJ;KACJ,CAAC;AACN,CAAC;AAAA,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,8CAA8C,CAAC;IACzF,YAAY,EAAE,mBAAmB;CACpC,CAAC,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @file identity-constants.mts
3
+ * @description Constants for the ibgib identity layer: pool IDs, verbs, KDF salts,
4
+ * IndexedDB store names, and default pool configuration presets.
5
+ *
6
+ * @see docs/identity/KEYSTONES.md
7
+ * @see docs/identity/TODO.md#02-identity-constants--verbs
8
+ */
9
+ /** Evolve META: add a LOCAL keystone to the trusted list. */
10
+ export declare const IDENTITY_VERB_ADD_DEVICE = "identity-add-device";
11
+ /** Evolve META: remove a LOCAL keystone from the trusted list. */
12
+ export declare const IDENTITY_VERB_REMOVE_DEVICE = "identity-remove-device";
13
+ /** Evolve META: transfer custodianship (custodial → sovereign). */
14
+ export declare const IDENTITY_VERB_CUSTODY_TRANSFER = "identity-custody-transfer";
15
+ /** Evolve LOCAL: register a new APP-LOCAL keystone. */
16
+ export declare const IDENTITY_VERB_ADD_APP = "identity-add-app";
17
+ /** Evolve LOCAL: deregister an APP-LOCAL keystone. */
18
+ export declare const IDENTITY_VERB_REMOVE_APP = "identity-remove-app";
19
+ /** Evolve APP-LOCAL: establish a SESSION keystone genesis. */
20
+ export declare const IDENTITY_VERB_ESTABLISH_SESSION = "identity-establish-session";
21
+ /** Evolve APP-LOCAL: authorize an app-level action. */
22
+ export declare const IDENTITY_VERB_AUTHORIZE = "identity-authorize";
23
+ /**
24
+ * Evolve APP-LOCAL (final frame of old epoch): transition to a new epoch keystone.
25
+ * Uses `consume` replenish strategy — self-contained, no parent evolution needed.
26
+ * @see docs/identity/PARADIGM.md#epoch-rotation-handling-keystone-growth
27
+ */
28
+ export declare const IDENTITY_VERB_EPOCH_TRANSITION = "identity-epoch-transition";
29
+ /** META keystone: structural changes (add/remove device). */
30
+ export declare const IDENTITY_POOL_ID_ADD_DEVICE = "identity-add-device";
31
+ /** META keystone: structural changes (remove device). Separate pool allows tighter policy. */
32
+ export declare const IDENTITY_POOL_ID_REMOVE_DEVICE = "identity-remove-device";
33
+ /** META keystone: custody transfer (consume strategy — limited uses). */
34
+ export declare const IDENTITY_POOL_ID_CUSTODY_TRANSFER = "identity-custody-transfer";
35
+ /** LOCAL keystone: register/deregister app-local keystones. */
36
+ export declare const IDENTITY_POOL_ID_ADD_APP = "identity-add-app";
37
+ /** LOCAL keystone: deregister app-local keystones. */
38
+ export declare const IDENTITY_POOL_ID_REMOVE_APP = "identity-remove-app";
39
+ /** APP-LOCAL keystone: establish session keystones. */
40
+ export declare const IDENTITY_POOL_ID_APP_SESSION = "identity-app-session";
41
+ /** APP-LOCAL keystone: general app-level authorization. */
42
+ export declare const IDENTITY_POOL_ID_APP_AUTHORIZE = "identity-app-authorize";
43
+ /**
44
+ * APP-LOCAL keystone: epoch transition pool.
45
+ * Strategy: consume — self-authenticates epoch rotation without parent evolution.
46
+ */
47
+ export declare const IDENTITY_POOL_ID_APP_EPOCH = "identity-app-epoch";
48
+ export declare const IDENTITY_KDF_SALT_META = "ibgib-identity-meta-v1";
49
+ export declare const IDENTITY_KDF_SALT_LOCAL = "ibgib-identity-local-v1";
50
+ /**
51
+ * APP-LOCAL salt base. Full derivation:
52
+ * `KDF(MasterSecret_local, IDENTITY_KDF_SALT_APP_LOCAL + appId + deviceSalt)`
53
+ */
54
+ export declare const IDENTITY_KDF_SALT_APP_LOCAL = "ibgib-identity-app-local-v1";
55
+ export declare const IDENTITY_KDF_SALT_SESSION = "ibgib-identity-session-v1";
56
+ /** Stores `LocalIdentityContext` — one record per browser profile. */
57
+ export declare const IDENTITY_IDB_STORE_LOCAL_CONTEXT = "identity-local-context";
58
+ /** Stores `AppLocalIdentityContext` — one record per appId per browser profile. */
59
+ export declare const IDENTITY_IDB_STORE_APP_LOCAL_CONTEXT = "identity-app-local-context";
60
+ /** Cached META keystone chain — periodically refreshed from identity service. */
61
+ export declare const IDENTITY_IDB_STORE_META_CACHE = "identity-meta-cache";
62
+ /** LOCAL keystone frames — genesis through current tip. */
63
+ export declare const IDENTITY_IDB_STORE_LOCAL_CHAIN = "identity-local-chain";
64
+ /** APP-LOCAL keystone frames — current epoch genesis through tip. */
65
+ export declare const IDENTITY_IDB_STORE_APP_LOCAL_CHAIN = "identity-app-local-chain";
66
+ /** Default max age for cached META chain for routine verification. */
67
+ export declare const IDENTITY_META_CACHE_TTL_NORMAL_MS: number;
68
+ /** For session establishment: always fetch fresh. */
69
+ export declare const IDENTITY_META_CACHE_TTL_SESSION_MS = 0;
70
+ /** For offline operation: no TTL (accept whatever is cached). */
71
+ export declare const IDENTITY_META_CACHE_TTL_OFFLINE_MS: number;
72
+ //# sourceMappingURL=identity-constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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AmF;AACnF,eAAO,MAAM,oCAAoC,+BAA+B,CAAC;AACjF,iFAAiF;AACjF,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AACnE,2DAA2D;AAC3D,eAAO,MAAM,8BAA8B,yBAAyB,CAAC;AACrE,qEAAqE;AACrE,eAAO,MAAM,kCAAkC,6BAA6B,CAAC;AAQ7E,sEAAsE;AACtE,eAAO,MAAM,iCAAiC,QAAiB,CAAC;AAChE,qDAAqD;AACrD,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,iEAAiE;AACjE,eAAO,MAAM,kCAAkC,QAAW,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @file identity-constants.mts
3
+ * @description Constants for the ibgib identity layer: pool IDs, verbs, KDF salts,
4
+ * IndexedDB store names, and default pool configuration presets.
5
+ *
6
+ * @see docs/identity/KEYSTONES.md
7
+ * @see docs/identity/TODO.md#02-identity-constants--verbs
8
+ */
9
+ // ===========================================================================
10
+ // IDENTITY VERBS
11
+ // These extend the base KeystoneVerb set with identity-tier-specific actions.
12
+ // Used as values in KeystoneClaim.verb and KeystonePoolConfig.allowedVerbs.
13
+ // ===========================================================================
14
+ /** Evolve META: add a LOCAL keystone to the trusted list. */
15
+ export const IDENTITY_VERB_ADD_DEVICE = 'identity-add-device';
16
+ /** Evolve META: remove a LOCAL keystone from the trusted list. */
17
+ export const IDENTITY_VERB_REMOVE_DEVICE = 'identity-remove-device';
18
+ /** Evolve META: transfer custodianship (custodial → sovereign). */
19
+ export const IDENTITY_VERB_CUSTODY_TRANSFER = 'identity-custody-transfer';
20
+ /** Evolve LOCAL: register a new APP-LOCAL keystone. */
21
+ export const IDENTITY_VERB_ADD_APP = 'identity-add-app';
22
+ /** Evolve LOCAL: deregister an APP-LOCAL keystone. */
23
+ export const IDENTITY_VERB_REMOVE_APP = 'identity-remove-app';
24
+ /** Evolve APP-LOCAL: establish a SESSION keystone genesis. */
25
+ export const IDENTITY_VERB_ESTABLISH_SESSION = 'identity-establish-session';
26
+ /** Evolve APP-LOCAL: authorize an app-level action. */
27
+ export const IDENTITY_VERB_AUTHORIZE = 'identity-authorize';
28
+ /**
29
+ * Evolve APP-LOCAL (final frame of old epoch): transition to a new epoch keystone.
30
+ * Uses `consume` replenish strategy — self-contained, no parent evolution needed.
31
+ * @see docs/identity/PARADIGM.md#epoch-rotation-handling-keystone-growth
32
+ */
33
+ export const IDENTITY_VERB_EPOCH_TRANSITION = 'identity-epoch-transition';
34
+ // ===========================================================================
35
+ // POOL IDs
36
+ // Conventional pool identifiers for each identity tier's pools.
37
+ // ===========================================================================
38
+ /** META keystone: structural changes (add/remove device). */
39
+ export const IDENTITY_POOL_ID_ADD_DEVICE = 'identity-add-device';
40
+ /** META keystone: structural changes (remove device). Separate pool allows tighter policy. */
41
+ export const IDENTITY_POOL_ID_REMOVE_DEVICE = 'identity-remove-device';
42
+ /** META keystone: custody transfer (consume strategy — limited uses). */
43
+ export const IDENTITY_POOL_ID_CUSTODY_TRANSFER = 'identity-custody-transfer';
44
+ /** LOCAL keystone: register/deregister app-local keystones. */
45
+ export const IDENTITY_POOL_ID_ADD_APP = 'identity-add-app';
46
+ /** LOCAL keystone: deregister app-local keystones. */
47
+ export const IDENTITY_POOL_ID_REMOVE_APP = 'identity-remove-app';
48
+ /** APP-LOCAL keystone: establish session keystones. */
49
+ export const IDENTITY_POOL_ID_APP_SESSION = 'identity-app-session';
50
+ /** APP-LOCAL keystone: general app-level authorization. */
51
+ export const IDENTITY_POOL_ID_APP_AUTHORIZE = 'identity-app-authorize';
52
+ /**
53
+ * APP-LOCAL keystone: epoch transition pool.
54
+ * Strategy: consume — self-authenticates epoch rotation without parent evolution.
55
+ */
56
+ export const IDENTITY_POOL_ID_APP_EPOCH = 'identity-app-epoch';
57
+ // ===========================================================================
58
+ // KDF SALTS
59
+ // Used to derive tier-specific MasterSecrets from a root passphrase.
60
+ // Different salt per tier ensures independent secrets even with same passphrase.
61
+ // ===========================================================================
62
+ export const IDENTITY_KDF_SALT_META = 'ibgib-identity-meta-v1';
63
+ export const IDENTITY_KDF_SALT_LOCAL = 'ibgib-identity-local-v1';
64
+ /**
65
+ * APP-LOCAL salt base. Full derivation:
66
+ * `KDF(MasterSecret_local, IDENTITY_KDF_SALT_APP_LOCAL + appId + deviceSalt)`
67
+ */
68
+ export const IDENTITY_KDF_SALT_APP_LOCAL = 'ibgib-identity-app-local-v1';
69
+ export const IDENTITY_KDF_SALT_SESSION = 'ibgib-identity-session-v1';
70
+ // ===========================================================================
71
+ // INDEXEDDB STORE NAMES
72
+ // ===========================================================================
73
+ /** Stores `LocalIdentityContext` — one record per browser profile. */
74
+ export const IDENTITY_IDB_STORE_LOCAL_CONTEXT = 'identity-local-context';
75
+ /** Stores `AppLocalIdentityContext` — one record per appId per browser profile. */
76
+ export const IDENTITY_IDB_STORE_APP_LOCAL_CONTEXT = 'identity-app-local-context';
77
+ /** Cached META keystone chain — periodically refreshed from identity service. */
78
+ export const IDENTITY_IDB_STORE_META_CACHE = 'identity-meta-cache';
79
+ /** LOCAL keystone frames — genesis through current tip. */
80
+ export const IDENTITY_IDB_STORE_LOCAL_CHAIN = 'identity-local-chain';
81
+ /** APP-LOCAL keystone frames — current epoch genesis through tip. */
82
+ export const IDENTITY_IDB_STORE_APP_LOCAL_CHAIN = 'identity-app-local-chain';
83
+ // ===========================================================================
84
+ // STALENESS POLICY DEFAULTS (milliseconds)
85
+ // App-level policy: how old can a cached META chain be before re-fetch?
86
+ // @see docs/identity/PARADIGM.md#staleness-policy
87
+ // ===========================================================================
88
+ /** Default max age for cached META chain for routine verification. */
89
+ export const IDENTITY_META_CACHE_TTL_NORMAL_MS = 60 * 60 * 1000; // 1 hour
90
+ /** For session establishment: always fetch fresh. */
91
+ export const IDENTITY_META_CACHE_TTL_SESSION_MS = 0;
92
+ /** For offline operation: no TTL (accept whatever is cached). */
93
+ export const IDENTITY_META_CACHE_TTL_OFFLINE_MS = Infinity;
94
+ //# sourceMappingURL=identity-constants.mjs.map
@@ -0,0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,MAAM,8BAA8B,GAAG,wBAAwB,CAAC;AACvE;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D,8EAA8E;AAC9E,YAAY;AACZ,qEAAqE;AACrE,iFAAiF;AACjF,8EAA8E;AAE9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AACjE;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,6BAA6B,CAAC;AACzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAErE,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,sEAAsE;AACtE,MAAM,CAAC,MAAM,gCAAgC,GAAG,wBAAwB,CAAC;AACzE,mFAAmF;AACnF,MAAM,CAAC,MAAM,oCAAoC,GAAG,4BAA4B,CAAC;AACjF,iFAAiF;AACjF,MAAM,CAAC,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AACnE,2DAA2D;AAC3D,MAAM,CAAC,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AACrE,qEAAqE;AACrE,MAAM,CAAC,MAAM,kCAAkC,GAAG,0BAA0B,CAAC;AAE7E,8EAA8E;AAC9E,2CAA2C;AAC3C,wEAAwE;AACxE,kDAAkD;AAClD,8EAA8E;AAE9E,sEAAsE;AACtE,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,SAAS;AAC1E,qDAAqD;AACrD,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC;AACpD,iEAAiE;AACjE,MAAM,CAAC,MAAM,kCAAkC,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * @file identity-types.mts
3
+ * @description Type definitions for the four-tier ibgib identity hierarchy.
4
+ *
5
+ * ## Tier Overview
6
+ * ```
7
+ * META keystone → universal identity handle (cross-app, cross-device)
8
+ * └─ LOCAL keystone → device/browser-profile-scoped identity
9
+ * └─ APP-LOCAL keystone → app-scoped identity (one per app per browser profile)
10
+ * └─ SESSION keystone → session-scoped (existing sync protocol)
11
+ * ```
12
+ *
13
+ * @see docs/identity/PARADIGM.md
14
+ * @see docs/identity/KEYSTONES.md
15
+ */
16
+ import { IbGibAddr } from "@ibgib/ts-gib/dist/types.mjs";
17
+ import { KeystoneData_V1, KeystoneIbGib_V1 } from "@ibgib/core-gib/dist/keystone/keystone-types.mjs";
18
+ /**
19
+ * Data shape for the META keystone tier.
20
+ *
21
+ * The META keystone is the user's universal identity — stable across all apps,
22
+ * devices, and time. Its `tjpGib` is the user's permanent identity handle.
23
+ *
24
+ * @see docs/identity/KEYSTONES.md#meta-keystone
25
+ * @see docs/identity/PARADIGM.md#meta-keystone
26
+ */
27
+ export interface MetaKeystoneData extends KeystoneData_V1 {
28
+ /**
29
+ * List of LOCAL keystone `tjpGib` values currently trusted by this identity.
30
+ *
31
+ * This is the **trust register** — an app verifies a user by finding the
32
+ * LOCAL keystone's tjpGib in this list from the current META frame.
33
+ *
34
+ * Mutated by: add-device evolution (append), remove-device evolution (remove).
35
+ *
36
+ * @see docs/identity/PARADIGM.md#cross-app-identity
37
+ */
38
+ trustedLocalTjpGibs: IbGibAddr[];
39
+ /**
40
+ * For custodial keystones: the publicly-visible nonce used by the custodian
41
+ * to re-derive `MasterSecret_user = KDF(server_secret, custodialNonce)`.
42
+ *
43
+ * No secrecy requirement — security comes from `server_secret` alone.
44
+ * Stored here so the custodian needs no separate mapping table.
45
+ *
46
+ * Undefined for sovereign (user-held) keystones.
47
+ *
48
+ * @see docs/identity/PARADIGM.md#custodianship--the-oauth2-path
49
+ * @see docs/identity/FLOWS.md#flow-2-first-login--custodial-path-oauth2
50
+ */
51
+ custodialNonce?: string;
52
+ }
53
+ /**
54
+ * Data shape for the LOCAL keystone tier.
55
+ *
56
+ * Device/browser-profile-scoped identity. Evolves offline. Lives in IndexedDB.
57
+ * One per browser profile per user.
58
+ *
59
+ * @see docs/identity/KEYSTONES.md#local-keystone
60
+ */
61
+ export interface LocalKeystoneData extends KeystoneData_V1 {
62
+ /**
63
+ * Map of registered APP-LOCAL keystones on this browser profile.
64
+ *
65
+ * Key: `appId`
66
+ * Value: the **first epoch** APP-LOCAL keystone `tjpGib` for that app.
67
+ *
68
+ * Subsequent epochs are authenticated transitively through the APP-LOCAL
69
+ * epoch chain — the LOCAL keystone does NOT need to evolve for epoch rotation.
70
+ *
71
+ * Mutated by: add-app evolution (set), remove-app evolution (delete).
72
+ *
73
+ * @see docs/identity/PARADIGM.md#epoch-rotation-handling-keystone-growth
74
+ */
75
+ registeredAppLocals: Record<string, IbGibAddr>;
76
+ }
77
+ /**
78
+ * Data shape for the APP-LOCAL keystone tier.
79
+ *
80
+ * App-scoped identity for a specific browser profile + app combination.
81
+ * Evolves offline. Lives in IndexedDB (client) and app server (synced).
82
+ * One per app per browser profile per user.
83
+ *
84
+ * @see docs/identity/KEYSTONES.md#app-local-keystone
85
+ */
86
+ export interface AppLocalKeystoneData extends KeystoneData_V1 {
87
+ /** The app identifier this APP-LOCAL belongs to. */
88
+ appId: string;
89
+ /**
90
+ * The LOCAL keystone `tjpGib` this APP-LOCAL is derived from.
91
+ * Used by verifiers to link APP-LOCAL trust back to LOCAL → META.
92
+ */
93
+ localTjpGib: IbGibAddr;
94
+ /**
95
+ * The META keystone `tjpGib` for this identity.
96
+ * Stored for reference/display. The authoritative trust chain is
97
+ * always verified by replaying META → LOCAL → APP-LOCAL.
98
+ */
99
+ metaTjpGib: IbGibAddr;
100
+ /**
101
+ * For epoch-chained APP-LOCAL keystones: the ibgib address of the
102
+ * **final frame** of the previous epoch. Establishes the transitive
103
+ * trust chain from the first epoch.
104
+ *
105
+ * Undefined for the first epoch (no prior epoch).
106
+ *
107
+ * @see docs/identity/PARADIGM.md#epoch-rotation-handling-keystone-growth
108
+ */
109
+ prevEpochFinalFrameAddr?: IbGibAddr;
110
+ }
111
+ /**
112
+ * The browser-local identity context for a user on this browser profile.
113
+ * Stored in IndexedDB. Reconstructed from keystone chains if lost.
114
+ *
115
+ * @see docs/identity/FLOWS.md#flow-3-return-login--same-browser-profile
116
+ * @see docs/identity/PARTIES.md#party-app-client
117
+ */
118
+ export interface LocalIdentityContext {
119
+ /** The user's universal identity handle. Used for cross-app identity. */
120
+ metaTjpGib: IbGibAddr;
121
+ /** URL of the identity service hosting the user's META keystone. */
122
+ identityServiceUrl: string;
123
+ /** This browser profile's LOCAL keystone `tjpGib`. */
124
+ localTjpGib: IbGibAddr;
125
+ }
126
+ /**
127
+ * Per-app identity context for a specific browser profile + app.
128
+ * Stored in IndexedDB by the app client.
129
+ *
130
+ * @see docs/identity/KEYSTONES.md#app-local-keystone
131
+ */
132
+ export interface AppLocalIdentityContext {
133
+ /** The user's universal identity handle. */
134
+ metaTjpGib: IbGibAddr;
135
+ /** This browser profile's LOCAL keystone `tjpGib`. */
136
+ localTjpGib: IbGibAddr;
137
+ /**
138
+ * The **current** (possibly epoch-N) APP-LOCAL keystone `tjpGib`.
139
+ * Updated in-place after each epoch rotation.
140
+ */
141
+ appLocalTjpGib: IbGibAddr;
142
+ /** The app identifier. */
143
+ appId: string;
144
+ }
145
+ /**
146
+ * The shared identity space — a write-verifying history store.
147
+ *
148
+ * NOT an authority. Verifies chain continuity on writes. Serves raw chain
149
+ * data on reads. Any party can independently verify the chain it returns.
150
+ *
151
+ * Initial deployment: hosted on the app's server. Federated by design.
152
+ *
153
+ * @see docs/identity/PARADIGM.md#the-shared-identity-space
154
+ * @see docs/identity/PARTIES.md#party-identity-service
155
+ */
156
+ export interface IIdentityService {
157
+ /**
158
+ * POST a genesis frame — accepted unconditionally if internally valid.
159
+ * Genesis is self-legitimizing: Alice's identity IS her genesis frame.
160
+ *
161
+ * @returns the `tjpGib` (ibgib address of the genesis frame)
162
+ * @throws if the frame is internally invalid (malformed structure)
163
+ */
164
+ postGenesis(frame: KeystoneIbGib_V1): Promise<{
165
+ tjpGib: IbGibAddr;
166
+ }>;
167
+ /**
168
+ * POST an evolution frame.
169
+ * Verifies chain continuity: revealed solutions must hash-match prior
170
+ * frame's commitments. Implements CAS: rejects if prior frame is stale.
171
+ *
172
+ * @throws `IdentityServiceStaleTipError` if prior frame is no longer tip
173
+ * @throws `IdentityServiceChainError` if hash pre-images are invalid
174
+ */
175
+ postEvolution(frame: KeystoneIbGib_V1): Promise<void>;
176
+ /**
177
+ * GET the full keystone chain from genesis to current tip.
178
+ *
179
+ * Does NOT change state. Safe to call without coordination.
180
+ */
181
+ getChain(tjpGib: IbGibAddr): Promise<KeystoneIbGib_V1[]>;
182
+ /**
183
+ * GET the current tip frame for a keystone.
184
+ *
185
+ * Does NOT change state.
186
+ */
187
+ getTip(tjpGib: IbGibAddr): Promise<KeystoneIbGib_V1>;
188
+ }
189
+ /**
190
+ * Inputs for deriving a tier-specific MasterSecret from a root passphrase.
191
+ *
192
+ * Each tier uses a different salt to ensure independent MasterSecrets
193
+ * even when the same passphrase is used for all tiers.
194
+ *
195
+ * @see docs/identity/KEYSTONES.md for per-tier salt conventions
196
+ * @see identity-helpers.mts for derivation functions
197
+ */
198
+ export interface MasterSecretDerivationContext {
199
+ /** The root passphrase (sovereign path) or server secret (custodial path). */
200
+ passphrase: string;
201
+ /**
202
+ * Tier-specific salt (e.g., `IDENTITY_KDF_SALT_META`, `IDENTITY_KDF_SALT_LOCAL`).
203
+ * @see identity-constants.mts
204
+ */
205
+ salt: string;
206
+ /**
207
+ * Additional device-specific entropy for LOCAL and APP-LOCAL tiers.
208
+ * Generated once per browser profile and stored in IndexedDB.
209
+ */
210
+ deviceSalt?: string;
211
+ /** For APP-LOCAL tier: the app identifier, mixed into derivation. */
212
+ appId?: string;
213
+ }
214
+ //# sourceMappingURL=identity-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-types.d.mts","sourceRoot":"","sources":["../../src/identity/identity-types.mts"],"names":[],"mappings":"AAAA;;;;;;;;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E,gBAAgB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAErE;;;;;;;OAOG;IACH,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAEzD;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACxD;AAMD;;;;;;;;GAQG;AACH,MAAM,WAAW,6BAA6B;IAC1C,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file identity-types.mts
3
+ * @description Type definitions for the four-tier ibgib identity hierarchy.
4
+ *
5
+ * ## Tier Overview
6
+ * ```
7
+ * META keystone → universal identity handle (cross-app, cross-device)
8
+ * └─ LOCAL keystone → device/browser-profile-scoped identity
9
+ * └─ APP-LOCAL keystone → app-scoped identity (one per app per browser profile)
10
+ * └─ SESSION keystone → session-scoped (existing sync protocol)
11
+ * ```
12
+ *
13
+ * @see docs/identity/PARADIGM.md
14
+ * @see docs/identity/KEYSTONES.md
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=identity-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-types.mjs","sourceRoot":"","sources":["../../src/identity/identity-types.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}