@peers-app/peers-sdk 0.31.3 → 0.31.5

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.
@@ -27,6 +27,19 @@ export interface IPackageContext {
27
27
  * never use it to decide what a caller may do.
28
28
  */
29
29
  readonly deviceId: string;
30
+ /**
31
+ * The user this call acts for: the signed-in user for a call from this device's own screens or
32
+ * CLI, or the member whose device called. Use it to record who did something, such as who
33
+ * created a row; don't use it to decide what the caller may do. The host has already checked
34
+ * the call against the member's access rules.
35
+ *
36
+ * A call the device makes for itself, such as a System Scheduler booking, acts for the
37
+ * signed-in user. Contract event deliveries act for the subscriber, not the event's author.
38
+ * It's `undefined` in `onStart`, when no user identity is available, and on older hosts.
39
+ * Timers and owned-table watches have no caller of their own. A `ctx` captured by a callback
40
+ * keeps its original caller metadata, even after that call's authority has expired.
41
+ */
42
+ readonly callerUserId?: string;
30
43
  /** Run a tool on a contract this package consumes (or provides), as this call's caller. */
31
44
  callConsumedTool(contractId: string, version: number, toolName: string, args?: unknown, options?: IPackageProviderOptions): Promise<unknown>;
32
45
  /**
@@ -24,8 +24,12 @@ const system_ids_1 = require("../system-ids");
24
24
  const package_remote_checker_1 = require("./package-remote-checker");
25
25
  const package_seed_installer_1 = require("./package-seed-installer");
26
26
  const peers_core_trust_anchor_1 = require("./peers-core-trust-anchor");
27
+ // The name and description a new install's Package record gets. peers-core's id now holds only
28
+ // Tasks, but the name stays "peers-core": a dev build's source folder falls back to
29
+ // `~/peers/packages/<name-slug>` (`getPackageLocalPath`), which is the peers-core checkout. Rename
30
+ // it when Tasks gets a folder of its own. Existing records keep the name they were created with.
27
31
  const PEERS_CORE_NAME = "peers-core";
28
- const PEERS_CORE_DESCRIPTION = "Core system package for Peers platform";
32
+ const PEERS_CORE_DESCRIPTION = "Tasks, with subtasks, comments, repeats and a timer.";
29
33
  /**
30
34
  * Ensure peers-core is installed (with a usable, loaded version) in
31
35
  * `dataContext`, applying the layered strategy described in the module docs.
@@ -324,7 +324,8 @@ export interface IIsolatedContractProviderGateway {
324
324
  * Invoked only by the host for guest-originated gateway calls. The user id and
325
325
  * data context must come from authenticated host state, never guest payloads.
326
326
  * Return `undefined` when no signed-in identity is available; protected tools
327
- * then retain their existing missing-caller-identity denial.
327
+ * then retain their existing missing-caller-identity denial. Its user id is also a guest
328
+ * handler's `ctx.callerUserId` when the call's principal names no user.
328
329
  */
329
330
  export type IsolatedLocalUserContextResolver = () => {
330
331
  userId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peers-app/peers-sdk",
3
- "version": "0.31.3",
3
+ "version": "0.31.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/peers-app/peers-sdk.git"