@capybara-hq/kernel 0.1.0-rc.62 → 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.
- package/bootstrap.json +3 -3
- package/dist/app.d.ts +2 -0
- package/dist/catalog/catalog.service.d.ts +13 -0
- package/dist/catalog/catalog.service.js +17 -8
- package/dist/catalog/git-source.d.ts +8 -0
- package/dist/catalog/git-source.js +14 -6
- package/dist/catalog/marketplaces.controller.d.ts +3 -2
- package/dist/catalog/marketplaces.controller.js +5 -2
- package/dist/catalog/marketplaces.schemas.d.ts +7 -0
- package/dist/catalog/marketplaces.schemas.js +13 -0
- package/dist/catalog/marketplaces.service.d.ts +65 -11
- package/dist/catalog/marketplaces.service.js +208 -30
- package/dist/catalog/org-catalog.schemas.d.ts +1 -1
- package/dist/catalog/org-catalog.schemas.js +1 -1
- package/dist/channels/actions.d.ts +2 -5
- package/dist/channels/actions.js +20 -8
- package/dist/channels/cards.d.ts +4 -3
- package/dist/channels/cards.js +6 -4
- package/dist/channels/outbound.js +3 -2
- package/dist/config/schema.d.ts +2 -0
- package/dist/config/schema.js +22 -2
- package/dist/conversations/approval-profile.d.ts +30 -0
- package/dist/conversations/approval-profile.js +62 -0
- package/dist/conversations/conversations.service.js +0 -2
- package/dist/conversations/events.d.ts +43 -0
- package/dist/conversations/events.js +52 -0
- package/dist/conversations/permission-profiles.controller.d.ts +3 -2
- package/dist/conversations/permission-profiles.service.d.ts +3 -2
- package/dist/conversations/permission-profiles.service.js +12 -8
- package/dist/db/kernel-schema.d.ts +8 -2
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +7 -0
- package/dist/extensions/bootstrap-defaults.d.ts +24 -0
- package/dist/extensions/bootstrap-defaults.js +78 -0
- package/dist/extensions/bootstrap-extra.d.ts +74 -0
- package/dist/extensions/bootstrap-extra.js +131 -0
- package/dist/extensions/bootstrap.d.ts +77 -13
- package/dist/extensions/bootstrap.js +282 -48
- package/dist/identity/initial-passwords.controller.d.ts +8 -6
- package/dist/identity/initial-passwords.controller.js +13 -7
- package/dist/identity/initial-passwords.d.ts +22 -13
- package/dist/identity/initial-passwords.js +25 -29
- package/dist/identity/settings.d.ts +10 -0
- package/dist/identity/settings.js +46 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/kernel.module.js +3 -0
- package/dist/lifecycle/kernel-lifecycle.d.ts +7 -1
- package/dist/lifecycle/kernel-lifecycle.js +69 -16
- package/dist/local-devices/relay.js +3 -1
- package/dist/models/images.js +5 -4
- package/dist/platform/connector-person-fields.js +2 -2
- package/dist/platform/exclusions.js +4 -4
- package/dist/platform/method.js +1 -1
- package/dist/platform/operation.d.ts +9 -7
- package/dist/platform/operation.js +1 -1
- package/dist/platform/ops/accounts.ops.d.ts +1 -1
- package/dist/platform/ops/accounts.ops.js +3 -3
- package/dist/platform/ops/channels.ops.d.ts +1 -1
- package/dist/platform/ops/channels.ops.js +2 -2
- package/dist/platform/ops/connectors.ops.d.ts +2 -2
- package/dist/platform/ops/connectors.ops.js +8 -8
- package/dist/platform/ops/extensions-admin.ops.d.ts +1 -1
- package/dist/platform/ops/extensions-admin.ops.js +3 -3
- package/dist/platform/ops/extensions.ops.d.ts +1 -1
- package/dist/platform/ops/extensions.ops.js +4 -4
- package/dist/platform/ops/marketplaces.ops.js +27 -4
- package/dist/platform/ops/org-plugins.ops.js +2 -2
- package/dist/platform/ops/orgs.ops.d.ts +1 -1
- package/dist/platform/ops/orgs.ops.js +3 -3
- package/dist/platform/ops/plugins.ops.d.ts +1 -1
- package/dist/platform/ops/plugins.ops.js +2 -2
- package/dist/platform/person-fields.d.ts +4 -3
- package/dist/platform/person-fields.js +6 -5
- package/dist/platform/sealed-inputs.d.ts +2 -2
- package/dist/platform/sealed-inputs.js +2 -2
- package/dist/platform/sealed-reveals.controller.d.ts +5 -8
- package/dist/platform/sealed-reveals.controller.js +8 -8
- package/dist/platform/sealed-reveals.d.ts +19 -17
- package/dist/platform/sealed-reveals.js +30 -33
- package/dist/runtime/context/build.js +3 -0
- package/dist/runtime/context/compaction.js +2 -0
- package/dist/runtime/waits.js +3 -2
- package/dist/sandbox/operation-authority.js +16 -15
- package/dist/sandbox/operation-intents.js +2 -2
- package/dist/sandbox/permission-availability.d.ts +49 -3
- package/dist/sandbox/permission-availability.js +61 -6
- package/dist/sandbox/permission-call-types.d.ts +3 -0
- package/dist/sandbox/permission-facts.d.ts +29 -1
- package/dist/sandbox/permission-facts.js +29 -6
- package/dist/sandbox/review/classifier.d.ts +72 -2
- package/dist/sandbox/review/classifier.js +113 -38
- package/dist/sandbox/review/index.d.ts +2 -2
- package/dist/sandbox/review/index.js +1 -1
- package/dist/sandbox/review/review.service.d.ts +1 -4
- package/dist/sandbox/review/review.service.js +4 -33
- package/dist/setup/setup-guides.service.js +1 -1
- package/dist/tools/approvals.service.d.ts +71 -16
- package/dist/tools/approvals.service.js +139 -13
- package/dist/tools/builtins/builtin-tools.d.ts +1 -1
- package/dist/tools/builtins/builtin-tools.js +12 -6
- package/dist/tools/builtins/platform.d.ts +15 -11
- package/dist/tools/builtins/platform.js +49 -39
- package/dist/tools/builtins/sandbox/bash.d.ts +1 -1
- package/dist/tools/builtins/sandbox/bash.js +32 -14
- package/dist/tools/builtins/sandbox/common.d.ts +12 -3
- package/dist/tools/builtins/sandbox/common.js +29 -5
- package/dist/tools/connectors.schemas.d.ts +1 -1
- package/dist/tools/connectors.schemas.js +1 -1
- package/dist/tools/pipeline.d.ts +70 -10
- package/dist/tools/pipeline.js +356 -48
- package/dist/tools/policy.d.ts +4 -3
- package/dist/tools/policy.js +6 -6
- package/dist/tools/registry.d.ts +25 -9
- package/dist/tools/tool-review.d.ts +113 -0
- package/dist/tools/tool-review.js +303 -0
- package/dist/tools/tools.module.js +6 -0
- package/package.json +4 -4
- package/src/migrations/0174_marketplace_managed_username.sql +4 -0
- package/src/migrations/0175_secure_input_kind.sql +8 -0
|
@@ -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
|
|
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
|
|
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
|
|
14
|
-
*
|
|
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
|
|
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
|
|
141
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
@@ -34,6 +34,8 @@ const source = (m) => ({
|
|
|
34
34
|
form: m.form,
|
|
35
35
|
ref: m.ref,
|
|
36
36
|
builtin: m.builtin,
|
|
37
|
+
managed: m.managed,
|
|
38
|
+
username: m.username,
|
|
37
39
|
enabled: m.enabled,
|
|
38
40
|
disabledByConfig: m.disabledByConfig,
|
|
39
41
|
lastStatus: m.lastStatus,
|
|
@@ -91,6 +93,13 @@ let MarketplacesOperations = class MarketplacesOperations {
|
|
|
91
93
|
message: "The official marketplace can only be enabled or disabled",
|
|
92
94
|
};
|
|
93
95
|
}
|
|
96
|
+
if (m.managed === "config" && !onlyEnabled) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
code: "marketplace.config_managed",
|
|
100
|
+
message: "This marketplace is configured by the deployment and can only be enabled or disabled",
|
|
101
|
+
};
|
|
102
|
+
}
|
|
94
103
|
return { ok: true, source: m };
|
|
95
104
|
}
|
|
96
105
|
onModuleInit() {
|
|
@@ -151,8 +160,13 @@ let MarketplacesOperations = class MarketplacesOperations {
|
|
|
151
160
|
}),
|
|
152
161
|
defineOperation({
|
|
153
162
|
id: "marketplaces.add",
|
|
154
|
-
description: "Add a custom marketplace source to the platform (super admin): a name and an https URL of a marketplace.json, or a git repository (…/*.git or owner/repo) with an optional ref. Sources that need a token or mirrors are added on the web.",
|
|
155
|
-
input: MarketplaceAddBody.pick({
|
|
163
|
+
description: "Add a custom marketplace source to the platform (super admin): a name and an https URL of a marketplace.json, or a git repository (…/*.git or owner/repo) with an optional ref and the username its git token is sent with (empty: x-access-token). Sources that need a token or mirrors are added on the web.",
|
|
164
|
+
input: MarketplaceAddBody.pick({
|
|
165
|
+
name: true,
|
|
166
|
+
url: true,
|
|
167
|
+
ref: true,
|
|
168
|
+
username: true,
|
|
169
|
+
}).strict(),
|
|
156
170
|
example: { name: "Team plugins", url: "https://plugins.example.com/marketplace.json" },
|
|
157
171
|
authz: { superAdmin: true },
|
|
158
172
|
mirrors: ["POST /api/v1/admin/marketplaces"],
|
|
@@ -200,6 +214,7 @@ let MarketplacesOperations = class MarketplacesOperations {
|
|
|
200
214
|
name: input.name,
|
|
201
215
|
url: input.url,
|
|
202
216
|
...(input.ref !== undefined && { ref: input.ref }),
|
|
217
|
+
...(input.username !== undefined && { username: input.username }),
|
|
203
218
|
}, { auditDetail: viaAgent("marketplaces.add", ctx) })),
|
|
204
219
|
}),
|
|
205
220
|
}),
|
|
@@ -232,7 +247,7 @@ let MarketplacesOperations = class MarketplacesOperations {
|
|
|
232
247
|
}),
|
|
233
248
|
defineOperation({
|
|
234
249
|
id: "marketplaces.update",
|
|
235
|
-
description: "Edit a marketplace source (super admin): name, url, form, ref (null: follow the remote HEAD), mirrors, enabled. The official one
|
|
250
|
+
description: "Edit a marketplace source (super admin): name, url, form, ref (null: follow the remote HEAD), mirrors, username (the git token's username; null: x-access-token), enabled. The official one and those configured by the deployment take only enabled. A token is set on the web.",
|
|
236
251
|
input: z
|
|
237
252
|
.object({
|
|
238
253
|
marketplaceId: MarketplaceId,
|
|
@@ -252,6 +267,10 @@ let MarketplacesOperations = class MarketplacesOperations {
|
|
|
252
267
|
code: "marketplace.builtin",
|
|
253
268
|
next: "The official marketplace can only be enabled or disabled; it cannot be edited or removed.",
|
|
254
269
|
},
|
|
270
|
+
{
|
|
271
|
+
code: "marketplace.config_managed",
|
|
272
|
+
next: "This source is configured by the deployment (its extra bootstrap manifest); it can only be enabled or disabled here. Whoever runs the deployment changes the rest.",
|
|
273
|
+
},
|
|
255
274
|
{
|
|
256
275
|
code: "validation_failed",
|
|
257
276
|
next: "Fix the field the message names (https, no user info), then call again.",
|
|
@@ -283,7 +302,7 @@ let MarketplacesOperations = class MarketplacesOperations {
|
|
|
283
302
|
}),
|
|
284
303
|
defineOperation({
|
|
285
304
|
id: "marketplaces.remove",
|
|
286
|
-
description: "Remove a custom marketplace source (super admin): its entries and token go; plugins imported from it stay in the catalog. The official one cannot be removed (disable
|
|
305
|
+
description: "Remove a custom marketplace source (super admin): its entries and token go; plugins imported from it stay in the catalog. The official one and those configured by the deployment cannot be removed (disable them with marketplaces.update).",
|
|
287
306
|
input: z.object({ marketplaceId: MarketplaceId }).strict(),
|
|
288
307
|
example: { marketplaceId: "3f1c2a9e-5b7d-4e21-9c0a-1d2e3f4a5b6c" },
|
|
289
308
|
authz: { superAdmin: true },
|
|
@@ -296,6 +315,10 @@ let MarketplacesOperations = class MarketplacesOperations {
|
|
|
296
315
|
code: "marketplace.builtin",
|
|
297
316
|
next: "The official marketplace can only be enabled or disabled; it cannot be edited or removed.",
|
|
298
317
|
},
|
|
318
|
+
{
|
|
319
|
+
code: "marketplace.config_managed",
|
|
320
|
+
next: "This source is configured by the deployment (its extra bootstrap manifest); it can only be enabled or disabled here. Whoever runs the deployment changes the rest.",
|
|
321
|
+
},
|
|
299
322
|
],
|
|
300
323
|
precheck: async (i) => {
|
|
301
324
|
const r = await this.editable(i.marketplaceId, false);
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
@@ -56,7 +56,7 @@ const ROLE_WORDS = {
|
|
|
56
56
|
guest: { zh: "访客", en: "guest" },
|
|
57
57
|
};
|
|
58
58
|
/** What `orgs.invite` returns in place of the token (model-visible English). */
|
|
59
|
-
export const INVITATION_LINK_NOTE = `The invitation link is shown once, on the web, to the person
|
|
59
|
+
export 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 ${SEALED_REVEAL_TTL_MS / 3_600_000} hours it is lost: revoke the invitation (orgs.revoke-invitation) and invite again.`;
|
|
60
60
|
/**
|
|
61
61
|
* Why a member operation through the tool is never offered (spec §7.2, maintainer decision Q2):
|
|
62
62
|
* the actor's own membership (`member.self`), an owner or granting owner
|
|
@@ -513,14 +513,14 @@ let OrgsOperations = class OrgsOperations {
|
|
|
513
513
|
}),
|
|
514
514
|
defineOperation({
|
|
515
515
|
id: "orgs.invite",
|
|
516
|
-
description: "Invite a person into this conversation's org (org admins) with a role: admin, member or guest (never owner; never above your own role). expiresInHours is 1 to 720 (default 168). You never see the link: it is shown once, on the web, to the person
|
|
516
|
+
description: "Invite a person into this conversation's org (org admins) with a role: admin, member or guest (never owner; never above your own role). expiresInHours is 1 to 720 (default 168). You never see the link: it is shown once, on the web, to the person the call is made for (under the tool call in the conversation), who shares it with the invitee. If it is not read within 24 hours it is lost: revoke the invitation (orgs.revoke-invitation) and invite again.",
|
|
517
517
|
input: InvitationCreateBody.strict(),
|
|
518
518
|
example: { role: "member" },
|
|
519
519
|
authz: { orgAction: "org.invitations.manage" },
|
|
520
520
|
mirrors: ["POST /api/v1/orgs/:orgId/invitations"],
|
|
521
521
|
confirm: "org",
|
|
522
522
|
rememberable: false,
|
|
523
|
-
|
|
523
|
+
revealsOnce: "invitation_link",
|
|
524
524
|
errors: [
|
|
525
525
|
{
|
|
526
526
|
code: "member.role_above_actor",
|
|
@@ -8,7 +8,7 @@ import { ExtensionAvailability } from "../../extensions/unavailable.js";
|
|
|
8
8
|
import { KernelDb } from "../../infra/database/kernel-db.js";
|
|
9
9
|
import { PlatformOperations } from "../registry.js";
|
|
10
10
|
export { OTHER_ORG } from "./other-orgs.js";
|
|
11
|
-
export declare const NEEDS_INPUT = "This plugin needs connector input (endpoints, credentials): install it with plugins.install, or for an installed plugin missing connectors create them with plugins.configure-connectors; the person enters the credentials
|
|
11
|
+
export declare const NEEDS_INPUT = "This plugin needs connector input (endpoints, credentials): install it with plugins.install, or for an installed plugin missing connectors create them with plugins.configure-connectors; the person enters the credentials in a secure input request.";
|
|
12
12
|
/** `plugin.needs_input` when what is missing is its extension's org config (an agent can set it). */
|
|
13
13
|
export declare const needsOrgConfig: (extension: string) => string;
|
|
14
14
|
/**
|
|
@@ -40,9 +40,9 @@ export { OTHER_ORG } from "./other-orgs.js";
|
|
|
40
40
|
const LOCKED = "This plugin is on for every org (or shipped with the platform) and cannot be switched off in one org.";
|
|
41
41
|
/** The confirm value of switching off a plugin with nothing installed in the org. */
|
|
42
42
|
const NOTHING_INSTALLED = "nothing-installed";
|
|
43
|
-
export const NEEDS_INPUT = "This plugin needs connector input (endpoints, credentials): install it with plugins.install, or for an installed plugin missing connectors create them with plugins.configure-connectors; the person enters the credentials
|
|
43
|
+
export const NEEDS_INPUT = "This plugin needs connector input (endpoints, credentials): install it with plugins.install, or for an installed plugin missing connectors create them with plugins.configure-connectors; the person enters the credentials in a secure input request.";
|
|
44
44
|
/** `plugin.needs_input` when what is missing is its extension's org config (an agent can set it). */
|
|
45
|
-
export const needsOrgConfig = (extension) => `This plugin's extension ${extension} needs its org config first: read what is missing with extensions.org-config, fill it in with extensions.set-org-config (the person enters secrets
|
|
45
|
+
export const needsOrgConfig = (extension) => `This plugin's extension ${extension} needs its org config first: read what is missing with extensions.org-config, fill it in with extensions.set-org-config (the person enters secrets in a secure input request; the org's own copy of overridable platform fields is extensions.save-org-config), then call plugins.set-enabled again.`;
|
|
46
46
|
/** The English name of a plugin as next steps and messages name it. */
|
|
47
47
|
const enName = (i) => localized(i.displayName, i.name).en;
|
|
48
48
|
/** The item with the reason its extension stopped loading (state unchanged), when it has one. */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
3
|
* Person fields (platform web parity spec §4.1, §4.2): the secret fields of a write's target config
|
|
4
|
-
* schema that the person types
|
|
4
|
+
* schema that the person types in a secure input request instead of the model passing them in
|
|
5
|
+
* params.
|
|
5
6
|
* Pure rules shared by the Platform operations: find the secret fields of a JSON Schema produced by
|
|
6
7
|
* the SDK's `configJsonSchema` (`"x-secret": true`), plan which ones one call asks for, and check
|
|
7
8
|
* one typed value. Paths are the dot paths the config routes use in `values` (ruling R1); secret
|
|
@@ -10,9 +11,9 @@ import { z } from "zod";
|
|
|
10
11
|
*/
|
|
11
12
|
/** UTF-8 bytes of one value the person types. */
|
|
12
13
|
export declare const PERSON_FIELD_MAX_BYTES: number;
|
|
13
|
-
/** Person fields one call may ask for (one
|
|
14
|
+
/** Person fields one call may ask for (one secure input request). */
|
|
14
15
|
export declare const PERSON_FIELDS_MAX = 32;
|
|
15
|
-
/** One secret field the person may enter
|
|
16
|
+
/** One secret field the person may enter in a secure input request. */
|
|
16
17
|
export interface PersonFieldSpec {
|
|
17
18
|
/** Dot path from the schema root (R1). */
|
|
18
19
|
path: string;
|
|
@@ -3,7 +3,8 @@ import { z } from "zod";
|
|
|
3
3
|
import { hintedSecretPaths } from "../extensions/config-json-schema.js";
|
|
4
4
|
/**
|
|
5
5
|
* Person fields (platform web parity spec §4.1, §4.2): the secret fields of a write's target config
|
|
6
|
-
* schema that the person types
|
|
6
|
+
* schema that the person types in a secure input request instead of the model passing them in
|
|
7
|
+
* params.
|
|
7
8
|
* Pure rules shared by the Platform operations: find the secret fields of a JSON Schema produced by
|
|
8
9
|
* the SDK's `configJsonSchema` (`"x-secret": true`), plan which ones one call asks for, and check
|
|
9
10
|
* one typed value. Paths are the dot paths the config routes use in `values` (ruling R1); secret
|
|
@@ -12,7 +13,7 @@ import { hintedSecretPaths } from "../extensions/config-json-schema.js";
|
|
|
12
13
|
*/
|
|
13
14
|
/** UTF-8 bytes of one value the person types. */
|
|
14
15
|
export const PERSON_FIELD_MAX_BYTES = 16 * 1024;
|
|
15
|
-
/** Person fields one call may ask for (one
|
|
16
|
+
/** Person fields one call may ask for (one secure input request). */
|
|
16
17
|
export const PERSON_FIELDS_MAX = 32;
|
|
17
18
|
/** Characters of one dot path in `askPerson` / `clearSecrets`. */
|
|
18
19
|
const PATH_MAX_CHARS = 200;
|
|
@@ -31,7 +32,7 @@ const pathList = (what) => z
|
|
|
31
32
|
.describe(what);
|
|
32
33
|
/** The params every operation with person fields adds to its input schema. */
|
|
33
34
|
export const personFieldParams = {
|
|
34
|
-
askPerson: pathList("Dot paths of secret fields the person enters
|
|
35
|
+
askPerson: pathList("Dot paths of secret fields the person enters in a secure input request. Never put a secret in values; required secrets without a stored value are asked even when not listed."),
|
|
35
36
|
clearSecrets: pathList("Dot paths of stored secret fields to clear."),
|
|
36
37
|
};
|
|
37
38
|
const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -306,7 +307,7 @@ export function planPersonFields(t, p) {
|
|
|
306
307
|
if (leaks(f.path)) {
|
|
307
308
|
return {
|
|
308
309
|
ok: false,
|
|
309
|
-
message: `Secret fields are entered by the person
|
|
310
|
+
message: `Secret fields are entered by the person in a secure input request; leave \`${f.path}\` out of values and list it in askPerson. A value passed in params has been seen by the model and counts as leaked: tell the person to rotate it.`,
|
|
310
311
|
};
|
|
311
312
|
}
|
|
312
313
|
}
|
|
@@ -354,7 +355,7 @@ export function planPersonFields(t, p) {
|
|
|
354
355
|
if (ask.length > PERSON_FIELDS_MAX) {
|
|
355
356
|
return {
|
|
356
357
|
ok: false,
|
|
357
|
-
message: `This call would ask the person for ${ask.length} fields; one
|
|
358
|
+
message: `This call would ask the person for ${ask.length} fields; one secure input request holds at most ${PERSON_FIELDS_MAX}. Split the change into several calls.`,
|
|
358
359
|
};
|
|
359
360
|
}
|
|
360
361
|
return { ok: true, ask, clear: t.fields.filter((f) => clear.has(f.path)).map((f) => f.path) };
|
|
@@ -21,8 +21,8 @@ export interface SealedInputsRow {
|
|
|
21
21
|
callId: string;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Values a person typed
|
|
25
|
-
* parity spec §4.3). They are sealed with the master keyring in the decision's transaction and
|
|
24
|
+
* Values a person typed in a secure input request for a Platform call's secret fields (platform
|
|
25
|
+
* web parity spec §4.3). They are sealed with the master keyring in the decision's transaction and
|
|
26
26
|
* consumed once by the resumed call, in the transaction that applies the write. They never reach
|
|
27
27
|
* the event log, a tool result, the approval row, the audit or a log line.
|
|
28
28
|
*/
|
|
@@ -27,8 +27,8 @@ export class SealedInputsExpiredError extends Error {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Values a person typed
|
|
31
|
-
* parity spec §4.3). They are sealed with the master keyring in the decision's transaction and
|
|
30
|
+
* Values a person typed in a secure input request for a Platform call's secret fields (platform
|
|
31
|
+
* web parity spec §4.3). They are sealed with the master keyring in the decision's transaction and
|
|
32
32
|
* consumed once by the resumed call, in the transaction that applies the write. They never reach
|
|
33
33
|
* the event log, a tool result, the approval row, the audit or a log line.
|
|
34
34
|
*/
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import { RevealCallParams } from "../identity/initial-passwords.controller.js";
|
|
2
3
|
import { type Principal } from "../identity/principal.js";
|
|
3
4
|
import { type OrgContext } from "../orgs/org.guard.js";
|
|
4
5
|
import { SealedReveals } from "./sealed-reveals.js";
|
|
5
|
-
declare const ApprovalParams: z.ZodObject<{
|
|
6
|
-
approvalId: z.ZodString;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
6
|
/**
|
|
9
7
|
* The link of an invitation an org admin's agent created (platform web parity spec §7.2): shown
|
|
10
|
-
* once, on the web, to the person
|
|
11
|
-
* consumes it.
|
|
8
|
+
* once, on the web, to the person the `orgs.invite` call was made for, keyed by the call (plan
|
|
9
|
+
* ruling R6). A POST because reading consumes it.
|
|
12
10
|
*/
|
|
13
11
|
export declare class SealedRevealsController {
|
|
14
12
|
private readonly reveals;
|
|
15
13
|
constructor(reveals: SealedReveals);
|
|
16
|
-
reveal(principal: Principal, org: OrgContext, params: z.infer<typeof
|
|
14
|
+
reveal(principal: Principal, org: OrgContext, params: z.infer<typeof RevealCallParams>): Promise<{
|
|
17
15
|
url: string;
|
|
18
16
|
}>;
|
|
19
17
|
}
|
|
20
|
-
export {};
|
|
@@ -8,19 +8,18 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
10
|
import { Controller, HttpCode, Inject, Post } from "@nestjs/common";
|
|
11
|
-
import {
|
|
11
|
+
import { RevealCallParams } from "../identity/initial-passwords.controller.js";
|
|
12
12
|
import { CurrentPrincipal, requireUser, SessionOnly, } from "../identity/principal.js";
|
|
13
13
|
import { createZodDto } from "../infra/validation/create-zod-dto.js";
|
|
14
14
|
import { ZParam } from "../infra/validation/zod-params.js";
|
|
15
15
|
import { CurrentOrg, OrgAction } from "../orgs/org.guard.js";
|
|
16
16
|
import { SealedReveals } from "./sealed-reveals.js";
|
|
17
|
-
|
|
18
|
-
class ApprovalParamsDto extends createZodDto(ApprovalParams, "InvitationLinkParams") {
|
|
17
|
+
class RevealCallParamsDto extends createZodDto(RevealCallParams, "InvitationLinkParams") {
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* The link of an invitation an org admin's agent created (platform web parity spec §7.2): shown
|
|
22
|
-
* once, on the web, to the person
|
|
23
|
-
* consumes it.
|
|
21
|
+
* once, on the web, to the person the `orgs.invite` call was made for, keyed by the call (plan
|
|
22
|
+
* ruling R6). A POST because reading consumes it.
|
|
24
23
|
*/
|
|
25
24
|
let SealedRevealsController = class SealedRevealsController {
|
|
26
25
|
reveals;
|
|
@@ -29,7 +28,8 @@ let SealedRevealsController = class SealedRevealsController {
|
|
|
29
28
|
}
|
|
30
29
|
async reveal(principal, org, params) {
|
|
31
30
|
const p = requireUser(principal);
|
|
32
|
-
|
|
31
|
+
const { conversationId, runId, callId } = params;
|
|
32
|
+
return this.reveals.reveal(org.orgId, { conversationId, runId, callId }, p.account.id);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
__decorate([
|
|
@@ -39,10 +39,10 @@ __decorate([
|
|
|
39
39
|
SessionOnly(),
|
|
40
40
|
__param(0, CurrentPrincipal()),
|
|
41
41
|
__param(1, CurrentOrg()),
|
|
42
|
-
__param(2, ZParam(
|
|
42
|
+
__param(2, ZParam(RevealCallParamsDto))
|
|
43
43
|
], SealedRevealsController.prototype, "reveal", null);
|
|
44
44
|
SealedRevealsController = __decorate([
|
|
45
|
-
Controller("api/v1/orgs/:orgId/
|
|
45
|
+
Controller("api/v1/orgs/:orgId/conversations/:conversationId/runs/:runId/calls/:callId/invitation-link"),
|
|
46
46
|
__param(0, Inject(SealedReveals))
|
|
47
47
|
], SealedRevealsController);
|
|
48
48
|
export { SealedRevealsController };
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { type Keyring } from "../ctx/secrets.js";
|
|
2
2
|
import type { KernelSchemaDb } from "../db/kernel-schema.js";
|
|
3
|
+
import type { RevealCall } from "../identity/initial-passwords.js";
|
|
3
4
|
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
4
5
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
5
6
|
import { TransactionHost } from "../infra/database/transaction-host.js";
|
|
6
7
|
/**
|
|
7
8
|
* How long a sealed invitation link waits for its reader, like a generated initial password: the
|
|
8
|
-
*
|
|
9
|
-
* invitation and invite again).
|
|
9
|
+
* person the call was made for reads it right after the call runs; one never read expires
|
|
10
|
+
* (revoke the invitation and invite again).
|
|
10
11
|
*/
|
|
11
12
|
export declare const SEALED_REVEAL_TTL_MS: number;
|
|
12
|
-
/**
|
|
13
|
-
export declare const INVITE_TOOL_KEY = "Platform:orgs.invite";
|
|
14
|
-
/** Where a sealed value is delivered: the approved tool call and the person who approved. */
|
|
13
|
+
/** Where a sealed value is delivered: the tool call and the person it was made for. */
|
|
15
14
|
export interface SealedRevealDelivery {
|
|
16
15
|
conversationId: string;
|
|
17
16
|
/** The run of the call: a call id is unique only within its run. */
|
|
18
17
|
runId: string;
|
|
19
18
|
callId: string;
|
|
20
|
-
/** The account that may read it: the
|
|
19
|
+
/** The account that may read it: the person the call was made for (the run's own person). */
|
|
21
20
|
recipientAccountId: string;
|
|
22
21
|
}
|
|
23
22
|
/** The web path of an invitation link (apps/web `invitePath`). */
|
|
24
23
|
export declare const invitationPath: (token: string) => string;
|
|
25
24
|
/**
|
|
26
|
-
* Values a Platform call makes that only the person
|
|
27
|
-
* parity spec §7.2, plan ruling
|
|
28
|
-
* token never reaches the model, the tool result, the
|
|
29
|
-
*
|
|
30
|
-
*
|
|
25
|
+
* Values a Platform call makes that only the person the call was made for may read (platform web
|
|
26
|
+
* parity spec §7.2; read by call: profiles govern every approval, plan ruling R6): the token of an
|
|
27
|
+
* invitation an org admin's agent created. The token never reaches the model, the tool result, the
|
|
28
|
+
* event log, the audit or a log line: it is sealed with the master keyring in the creation's
|
|
29
|
+
* transaction and read once, on the web, by that person, like the generated initial password
|
|
30
|
+
* (`InitialPasswords`).
|
|
31
31
|
*/
|
|
32
32
|
export declare class SealedReveals {
|
|
33
33
|
private readonly db;
|
|
@@ -38,13 +38,15 @@ export declare class SealedReveals {
|
|
|
38
38
|
/** Seals an invitation's token for `to`, in the caller's (the creation's) transaction. */
|
|
39
39
|
sealIn(orgId: string, invitationId: string, token: string, to: SealedRevealDelivery): Promise<void>;
|
|
40
40
|
/**
|
|
41
|
-
* The link of the invitation an
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
41
|
+
* The link of the invitation an `orgs.invite` call created (`call` in `orgId`), read once by its
|
|
42
|
+
* recipient `accountId` while the call's conversation is still accessible to them, then deleted
|
|
43
|
+
* (plan ruling R6: read by call, whether the call ran under an approval or automatically).
|
|
44
|
+
* Anything else (not the recipient, the conversation not accessible, not run yet, read already,
|
|
45
|
+
* expired, the invitation no longer pending) is `invitation.link_unavailable`, saying nothing
|
|
46
|
+
* about which. Audits the read (without the token). The URL is absolute under
|
|
47
|
+
* `http.publicUrl`, else the web path.
|
|
46
48
|
*/
|
|
47
|
-
reveal(orgId: string,
|
|
49
|
+
reveal(orgId: string, call: RevealCall, accountId: string): Promise<{
|
|
48
50
|
url: string;
|
|
49
51
|
}>;
|
|
50
52
|
}
|