@amalgm/core 0.5.1-main.39177162099 → 0.5.1-main.41264319540
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/PURPOSE.md
CHANGED
|
@@ -218,8 +218,9 @@ instead of defining a second native installation contract.
|
|
|
218
218
|
31. **Activity is reported, never asked.** Each brick reports how many of its
|
|
219
219
|
things are running the moment that changes, through a hook the host hands
|
|
220
220
|
it; a brick started again gets a new hook, and the old one falls silent.
|
|
221
|
-
A count is unheard until its current hook first reports, and
|
|
222
|
-
|
|
221
|
+
A count is unheard until its current hook first reports, and again
|
|
222
|
+
whenever its brick says null because it cannot tell; unheard is not zero:
|
|
223
|
+
the runtime is idle only when every count is heard and zero.
|
|
223
224
|
|
|
224
225
|
## Managed update purpose
|
|
225
226
|
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* 1. A brick reports its own count the moment it changes; nobody asks.
|
|
6
6
|
* 2. A count exists from the moment the host hands out its hook, and it is
|
|
7
|
-
* unheard until that hook first reports. Unheard is not zero.
|
|
7
|
+
* unheard until that hook first reports. Unheard is not zero. A brick
|
|
8
|
+
* that cannot tell its count says null: the count is unheard again.
|
|
8
9
|
* 3. The runtime is idle only when every count is heard and zero.
|
|
9
10
|
*
|
|
10
11
|
* A count is one kind of work one brick runs: Chat's turns, Apps' running
|
|
@@ -15,12 +16,14 @@
|
|
|
15
16
|
* the count's one reporter, so the count is unheard until the new instance
|
|
16
17
|
* speaks, and the old instance's hook falls silent.
|
|
17
18
|
*/
|
|
18
|
-
/** The hook one brick calls with how many of its things are running now
|
|
19
|
-
|
|
19
|
+
/** The hook one brick calls with how many of its things are running now,
|
|
20
|
+
* or null when it cannot tell. */
|
|
21
|
+
export type ActivityHook = (count: number | null) => void;
|
|
20
22
|
export interface ActivityCount {
|
|
21
23
|
readonly brick: string;
|
|
22
24
|
readonly thing: string;
|
|
23
|
-
/** How many are running now; null until the brick first reports
|
|
25
|
+
/** How many are running now; null until the brick first reports, and
|
|
26
|
+
* whenever it says it cannot tell. */
|
|
24
27
|
readonly count: number | null;
|
|
25
28
|
}
|
|
26
29
|
export interface ActivityState {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/supervision/activity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/supervision/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;kCACkC;AAClC,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;0CACsC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC;IACjD,KAAK,IAAI,aAAa,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACjE;AAED,wBAAgB,cAAc,IAAI,QAAQ,CAmCzC"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* 1. A brick reports its own count the moment it changes; nobody asks.
|
|
6
6
|
* 2. A count exists from the moment the host hands out its hook, and it is
|
|
7
|
-
* unheard until that hook first reports. Unheard is not zero.
|
|
7
|
+
* unheard until that hook first reports. Unheard is not zero. A brick
|
|
8
|
+
* that cannot tell its count says null: the count is unheard again.
|
|
8
9
|
* 3. The runtime is idle only when every count is heard and zero.
|
|
9
10
|
*
|
|
10
11
|
* A count is one kind of work one brick runs: Chat's turns, Apps' running
|
|
@@ -36,8 +37,8 @@ export function createActivity() {
|
|
|
36
37
|
counts.set(name, entry);
|
|
37
38
|
changed();
|
|
38
39
|
return (count) => {
|
|
39
|
-
if (!Number.isSafeInteger(count) || count < 0) {
|
|
40
|
-
throw new TypeError(`Activity count "${name}" must be a whole number, got ${String(count)}`);
|
|
40
|
+
if (count !== null && (!Number.isSafeInteger(count) || count < 0)) {
|
|
41
|
+
throw new TypeError(`Activity count "${name}" must be a whole number or null, got ${String(count)}`);
|
|
41
42
|
}
|
|
42
43
|
if (counts.get(name) !== entry || entry.count === count)
|
|
43
44
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/supervision/activity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/supervision/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAkCH,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoF,CAAC;IAC3G,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkC,CAAC;IAE5D,MAAM,KAAK,GAAG,GAAkB,EAAE;QAChC,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9G,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC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QACD,KAAK;QACL,SAAS,CAAC,QAAwC;YAChD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACxB,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amalgm/core",
|
|
3
|
-
"version": "0.5.1-main.
|
|
3
|
+
"version": "0.5.1-main.41264319540",
|
|
4
4
|
"description": "The Amalgm kernel SDK — identity, transport, supervision, and host capability contracts behind host-injected adapters.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
"verify": "test",
|
|
96
96
|
"cli": []
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "b5e250ffbeb6c6df4c66dce857c6f1bbb317af55",
|
|
99
99
|
"amalgmSource": {
|
|
100
100
|
"repository": "amalgm-inc/amalgm-core",
|
|
101
101
|
"branch": "main",
|
|
102
|
-
"commit": "
|
|
103
|
-
"occurrence": "
|
|
102
|
+
"commit": "b5e250ffbeb6c6df4c66dce857c6f1bbb317af55",
|
|
103
|
+
"occurrence": "41264319540"
|
|
104
104
|
}
|
|
105
105
|
}
|