@fungi.computer/computer 0.8.6 → 0.8.8
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/dist/index.d.ts +7 -1
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,12 @@ declare class ContainerComputer extends ContainerComputerBase {
|
|
|
88
88
|
* name-addressed wake has reached this Computer yet.
|
|
89
89
|
*/
|
|
90
90
|
protected computerName(): string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Learn this Computer's name from a call's own claim of it (a grant's
|
|
93
|
+
* computerId). The namespace must derive this object's id from the claim,
|
|
94
|
+
* or it is refused and never stored.
|
|
95
|
+
*/
|
|
96
|
+
protected claimComputerName(claimed: string): void;
|
|
91
97
|
/** Names this host knows this Computer may have; each is verified, not trusted. */
|
|
92
98
|
protected nameCandidates(): readonly string[];
|
|
93
99
|
getWorkspaceContainer(): import("@fungi.computer/cloudflare-computer/backends/container").WorkspaceContainerAPI;
|
|
@@ -314,7 +320,7 @@ export declare class ComputerDO extends ContainerComputer implements ComputerFil
|
|
|
314
320
|
protected replaceFileIfUnchangedAfterAcceptance(input: ComputerFileReplacement, accept: () => void): Promise<ComputerFileReplacementResult>;
|
|
315
321
|
}
|
|
316
322
|
export { WorkspaceProxy, WorkspaceServiceProxy };
|
|
317
|
-
export { computerName } from "./computer-name.js";
|
|
323
|
+
export { computerName, learnComputerName } from "./computer-name.js";
|
|
318
324
|
export { OnBoxVmContainerHost, OnBoxVmTimeoutError, onBoxVmPlacement, onBoxVmIngress, type OnBoxVmEnv, type OnBoxVmOperation, type OnBoxVmState, } from "./on-box-vm.js";
|
|
319
325
|
export { computerContainerSleepAfterMs } from "./container-policy.js";
|
|
320
326
|
export * from "./computer-backends.js";
|
package/dist/index.js
CHANGED
|
@@ -256,6 +256,14 @@ class ContainerComputer extends ContainerComputerBase {
|
|
|
256
256
|
// host already knows, verified against this object's id.
|
|
257
257
|
return learnComputerName(this.state.storage.sql, this.state.id, this.bindings.COMPUTER, this.nameCandidates());
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Learn this Computer's name from a call's own claim of it (a grant's
|
|
261
|
+
* computerId). The namespace must derive this object's id from the claim,
|
|
262
|
+
* or it is refused and never stored.
|
|
263
|
+
*/
|
|
264
|
+
claimComputerName(claimed) {
|
|
265
|
+
learnComputerName(this.state.storage.sql, this.state.id, this.bindings.COMPUTER, [claimed]);
|
|
266
|
+
}
|
|
259
267
|
/** Names this host knows this Computer may have; each is verified, not trusted. */
|
|
260
268
|
nameCandidates() {
|
|
261
269
|
return [];
|
|
@@ -1587,7 +1595,7 @@ export class ComputerDO extends ContainerComputer {
|
|
|
1587
1595
|
// Runtime backends reach the authoritative Workspace through these loopback
|
|
1588
1596
|
// entrypoints. The consuming Worker must re-export both from its main module.
|
|
1589
1597
|
export { WorkspaceProxy, WorkspaceServiceProxy };
|
|
1590
|
-
export { computerName } from "./computer-name.js";
|
|
1598
|
+
export { computerName, learnComputerName } from "./computer-name.js";
|
|
1591
1599
|
export { OnBoxVmContainerHost, OnBoxVmTimeoutError, onBoxVmPlacement, onBoxVmIngress, } from "./on-box-vm.js";
|
|
1592
1600
|
export { computerContainerSleepAfterMs } from "./container-policy.js";
|
|
1593
1601
|
export * from "./computer-backends.js";
|