@capybara-hq/kernel 0.1.0-rc.63 → 0.1.0-rc.64

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 (91) hide show
  1. package/dist/catalog/marketplaces.service.d.ts +1 -1
  2. package/dist/catalog/org-catalog.schemas.d.ts +1 -1
  3. package/dist/catalog/org-catalog.schemas.js +1 -1
  4. package/dist/channels/actions.d.ts +2 -5
  5. package/dist/channels/actions.js +20 -8
  6. package/dist/channels/cards.d.ts +4 -3
  7. package/dist/channels/cards.js +6 -4
  8. package/dist/channels/outbound.js +3 -2
  9. package/dist/config/schema.js +1 -1
  10. package/dist/conversations/approval-profile.d.ts +30 -0
  11. package/dist/conversations/approval-profile.js +62 -0
  12. package/dist/conversations/conversations.service.js +0 -2
  13. package/dist/conversations/events.d.ts +43 -0
  14. package/dist/conversations/events.js +52 -0
  15. package/dist/conversations/permission-profiles.controller.d.ts +3 -2
  16. package/dist/conversations/permission-profiles.service.d.ts +3 -2
  17. package/dist/conversations/permission-profiles.service.js +12 -8
  18. package/dist/db/kernel-schema.d.ts +4 -2
  19. package/dist/identity/initial-passwords.controller.d.ts +8 -6
  20. package/dist/identity/initial-passwords.controller.js +13 -7
  21. package/dist/identity/initial-passwords.d.ts +22 -13
  22. package/dist/identity/initial-passwords.js +25 -29
  23. package/dist/local-devices/relay.js +3 -1
  24. package/dist/models/images.js +5 -4
  25. package/dist/platform/connector-person-fields.js +2 -2
  26. package/dist/platform/exclusions.js +4 -4
  27. package/dist/platform/method.js +1 -1
  28. package/dist/platform/operation.d.ts +9 -7
  29. package/dist/platform/operation.js +1 -1
  30. package/dist/platform/ops/accounts.ops.d.ts +1 -1
  31. package/dist/platform/ops/accounts.ops.js +3 -3
  32. package/dist/platform/ops/channels.ops.d.ts +1 -1
  33. package/dist/platform/ops/channels.ops.js +2 -2
  34. package/dist/platform/ops/connectors.ops.d.ts +2 -2
  35. package/dist/platform/ops/connectors.ops.js +8 -8
  36. package/dist/platform/ops/extensions-admin.ops.d.ts +1 -1
  37. package/dist/platform/ops/extensions-admin.ops.js +3 -3
  38. package/dist/platform/ops/extensions.ops.d.ts +1 -1
  39. package/dist/platform/ops/extensions.ops.js +4 -4
  40. package/dist/platform/ops/org-plugins.ops.js +2 -2
  41. package/dist/platform/ops/orgs.ops.d.ts +1 -1
  42. package/dist/platform/ops/orgs.ops.js +3 -3
  43. package/dist/platform/ops/plugins.ops.d.ts +1 -1
  44. package/dist/platform/ops/plugins.ops.js +2 -2
  45. package/dist/platform/person-fields.d.ts +4 -3
  46. package/dist/platform/person-fields.js +6 -5
  47. package/dist/platform/sealed-inputs.d.ts +2 -2
  48. package/dist/platform/sealed-inputs.js +2 -2
  49. package/dist/platform/sealed-reveals.controller.d.ts +5 -8
  50. package/dist/platform/sealed-reveals.controller.js +8 -8
  51. package/dist/platform/sealed-reveals.d.ts +19 -17
  52. package/dist/platform/sealed-reveals.js +30 -33
  53. package/dist/runtime/context/build.js +3 -0
  54. package/dist/runtime/context/compaction.js +2 -0
  55. package/dist/runtime/waits.js +3 -2
  56. package/dist/sandbox/operation-authority.js +16 -15
  57. package/dist/sandbox/operation-intents.js +2 -2
  58. package/dist/sandbox/permission-availability.d.ts +49 -3
  59. package/dist/sandbox/permission-availability.js +61 -6
  60. package/dist/sandbox/permission-call-types.d.ts +3 -0
  61. package/dist/sandbox/permission-facts.d.ts +29 -1
  62. package/dist/sandbox/permission-facts.js +29 -6
  63. package/dist/sandbox/review/classifier.d.ts +72 -2
  64. package/dist/sandbox/review/classifier.js +113 -38
  65. package/dist/sandbox/review/index.d.ts +2 -2
  66. package/dist/sandbox/review/index.js +1 -1
  67. package/dist/sandbox/review/review.service.d.ts +1 -4
  68. package/dist/sandbox/review/review.service.js +4 -33
  69. package/dist/setup/setup-guides.service.js +1 -1
  70. package/dist/tools/approvals.service.d.ts +71 -16
  71. package/dist/tools/approvals.service.js +139 -13
  72. package/dist/tools/builtins/builtin-tools.d.ts +1 -1
  73. package/dist/tools/builtins/builtin-tools.js +12 -6
  74. package/dist/tools/builtins/platform.d.ts +15 -11
  75. package/dist/tools/builtins/platform.js +49 -39
  76. package/dist/tools/builtins/sandbox/bash.d.ts +1 -1
  77. package/dist/tools/builtins/sandbox/bash.js +32 -14
  78. package/dist/tools/builtins/sandbox/common.d.ts +12 -3
  79. package/dist/tools/builtins/sandbox/common.js +29 -5
  80. package/dist/tools/connectors.schemas.d.ts +1 -1
  81. package/dist/tools/connectors.schemas.js +1 -1
  82. package/dist/tools/pipeline.d.ts +70 -10
  83. package/dist/tools/pipeline.js +356 -48
  84. package/dist/tools/policy.d.ts +4 -3
  85. package/dist/tools/policy.js +6 -6
  86. package/dist/tools/registry.d.ts +25 -9
  87. package/dist/tools/tool-review.d.ts +113 -0
  88. package/dist/tools/tool-review.js +303 -0
  89. package/dist/tools/tools.module.js +6 -0
  90. package/package.json +4 -4
  91. package/src/migrations/0175_secure_input_kind.sql +8 -0
@@ -4,28 +4,36 @@ import { KernelDb } from "../infra/database/kernel-db.js";
4
4
  import { TransactionHost } from "../infra/database/transaction-host.js";
5
5
  import { type Account, AccountsService } from "./accounts.js";
6
6
  /**
7
- * How long a generated password waits for its reader. The approving person reads it right after
8
- * the call runs; one that is never read expires (the account can still be disabled and recreated).
7
+ * How long a generated password waits for its reader. The person the call was made for reads it
8
+ * right after the call runs; one that is never read expires (the account can still be disabled
9
+ * and recreated).
9
10
  */
10
11
  export declare const INITIAL_PASSWORD_TTL_MS: number;
11
- /** The tool key of the approval a generated password belongs to. */
12
- export declare const CREATE_ACCOUNT_TOOL_KEY = "Platform:accounts.create";
13
12
  /** A one-time initial password, cryptographically random. */
14
13
  export declare function generateInitialPassword(): string;
15
- /** Where a generated password is delivered: the approved tool call and the person who approved. */
14
+ /**
15
+ * The tool call a once-shown value (an initial password, an invitation link) was made by: a call
16
+ * id is unique only within its run.
17
+ */
18
+ export interface RevealCall {
19
+ conversationId: string;
20
+ runId: string;
21
+ callId: string;
22
+ }
23
+ /** Where a generated password is delivered: the tool call and the person it was made for. */
16
24
  export interface InitialPasswordDelivery {
17
25
  conversationId: string;
18
26
  /** The run of the call: a call id is unique only within its run. */
19
27
  runId: string;
20
28
  callId: string;
21
- /** The account that may read it: the actor who confirmed the call. */
29
+ /** The account that may read it: the person the call was made for (the run's own person). */
22
30
  recipientAccountId: string;
23
31
  }
24
32
  /**
25
33
  * Accounts created with a kernel-generated one-time password (Platform tool spec §14.5 item 2).
26
34
  * The password never leaves the kernel except through {@link reveal}: it is not returned to the
27
35
  * caller, not written to the audit, the event log or the logs. It is sealed with the master keyring
28
- * in the creation's transaction and read once, on the web, by the person who approved the call.
36
+ * in the creation's transaction and read once, on the web, by the person the call was made for.
29
37
  */
30
38
  export declare class InitialPasswords {
31
39
  private readonly db;
@@ -45,13 +53,14 @@ export declare class InitialPasswords {
45
53
  /** Stores the sealed password in the creation's transaction (the hourly job drops expired ones). */
46
54
  private seal;
47
55
  /**
48
- * The password created by an approved `accounts.create` call, read once by the person who
49
- * approved it (`approvalId` in `orgId`, decided by `accountId`), then deleted. Anything else (not
50
- * that person, not approved, not run yet, read already, expired) is
51
- * `account.initial_password_unavailable`, saying nothing about which. Audits the read (without
52
- * the password).
56
+ * The password created by an `accounts.create` call (`call` in `orgId`), read once by its
57
+ * recipient `accountId` while the call's conversation is still accessible to them, then deleted
58
+ * (plan ruling R6: read by call, whether the call ran under an approval or automatically).
59
+ * Anything else (not the recipient, the conversation not accessible, not run yet, read already,
60
+ * expired) is `account.initial_password_unavailable`, saying nothing about which. Audits the read
61
+ * (without the password).
53
62
  */
54
- reveal(orgId: string, approvalId: string, accountId: string): Promise<{
63
+ reveal(orgId: string, call: RevealCall, accountId: string): Promise<{
55
64
  accountId: string;
56
65
  login: string | null;
57
66
  password: string;
@@ -10,6 +10,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
10
10
  import { randomInt } from "node:crypto";
11
11
  import { Inject, Injectable } from "@nestjs/common";
12
12
  import { sql } from "kysely";
13
+ import { accessibleTo } from "../conversations/access.js";
13
14
  import { initialPasswordAad as aadOf } from "../ctx/secrets.js";
14
15
  import { ApiError } from "../errors.js";
15
16
  import { KernelDb } from "../infra/database/kernel-db.js";
@@ -23,12 +24,11 @@ const ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
23
24
  /** 20 characters of 56: about 116 bits. */
24
25
  const LENGTH = 20;
25
26
  /**
26
- * How long a generated password waits for its reader. The approving person reads it right after
27
- * the call runs; one that is never read expires (the account can still be disabled and recreated).
27
+ * How long a generated password waits for its reader. The person the call was made for reads it
28
+ * right after the call runs; one that is never read expires (the account can still be disabled
29
+ * and recreated).
28
30
  */
29
31
  export const INITIAL_PASSWORD_TTL_MS = 24 * 60 * 60 * 1000;
30
- /** The tool key of the approval a generated password belongs to. */
31
- export const CREATE_ACCOUNT_TOOL_KEY = "Platform:accounts.create";
32
32
  /** A one-time initial password, cryptographically random. */
33
33
  export function generateInitialPassword() {
34
34
  let out = "";
@@ -40,7 +40,7 @@ export function generateInitialPassword() {
40
40
  * Accounts created with a kernel-generated one-time password (Platform tool spec §14.5 item 2).
41
41
  * The password never leaves the kernel except through {@link reveal}: it is not returned to the
42
42
  * caller, not written to the audit, the event log or the logs. It is sealed with the master keyring
43
- * in the creation's transaction and read once, on the web, by the person who approved the call.
43
+ * in the creation's transaction and read once, on the web, by the person the call was made for.
44
44
  */
45
45
  let InitialPasswords = class InitialPasswords {
46
46
  db;
@@ -82,35 +82,31 @@ let InitialPasswords = class InitialPasswords {
82
82
  .execute();
83
83
  }
84
84
  /**
85
- * The password created by an approved `accounts.create` call, read once by the person who
86
- * approved it (`approvalId` in `orgId`, decided by `accountId`), then deleted. Anything else (not
87
- * that person, not approved, not run yet, read already, expired) is
88
- * `account.initial_password_unavailable`, saying nothing about which. Audits the read (without
89
- * the password).
85
+ * The password created by an `accounts.create` call (`call` in `orgId`), read once by its
86
+ * recipient `accountId` while the call's conversation is still accessible to them, then deleted
87
+ * (plan ruling R6: read by call, whether the call ran under an approval or automatically).
88
+ * Anything else (not the recipient, the conversation not accessible, not run yet, read already,
89
+ * expired) is `account.initial_password_unavailable`, saying nothing about which. Audits the read
90
+ * (without the password).
90
91
  */
91
- async reveal(orgId, approvalId, accountId) {
92
- const unavailable = () => new ApiError("account.initial_password_unavailable", "No initial password to show: it was shown already, has expired, or the account was not created by a call you approved");
93
- const approval = await this.db
94
- .selectFrom("approvals")
95
- .select(["conversation_id", "run_id", "call_id", "tool_key", "status", "decided_by"])
96
- .where("id", "=", approvalId)
97
- .where("org_id", "=", orgId)
98
- .executeTakeFirst();
99
- if (approval === undefined ||
100
- approval.tool_key !== CREATE_ACCOUNT_TOOL_KEY ||
101
- approval.status !== "approved" ||
102
- approval.decided_by !== accountId) {
103
- throw unavailable();
104
- }
105
- // exactly the row of this approval's call: locked, then deleted by its key
92
+ async reveal(orgId, call, accountId) {
93
+ const unavailable = () => new ApiError("account.initial_password_unavailable", "No initial password to show: it was shown already, has expired, or the account was not created by a call made for you");
94
+ // exactly the row of this call, for its recipient in a conversation of this org they can
95
+ // still see: locked, then deleted by its key
106
96
  const found = await this.db
107
97
  .selectFrom("account_initial_passwords")
108
98
  .select("account_id")
109
- .where("conversation_id", "=", approval.conversation_id)
110
- .where("run_id", "=", approval.run_id)
111
- .where("call_id", "=", approval.call_id)
99
+ .where("conversation_id", "=", call.conversationId)
100
+ .where("run_id", "=", call.runId)
101
+ .where("call_id", "=", call.callId)
112
102
  .where("recipient_account_id", "=", accountId)
113
103
  .where("expires_at", ">", sql `now()`)
104
+ .where((eb) => eb.exists(eb
105
+ .selectFrom("conversations")
106
+ .select("conversations.id")
107
+ .whereRef("conversations.id", "=", "account_initial_passwords.conversation_id")
108
+ .where("conversations.org_id", "=", orgId)
109
+ .where(accessibleTo(accountId))))
114
110
  .limit(1)
115
111
  .forUpdate()
116
112
  .executeTakeFirst();
@@ -132,7 +128,7 @@ let InitialPasswords = class InitialPasswords {
132
128
  orgId,
133
129
  action: "account.initial_password_shown",
134
130
  target: row.account_id,
135
- detail: { approvalId },
131
+ detail: { conversationId: call.conversationId, runId: call.runId, callId: call.callId },
136
132
  });
137
133
  return { accountId: row.account_id, login, password };
138
134
  }
@@ -8,7 +8,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
8
  return function (target, key) { decorator(target, key, paramIndex); }
9
9
  };
10
10
  import { randomUUID } from "node:crypto";
11
- import { DeviceProtocolError, FileSystemGoneError, parseDeviceFrame, parseLegacyDeviceFrame, parseOperationResult, parseOpResult, SandboxGoneError, SandboxOperationOutcomeUnknownError, SandboxPermissionUnsupportedError, SandboxScopeDeniedError, SandboxScopeValidationError, ToolError, } from "@capybara-hq/plugin-sdk";
11
+ import { DeviceProtocolError, FileSystemGoneError, parseDeviceFrame, parseLegacyDeviceFrame, parseOperationResult, parseOpResult, SandboxGoneError, SandboxOperationOutcomeUnknownError, SandboxPermissionUnsupportedError, SandboxScopeDeniedError, SandboxScopeValidationError, SandboxWorkUnsettledError, ToolError, } from "@capybara-hq/plugin-sdk";
12
12
  import { Inject, Injectable } from "@nestjs/common";
13
13
  import { machineRevoked } from "../devices/errors.js";
14
14
  import { ApiError } from "../errors.js";
@@ -530,6 +530,8 @@ let LocalDeviceRelay = class LocalDeviceRelay {
530
530
  throw new SandboxScopeDeniedError(message);
531
531
  case "unsupported":
532
532
  throw new SandboxPermissionUnsupportedError(message);
533
+ case "unsettled":
534
+ throw new SandboxWorkUnsettledError(message);
533
535
  case "unknown":
534
536
  throw new SandboxOperationOutcomeUnknownError(message);
535
537
  case "invalid":
@@ -298,10 +298,11 @@ let ModelImages = class ModelImages {
298
298
  }
299
299
  signal.throwIfAborted();
300
300
  const sentAt = Date.now();
301
- const respond = (r) => {
301
+ // the caller measures the latency once, so the hook payload and the result report the same value
302
+ const respond = (r, latencyMs) => {
302
303
  if (!hooks)
303
304
  return;
304
- fireObserve(hooks, "model.response", { ...base, ...identity, ...r, latencyMs: Date.now() - sentAt }, signal, this.log);
305
+ fireObserve(hooks, "model.response", { ...base, ...identity, ...r, latencyMs }, signal, this.log);
305
306
  };
306
307
  let res;
307
308
  try {
@@ -319,7 +320,7 @@ let ModelImages = class ModelImages {
319
320
  images: [],
320
321
  usage: null,
321
322
  errorCode: isModelError(err) ? `model.${err.kind}` : "model.unknown",
322
- });
323
+ }, Date.now() - sentAt);
323
324
  }
324
325
  throw err;
325
326
  }
@@ -329,7 +330,7 @@ let ModelImages = class ModelImages {
329
330
  images: res.images.map((i) => ({ mediaType: i.mediaType, size: base64Bytes(i.data) })),
330
331
  ...(typeof res.revisedPrompt === "string" && { revisedPrompt: res.revisedPrompt }),
331
332
  usage: res.usage ?? null,
332
- });
333
+ }, latencyMs);
333
334
  return { ...res, latencyMs };
334
335
  }
335
336
  /**
@@ -109,7 +109,7 @@ export function templateConnectorInput(t, params, entered) {
109
109
  */
110
110
  export function headersWebOnly(auth, where) {
111
111
  return auth.type === "headers"
112
- ? `${where} authenticates with custom headers, whose values the confirmation card cannot ask for; the person enters them on the web.`
112
+ ? `${where} authenticates with custom headers, whose values a secure input request cannot ask for; the person enters them on the web.`
113
113
  : null;
114
114
  }
115
115
  /**
@@ -120,7 +120,7 @@ export function headersWebOnly(auth, where) {
120
120
  export function clientProblem(auth, client, where) {
121
121
  const needs = auth.type === "oauth_client" || (auth.type === "oauth_code" && auth.client === "manual");
122
122
  if (needs && client === undefined) {
123
- return `${where} uses an OAuth client: pass its id in client (the person enters the client secret on the confirmation card)`;
123
+ return `${where} uses an OAuth client: pass its id in client (the person enters the client secret in a secure input request)`;
124
124
  }
125
125
  if (!needs && client !== undefined) {
126
126
  return `${where} takes no OAuth client (auth ${auth.type}${auth.type === "oauth_code" ? " with a registered client" : ""}); leave client out`;
@@ -395,14 +395,14 @@ export const PLATFORM_EXCLUSIONS = [
395
395
  },
396
396
  // identity
397
397
  {
398
- route: "POST /api/v1/orgs/:orgId/approvals/:approvalId/initial-password",
398
+ route: "POST /api/v1/orgs/:orgId/conversations/:conversationId/runs/:runId/calls/:callId/initial-password",
399
399
  category: "secret",
400
- reason: "Returns a generated initial password once, on the web, to the person who approved the account creation",
400
+ reason: "Returns a generated initial password once, on the web, to the person the account creation call was made for",
401
401
  },
402
402
  {
403
- route: "POST /api/v1/orgs/:orgId/approvals/:approvalId/invitation-link",
403
+ route: "POST /api/v1/orgs/:orgId/conversations/:conversationId/runs/:runId/calls/:callId/invitation-link",
404
404
  category: "secret",
405
- reason: "Returns an invitation link once, on the web, to the person who approved the orgs.invite call",
405
+ reason: "Returns an invitation link once, on the web, to the person the orgs.invite call was made for",
406
406
  },
407
407
  { route: "POST /api/v1/auth/login", category: "human-only", reason: "Password login" },
408
408
  { route: "POST /api/v1/auth/refresh", category: "human-only", reason: "Rotates a refresh token" },
@@ -11,6 +11,6 @@ export const PLATFORM_METHOD = [
11
11
  "4. An operation you may not call is not a dead end: its reason says who can (an org admin, the super admin) and whether a request operation exists; offer that.",
12
12
  "5. Errors say what to do next; follow them.",
13
13
  '6. When unsure how the platform works, use action "read" for the docs before acting.',
14
- "Secret fields (API keys, tokens, passwords, credentials) never go in params: list their dot paths in askPerson and the person types them on the confirmation card; list the stored secrets to remove in clearSecrets. Required secrets without a stored value are asked even when not listed. The result names each field the person entered, never its value. A secret that appeared in the conversation counts as leaked: tell the person to rotate it.",
14
+ "Secret fields (API keys, tokens, passwords, credentials) never go in params: list their dot paths in askPerson and the person types them in a secure input request, which you never see; list the stored secrets to remove in clearSecrets. Required secrets without a stored value are asked even when not listed. The result names each field the person entered, never its value. A secret that appeared in the conversation counts as leaked: tell the person to rotate it.",
15
15
  'Find an operation with "browse" (a domain) or "search": each lists its input keys in "params" ("?" marks an optional key, an id key takes the id field of the matching list or get result). "describe" gives the types, bounds and an example; describe before a call whose params you are unsure of, and never guess a key that params does not list.',
16
16
  ].join("\n");
@@ -37,8 +37,8 @@ export interface OperationContext {
37
37
  */
38
38
  errorRole?: ErrorRole;
39
39
  /**
40
- * The values the person typed on the approval card for this call's secret fields (platform web
41
- * parity spec §4.3): present only when the approved call asked for person fields. `paths` are the
40
+ * The values the person typed in the secure input request for this call's secret fields
41
+ * (platform web parity spec §4.3): present only when the call asked for person fields. `paths` are the
42
42
  * asked fields; `apply` consumes the sealed values once and runs `fn` with them in the same
43
43
  * transaction (a throw puts them back), so the handler passes them to the route's service method
44
44
  * inside `fn`. The values never go into the result: the tool appends a line per entered path.
@@ -152,12 +152,14 @@ export interface PlatformOperation<I = unknown> {
152
152
  */
153
153
  rememberable?: false;
154
154
  /**
155
- * `true`: the write's result is shown once, on the web, to the person who approves the call (an
156
- * invitation link, a generated initial password), so only the person the run works for may
157
- * confirm it: the call always asks them (never a grant, an `allow`, a role escalation) and is
158
- * refused in an unattended run (`CallPolicy.personOnly`, like person fields, ruling R6).
155
+ * The write's result is shown once, on the web, to the person the call is made for (an
156
+ * invitation link, a generated initial password), read by the call (profiles govern every
157
+ * approval, R6); the value names which, and the tool result carries the reveal view. Only the
158
+ * person the run works for may consent to it: the call always asks them (never a grant, an
159
+ * `allow`, a role escalation; the conversation's profile decides the ask) and is refused in an
160
+ * unattended run (`CallPolicy.personOnly`).
159
161
  */
160
- revealsToApprover?: true;
162
+ revealsOnce?: "initial_password" | "invitation_link";
161
163
  /**
162
164
  * The class of one call when it depends on the target (read at confirmation time): e.g.
163
165
  * `agents.update` is `personal` only on a private agent the actor owns and `org` otherwise, so a
@@ -41,7 +41,7 @@ export const PLATFORM_DOMAINS = [
41
41
  },
42
42
  {
43
43
  id: "extensions",
44
- description: "Extensions in the org (state, tool switches, extension point defaults, file previewers, the org config and the org's copy of platform config) and, for the super admin, on the platform (state, deployment config, pending permission confirmations, enable, disable, uninstall). Secrets are entered by the person on the confirmation card.",
44
+ description: "Extensions in the org (state, tool switches, extension point defaults, file previewers, the org config and the org's copy of platform config) and, for the super admin, on the platform (state, deployment config, pending permission confirmations, enable, disable, uninstall). Secrets are entered by the person in a secure input request.",
45
45
  },
46
46
  {
47
47
  id: "conversations",
@@ -6,7 +6,7 @@ import { SessionService } from "../../identity/sessions.js";
6
6
  import { OrgsService } from "../../orgs/orgs.service.js";
7
7
  import { PlatformOperations } from "../registry.js";
8
8
  /** What the tool result says instead of the password (model-visible English). */
9
- export declare const INITIAL_PASSWORD_NOTE = "The kernel generated a one-time initial password. It is shown once, on the web, to the person who approved this call (the approval card in this conversation), and is not available in this conversation. The account must change it at first sign-in.";
9
+ export declare const INITIAL_PASSWORD_NOTE = "The kernel generated a one-time initial password. It is shown once, on the web, to the person this call was made for, under the tool call in this conversation, and never to you. The account must change it at first sign-in.";
10
10
  /**
11
11
  * Account operations of the `Platform` tool (spec §14.2, admin console): the super admin lists,
12
12
  * reads, creates, disables and enables accounts, only through their own private agent
@@ -23,7 +23,7 @@ import { named } from "./summary.js";
23
23
  const PAGE = 50;
24
24
  const AccountId = AccountParams.shape.accountId.describe("The account id (accounts.list).");
25
25
  /** What the tool result says instead of the password (model-visible English). */
26
- export const INITIAL_PASSWORD_NOTE = "The kernel generated a one-time initial password. It is shown once, on the web, to the person who approved this call (the approval card in this conversation), and is not available in this conversation. The account must change it at first sign-in.";
26
+ export const INITIAL_PASSWORD_NOTE = "The kernel generated a one-time initial password. It is shown once, on the web, to the person this call was made for, under the tool call in this conversation, and never to you. The account must change it at first sign-in.";
27
27
  /** An account as a detail returns it (the admin console's account fields). */
28
28
  const accountView = (a, login) => ({
29
29
  id: a.id,
@@ -182,7 +182,7 @@ let AccountsOperations = class AccountsOperations {
182
182
  }),
183
183
  defineOperation({
184
184
  id: "accounts.create",
185
- description: "Create a local sign-in account (super admin): a login (3-64 characters: letters, digits, . _ @ + -), a display name and an optional email. You pass no password: the kernel generates a one-time initial password, shows it once to the person who approves this call, on the web (the approval card); it is lost if not read within 24 hours (then disable the account and create it again). The account must change it at first sign-in. The account is never a super admin; that and org memberships are set by a person on the web (add it to an org with an invitation).",
185
+ description: "Create a local sign-in account (super admin): a login (3-64 characters: letters, digits, . _ @ + -), a display name and an optional email. You pass no password: the kernel generates a one-time initial password, shows it once, on the web, to the person the call is made for (under the tool call in the conversation), never to you; it is lost if not read within 24 hours (then disable the account and create it again). The account must change it at first sign-in. The account is never a super admin; that and org memberships are set by a person on the web (add it to an org with an invitation).",
186
186
  input: CreateAccountBody.pick({ login: true, displayName: true, email: true }).strict(),
187
187
  example: { login: "alice", displayName: "Alice Chen", email: "alice@example.com" },
188
188
  authz: { superAdmin: true },
@@ -190,7 +190,7 @@ let AccountsOperations = class AccountsOperations {
190
190
  // the password is generated by the kernel; the super-admin flag is a role change (human-only)
191
191
  omits: ["password", "superAdmin"],
192
192
  confirm: "platform",
193
- revealsToApprover: true,
193
+ revealsOnce: "initial_password",
194
194
  errors: [
195
195
  {
196
196
  code: "account.login_taken",
@@ -7,7 +7,7 @@ import { PlatformOperations } from "../registry.js";
7
7
  * Channel connection operations of the `Platform` tool (spec §14): read a connection and change
8
8
  * its binding (which agent answers, what happens to unbound people, on / off, inbound mode),
9
9
  * or remove it. Creating a connection takes the channel's secrets as person fields (the person types
10
- * them on the confirmation card; platform web parity spec §4, §7.2); changing the credentials or
10
+ * them in a secure input request; platform web parity spec §4, §7.2); changing the credentials or
11
11
  * the config of a connection stays on the web.
12
12
  */
13
13
  export declare class ChannelsOperations implements OnModuleInit {
@@ -48,7 +48,7 @@ const detail = (c) => ({
48
48
  * Channel connection operations of the `Platform` tool (spec §14): read a connection and change
49
49
  * its binding (which agent answers, what happens to unbound people, on / off, inbound mode),
50
50
  * or remove it. Creating a connection takes the channel's secrets as person fields (the person types
51
- * them on the confirmation card; platform web parity spec §4, §7.2); changing the credentials or
51
+ * them in a secure input request; platform web parity spec §4, §7.2); changing the credentials or
52
52
  * the config of a connection stays on the web.
53
53
  */
54
54
  let ChannelsOperations = class ChannelsOperations {
@@ -139,7 +139,7 @@ let ChannelsOperations = class ChannelsOperations {
139
139
  }),
140
140
  defineOperation({
141
141
  id: "channels.create",
142
- description: "Create a channel connection (IM bot) in the org (org admins): plugin, name, the agent that answers (agentId) and values, the non-secret connection config (read the fields with channels.schema). Secret fields (app secrets, tokens) are never in values: list them in askPerson and the person types them on the confirmation card (on the web); required secrets are asked even when not listed. The plugin verifies the credentials before anything is saved. Turn on webhook inbound with inboundMode webhook (only where supported); a setup guide, if any, is in channels.schema.",
142
+ description: "Create a channel connection (IM bot) in the org (org admins): plugin, name, the agent that answers (agentId) and values, the non-secret connection config (read the fields with channels.schema). Secret fields (app secrets, tokens) are never in values: list them in askPerson and the person types them in a secure input request (on the web); required secrets are asked even when not listed. The plugin verifies the credentials before anything is saved. Turn on webhook inbound with inboundMode webhook (only where supported); a setup guide, if any, is in channels.schema.",
143
143
  input: z
144
144
  .object({
145
145
  plugin: ChannelCreateSchema.shape.plugin,
@@ -10,8 +10,8 @@ export declare const CONNECT_SHOWN_TEXT = "The person was shown a Connect button
10
10
  * Connector operations of the `Platform` tool (spec §7; platform web parity spec §7.2): reads,
11
11
  * the kinds and a preview, creating a connector (custom or from a platform template), editing it,
12
12
  * credentials, the setup guide acknowledgement, deleting and refreshing. Credentials are person
13
- * fields (ruling R3): the model names them in `askPerson`, the person types them on the
14
- * confirmation card, and the write gets them only through `personInputs`. Per-tool policies stay
13
+ * fields (ruling R3): the model names them in `askPerson`, the person types them in a secure
14
+ * input request, and the write gets them only through `personInputs`. Per-tool policies stay
15
15
  * on the web (ruling R4: the agent's own permissions).
16
16
  */
17
17
  export declare class ConnectorsOperations implements OnModuleInit {
@@ -36,7 +36,7 @@ const EXAMPLE_ID = "5d2e8f1a-0b3c-4d5e-8f9a-1b2c3d4e5f60";
36
36
  const ClientParam = z
37
37
  .object({ clientId: z.string().min(1).max(500) })
38
38
  .strict()
39
- .describe("The OAuth client registered at the authorization server (oauth_client, or oauth_code with client manual): its id; the person enters the client secret on the confirmation card.");
39
+ .describe("The OAuth client registered at the authorization server (oauth_client, or oauth_code with client manual): its id; the person enters the client secret in a secure input request.");
40
40
  /** `connectors.create`: the create body without the credential, the client id and askPerson. */
41
41
  const CreateInput = ConnectorCreateSchema.omit({ credential: true })
42
42
  .extend({ client: ClientParam.optional(), askPerson: personFieldParams.askPerson })
@@ -137,8 +137,8 @@ const detail = (c) => ({
137
137
  * Connector operations of the `Platform` tool (spec §7; platform web parity spec §7.2): reads,
138
138
  * the kinds and a preview, creating a connector (custom or from a platform template), editing it,
139
139
  * credentials, the setup guide acknowledgement, deleting and refreshing. Credentials are person
140
- * fields (ruling R3): the model names them in `askPerson`, the person types them on the
141
- * confirmation card, and the write gets them only through `personInputs`. Per-tool policies stay
140
+ * fields (ruling R3): the model names them in `askPerson`, the person types them in a secure
141
+ * input request, and the write gets them only through `personInputs`. Per-tool policies stay
142
142
  * on the web (ruling R4: the agent's own permissions).
143
143
  */
144
144
  let ConnectorsOperations = class ConnectorsOperations {
@@ -224,7 +224,7 @@ let ConnectorsOperations = class ConnectorsOperations {
224
224
  }),
225
225
  defineOperation({
226
226
  id: "connectors.get",
227
- description: "Read one connector: its tools with their state and default policy, whether your credential for it is connected, and for one made from a template its setup guide (version, hash for connectors.guide-ack, and whether the guide changed since it was set up). Credentials are never returned: the person enters them on the confirmation card of connectors.set-org-credential or connectors.set-my-credential.",
227
+ description: "Read one connector: its tools with their state and default policy, whether your credential for it is connected, and for one made from a template its setup guide (version, hash for connectors.guide-ack, and whether the guide changed since it was set up). Credentials are never returned: the person enters them in the secure input request of connectors.set-org-credential or connectors.set-my-credential.",
228
228
  input: z.object({ connectorId: ConnectorPathParams.shape.connectorId.max(100) }).strict(),
229
229
  example: { connectorId: "5d2e8f1a-0b3c-4d5e-8f9a-1b2c3d4e5f60" },
230
230
  authz: { orgAction: "connectors.use" },
@@ -413,7 +413,7 @@ let ConnectorsOperations = class ConnectorsOperations {
413
413
  }),
414
414
  defineOperation({
415
415
  id: "connectors.create",
416
- description: "Create a custom connector (org admins): name, connector kind (connectors.kinds), endpoint and auth method; it connects, lists the tools and stores them for review. The credential is never a param: the person enters it on the confirmation card (bearer and api_key: credential.token; basic: credential.username and credential.password; oauth_client, or oauth_code with client manual: client.clientSecret, with the client id in client). Required credential fields are asked even when not listed in askPerson. Custom header credentials are entered on the web. Preview first with connectors.preview.",
416
+ description: "Create a custom connector (org admins): name, connector kind (connectors.kinds), endpoint and auth method; it connects, lists the tools and stores them for review. The credential is never a param: the person enters it in a secure input request (bearer and api_key: credential.token; basic: credential.username and credential.password; oauth_client, or oauth_code with client manual: client.clientSecret, with the client id in client). Required credential fields are asked even when not listed in askPerson. Custom header credentials are entered on the web. Preview first with connectors.preview.",
417
417
  input: CreateInput,
418
418
  example: {
419
419
  name: "Docs",
@@ -529,7 +529,7 @@ let ConnectorsOperations = class ConnectorsOperations {
529
529
  }),
530
530
  defineOperation({
531
531
  id: "connectors.set-org-credential",
532
- description: "Replace the org's credential of an org-credential connector (org admins): the person enters it on the confirmation card (bearer and api_key: credential.token; basic: credential.username and credential.password). For an OAuth connector it replaces the OAuth client: pass its id in client, the person enters client.clientSecret. Every field of the credential is asked. Custom header credentials are entered by a person in the connector's settings in the web app.",
532
+ description: "Replace the org's credential of an org-credential connector (org admins): the person enters it in a secure input request (bearer and api_key: credential.token; basic: credential.username and credential.password). For an OAuth connector it replaces the OAuth client: pass its id in client, the person enters client.clientSecret. Every field of the credential is asked. Custom header credentials are entered by a person in the connector's settings in the web app.",
533
533
  input: z
534
534
  .object({
535
535
  connectorId: ConnectorId,
@@ -603,7 +603,7 @@ let ConnectorsOperations = class ConnectorsOperations {
603
603
  }),
604
604
  defineOperation({
605
605
  id: "connectors.set-my-credential",
606
- description: "Set your own credential for a connector that uses each member's own credential: you enter it on the confirmation card (bearer and api_key: credential.token; basic: credential.username and credential.password). An OAuth connector is connected with connectors.connect instead (it shows the person a Connect button). Every field of the credential is asked.",
606
+ description: "Set your own credential for a connector that uses each member's own credential: the person enters it in a secure input request (bearer and api_key: credential.token; basic: credential.username and credential.password). An OAuth connector is connected with connectors.connect instead (it shows the person a Connect button). Every field of the credential is asked.",
607
607
  input: z
608
608
  .object({ connectorId: ConnectorId, askPerson: personFieldParams.askPerson })
609
609
  .strict(),
@@ -749,7 +749,7 @@ let ConnectorsOperations = class ConnectorsOperations {
749
749
  }),
750
750
  defineOperation({
751
751
  id: "connectors.add-from-template",
752
- description: "Create one more connector from a platform connector template that is on in the org (org admins; connectors.templates lists them): an optional name and slug (defaults: the first free ones), the endpoint fields the template lets the org edit, and for an OAuth template the client id in client. The credential is never a param: the person enters it on the confirmation card (credential.token; credential.username and credential.password; client.clientSecret). Required credential fields are asked even when not listed in askPerson.",
752
+ description: "Create one more connector from a platform connector template that is on in the org (org admins; connectors.templates lists them): an optional name and slug (defaults: the first free ones), the endpoint fields the template lets the org edit, and for an OAuth template the client id in client. The credential is never a param: the person enters it in a secure input request (credential.token; credential.username and credential.password; client.clientSecret). Required credential fields are asked even when not listed in askPerson.",
753
753
  input: FromTemplateInput,
754
754
  example: {
755
755
  templateId: "3f1c2a9e-5b7d-4e21-9c0a-1d2e3f4a5b6c",
@@ -24,7 +24,7 @@ export declare function deploymentPersonFields(v: DeploymentConfigView, named?:
24
24
  * §14.5 item 1): the deployment's extensions (list, read), enable, disable and uninstall, and
25
25
  * storing an uploaded package (its review). Installing a package and approving permissions stay on
26
26
  * the web: a person reviews the permissions there. The deployment config is read (secrets as set or not) and written here, its
27
- * secrets entered by the person on the confirmation card (platform web parity spec §4).
27
+ * secrets entered by the person in a secure input request (platform web parity spec §4).
28
28
  */
29
29
  export declare class ExtensionsAdminOperations implements OnModuleInit {
30
30
  private readonly registry;
@@ -135,7 +135,7 @@ const pendingPlugin = (i) => ({
135
135
  * §14.5 item 1): the deployment's extensions (list, read), enable, disable and uninstall, and
136
136
  * storing an uploaded package (its review). Installing a package and approving permissions stay on
137
137
  * the web: a person reviews the permissions there. The deployment config is read (secrets as set or not) and written here, its
138
- * secrets entered by the person on the confirmation card (platform web parity spec §4).
138
+ * secrets entered by the person in a secure input request (platform web parity spec §4).
139
139
  */
140
140
  let ExtensionsAdminOperations = class ExtensionsAdminOperations {
141
141
  registry;
@@ -529,7 +529,7 @@ let ExtensionsAdminOperations = class ExtensionsAdminOperations {
529
529
  }),
530
530
  defineOperation({
531
531
  id: "extensions.platform-set-config",
532
- description: "Save fields of an extension's deployment config (super admin): values maps field dot paths to new values (null clears a non-secret field; a field left out keeps its value). Secret fields are never in values: list them in askPerson and the person types them on the confirmation card (on the web); list stored secrets to empty in clearSecrets. Required secrets without a stored value are asked even when not listed. Every replica applies the saved config without a restart. Read the fields first with extensions.platform-config.",
532
+ description: "Save fields of an extension's deployment config (super admin): values maps field dot paths to new values (null clears a non-secret field; a field left out keeps its value). Secret fields are never in values: list them in askPerson and the person types them in a secure input request (on the web); list stored secrets to empty in clearSecrets. Required secrets without a stored value are asked even when not listed. Every replica applies the saved config without a restart. Read the fields first with extensions.platform-config.",
533
533
  input: z
534
534
  .object({
535
535
  name: Name,
@@ -615,7 +615,7 @@ let ExtensionsAdminOperations = class ExtensionsAdminOperations {
615
615
  }),
616
616
  defineOperation({
617
617
  id: "extensions.platform-guides",
618
- description: "Read an extension's platform setup guides (super admin): the guides it ships for its deployment config (for example a push provider's credentials), rendered with the steps and the checks as check rows (run them with extensions.platform-check). Secrets are never in a guide: the person types each one into the deployment config form in the admin console (Extensions → the extension), or on the confirmation card of extensions.platform-set-config. Empty when the extension ships none.",
618
+ description: "Read an extension's platform setup guides (super admin): the guides it ships for its deployment config (for example a push provider's credentials), rendered with the steps and the checks as check rows (run them with extensions.platform-check). Secrets are never in a guide: the person types each one into the deployment config form in the admin console (Extensions → the extension), or in the secure input request of extensions.platform-set-config. Empty when the extension ships none.",
619
619
  input: DeploymentGuidesPathParams.extend(DeploymentGuidesQuery.shape).strict(),
620
620
  example: { name: "push-apns" },
621
621
  authz: { superAdmin: true },
@@ -19,7 +19,7 @@ export declare function copyPersonFields(v: OrgOverrideView): Pick<PersonFieldTa
19
19
  * of `GET /orgs/:orgId/extensions`, whatever the actor's role), their tool switches and point
20
20
  * defaults, and for org admins the org config and the org's copy of overridable platform fields
21
21
  * (read, write, take, save, drop; platform web parity spec §7.2). Secrets are never returned (only
22
- * whether each is set) and never taken as params: the person enters them on the confirmation card.
22
+ * whether each is set) and never taken as params: the person enters them in a secure input request.
23
23
  */
24
24
  export declare class ExtensionsOperations implements OnModuleInit {
25
25
  private readonly registry;
@@ -37,7 +37,7 @@ const Tool = OrgExtensionToolParams.shape.tool;
37
37
  const SwitchConfirm = OrgToolSwitchPut.shape.confirm.unwrap();
38
38
  /** The next step of an extension that needs its org config. */
39
39
  const NEEDS_ORG_CONFIG = {
40
- orgAdmin: "Read what is missing with extensions.org-config, then fill it in with extensions.set-org-config (or the org's own copy of overridable platform fields with extensions.save-org-config); the person enters secrets on the confirmation card.",
40
+ orgAdmin: "Read what is missing with extensions.org-config, then fill it in with extensions.set-org-config (or the org's own copy of overridable platform fields with extensions.save-org-config); the person enters secrets in a secure input request.",
41
41
  member: "Ask an org admin to fill in its org config on the Extensions page.",
42
42
  };
43
43
  /** The org config a write replaces (the whole non-secret config; secrets left out keep). */
@@ -82,7 +82,7 @@ function stateOf(v) {
82
82
  * of `GET /orgs/:orgId/extensions`, whatever the actor's role), their tool switches and point
83
83
  * defaults, and for org admins the org config and the org's copy of overridable platform fields
84
84
  * (read, write, take, save, drop; platform web parity spec §7.2). Secrets are never returned (only
85
- * whether each is set) and never taken as params: the person enters them on the confirmation card.
85
+ * whether each is set) and never taken as params: the person enters them in a secure input request.
86
86
  */
87
87
  let ExtensionsOperations = class ExtensionsOperations {
88
88
  registry;
@@ -307,7 +307,7 @@ let ExtensionsOperations = class ExtensionsOperations {
307
307
  }),
308
308
  defineOperation({
309
309
  id: "extensions.set-org-config",
310
- description: "Save an extension's org config (org admins): values is the whole non-secret config and replaces the stored one (read it first with extensions.org-config and keep the fields you do not change). Secret fields are never in values: list them in askPerson and the person types them on the confirmation card (on the web); a secret not listed keeps its stored value; list stored secrets to empty in clearSecrets. Required secrets without a stored value are asked even when not listed. For overridable fields of the platform's deployment config (an org's own API key for a model provider, say) use extensions.save-org-config. Switching the extension on is plugins.set-enabled.",
310
+ description: "Save an extension's org config (org admins): values is the whole non-secret config and replaces the stored one (read it first with extensions.org-config and keep the fields you do not change). Secret fields are never in values: list them in askPerson and the person types them in a secure input request (on the web); a secret not listed keeps its stored value; list stored secrets to empty in clearSecrets. Required secrets without a stored value are asked even when not listed. For overridable fields of the platform's deployment config (an org's own API key for a model provider, say) use extensions.save-org-config. Switching the extension on is plugins.set-enabled.",
311
311
  input: z
312
312
  .object({
313
313
  extension: Extension,
@@ -376,7 +376,7 @@ let ExtensionsOperations = class ExtensionsOperations {
376
376
  }),
377
377
  defineOperation({
378
378
  id: "extensions.save-org-config",
379
- description: "Save fields of the org's own copy of an extension's platform deployment config (org admins): only overridable fields (extensions.org-config lists them under deploymentCopy). values maps field dot paths to values (null clears; a field left out keeps). Secret fields are never in values: list them in askPerson and the person types them on the confirmation card (on the web); list stored secrets to empty in clearSecrets. The first save makes the copy from the platform's non-secret values and must be valid on its own (its required secrets are asked).",
379
+ description: "Save fields of the org's own copy of an extension's platform deployment config (org admins): only overridable fields (extensions.org-config lists them under deploymentCopy). values maps field dot paths to values (null clears; a field left out keeps). Secret fields are never in values: list them in askPerson and the person types them in a secure input request (on the web); list stored secrets to empty in clearSecrets. The first save makes the copy from the platform's non-secret values and must be valid on its own (its required secrets are asked).",
380
380
  input: z
381
381
  .object({
382
382
  extension: Extension,
@@ -612,7 +612,7 @@ let OrgPluginsOperations = class OrgPluginsOperations {
612
612
  }),
613
613
  defineOperation({
614
614
  id: "plugins.install",
615
- description: "Install a plugin in this org with its inputs (org admins; the web's install wizard): per connector template the connector's name, slug, endpoint fields and OAuth client id (templates), and the extension's org config without secrets (extensionConfig). Secrets are never params: the person enters them on the confirmation card, at connectors.<templateId>.credential.token (or .credential.username / .credential.password, .client.clientSecret) and extensionConfig.<field>. Required ones are asked even when not listed in askPerson. A plugin that needs no input is switched on with plugins.set-enabled instead.",
615
+ description: "Install a plugin in this org with its inputs (org admins; the web's install wizard): per connector template the connector's name, slug, endpoint fields and OAuth client id (templates), and the extension's org config without secrets (extensionConfig). Secrets are never params: the person enters them in a secure input request, at connectors.<templateId>.credential.token (or .credential.username / .credential.password, .client.clientSecret) and extensionConfig.<field>. Required ones are asked even when not listed in askPerson. A plugin that needs no input is switched on with plugins.set-enabled instead.",
616
616
  input: InstallInput,
617
617
  example: {
618
618
  itemId: EXAMPLE_ID,
@@ -710,7 +710,7 @@ let OrgPluginsOperations = class OrgPluginsOperations {
710
710
  }),
711
711
  defineOperation({
712
712
  id: "plugins.configure-connectors",
713
- description: "Create the connectors an installed plugin is missing (org admins; the plugin shows needs_config, e.g. after a platform update added a connector template): per missing template its name, slug, endpoint fields and OAuth client id (templates). Credentials are never params: the person enters them on the confirmation card at connectors.<templateId>.credential.token (or .credential.username / .credential.password, .client.clientSecret). Required ones are asked even when not listed in askPerson.",
713
+ description: "Create the connectors an installed plugin is missing (org admins; the plugin shows needs_config, e.g. after a platform update added a connector template): per missing template its name, slug, endpoint fields and OAuth client id (templates). Credentials are never params: the person enters them in a secure input request at connectors.<templateId>.credential.token (or .credential.username / .credential.password, .client.clientSecret). Required ones are asked even when not listed in askPerson.",
714
714
  input: ConfigureInput,
715
715
  example: {
716
716
  itemId: EXAMPLE_ID,
@@ -14,7 +14,7 @@ import { type OrgRole } from "../../orgs/roles.js";
14
14
  import { PlatformOperations } from "../registry.js";
15
15
  import { SealedReveals } from "../sealed-reveals.js";
16
16
  /** What `orgs.invite` returns in place of the token (model-visible English). */
17
- export declare const INVITATION_LINK_NOTE = "The invitation link is shown once, on the web, to the person who approved this call (on the approval card); they share it with the invitee. It is not shown to you. If it is not read within 24 hours it is lost: revoke the invitation (orgs.revoke-invitation) and invite again.";
17
+ export declare const INVITATION_LINK_NOTE = "The invitation link is shown once, on the web, to the person this call was made for, under the tool call in this conversation; they share it with the invitee. It is never shown to you. If it is not read within 24 hours it is lost: revoke the invitation (orgs.revoke-invitation) and invite again.";
18
18
  /**
19
19
  * Why a member operation through the tool is never offered (spec §7.2, maintainer decision Q2):
20
20
  * the actor's own membership (`member.self`), an owner or granting owner