@capybara-hq/kernel 0.1.0-rc.47 → 0.1.0-rc.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/admin.module.js +2 -0
- package/dist/admin/admin.schemas.d.ts +4 -0
- package/dist/admin/health.service.d.ts +2 -2
- package/dist/admin/health.service.js +8 -4
- package/dist/agents/agents.schemas.js +1 -1
- package/dist/agents/instruction-files.js +0 -3
- package/dist/background/launch.d.ts +4 -0
- package/dist/background/launch.js +6 -2
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/channels/channels.module.js +3 -0
- package/dist/channels/connections.service.d.ts +18 -5
- package/dist/channels/connections.service.js +21 -5
- package/dist/channels/features.d.ts +2 -0
- package/dist/channels/features.js +9 -5
- package/dist/channels/file-delivery.d.ts +74 -0
- package/dist/channels/file-delivery.js +176 -0
- package/dist/channels/outbound.d.ts +6 -3
- package/dist/channels/outbound.js +156 -4
- package/dist/channels/phrases.d.ts +19 -0
- package/dist/channels/phrases.js +16 -0
- package/dist/config/schema.d.ts +2 -0
- package/dist/config/schema.js +18 -0
- package/dist/conversations/delivery-scope.d.ts +34 -0
- package/dist/conversations/delivery-scope.js +23 -0
- package/dist/conversations/event-log.d.ts +18 -0
- package/dist/conversations/event-log.js +54 -0
- package/dist/conversations/events.d.ts +2 -0
- package/dist/conversations/events.js +15 -2
- package/dist/conversations/prompt-suggestion-request.d.ts +95 -0
- package/dist/conversations/prompt-suggestion-request.js +213 -0
- package/dist/conversations/prompt-suggestion-store.d.ts +51 -0
- package/dist/conversations/prompt-suggestion-store.js +136 -0
- package/dist/conversations/prompt-suggestions.d.ts +153 -0
- package/dist/conversations/prompt-suggestions.js +563 -0
- package/dist/conversations/titles.js +11 -5
- package/dist/evals/reconstruct.d.ts +26 -1
- package/dist/evals/reconstruct.js +25 -6
- package/dist/identity/settings.d.ts +13 -0
- package/dist/identity/settings.js +37 -2
- package/dist/infra/queue/queue-names.d.ts +1 -1
- package/dist/infra/queue/queue-names.js +1 -0
- package/dist/kernel.module.js +4 -1
- package/dist/lifecycle/kernel-lifecycle.d.ts +3 -1
- package/dist/lifecycle/kernel-lifecycle.js +13 -7
- package/dist/models/image-usable.d.ts +30 -6
- package/dist/models/image-usable.js +38 -7
- package/dist/models/images.js +6 -4
- package/dist/models/purposes.d.ts +1 -1
- package/dist/models/purposes.js +10 -4
- package/dist/orgs/settings.service.d.ts +16 -0
- package/dist/orgs/settings.service.js +46 -5
- package/dist/overrides.d.ts +4 -0
- package/dist/overrides.js +2 -0
- package/dist/platform/availability.d.ts +5 -0
- package/dist/platform/availability.js +7 -3
- package/dist/platform/ops/accounts.ops.d.ts +1 -1
- package/dist/platform/ops/accounts.ops.js +1 -1
- package/dist/platform/ops/admin.ops.js +3 -2
- package/dist/platform/ops/agent-skills.ops.js +5 -5
- package/dist/platform/ops/agents.ops.js +3 -3
- package/dist/platform/ops/approvals.ops.d.ts +1 -1
- package/dist/platform/ops/approvals.ops.js +2 -2
- package/dist/platform/ops/background.ops.js +1 -1
- package/dist/platform/ops/catalog-admin.ops.js +3 -3
- package/dist/platform/ops/conversations.ops.js +2 -2
- package/dist/platform/ops/devices.ops.js +2 -2
- package/dist/platform/ops/extensions-admin.ops.js +2 -2
- package/dist/platform/ops/extensions.ops.js +3 -3
- package/dist/platform/ops/inbox.ops.js +4 -4
- package/dist/platform/ops/org-plugins.ops.js +4 -4
- package/dist/platform/ops/org-settings.ops.js +2 -2
- package/dist/platform/ops/orgs.ops.js +1 -0
- package/dist/platform/ops/plugins.ops.d.ts +1 -1
- package/dist/platform/ops/plugins.ops.js +3 -3
- package/dist/platform/ops/requests.ops.js +1 -1
- package/dist/platform/ops/schedules.ops.js +6 -6
- package/dist/roles/worker-role.d.ts +6 -3
- package/dist/roles/worker-role.js +21 -13
- package/dist/roles/worker.module.js +2 -0
- package/dist/runtime/compaction-settings.service.d.ts +8 -0
- package/dist/runtime/compaction-settings.service.js +12 -6
- package/dist/runtime/run-processors.d.ts +14 -6
- package/dist/runtime/run-processors.js +43 -8
- package/dist/runtime/run-worker.d.ts +5 -0
- package/dist/runtime/run-worker.js +24 -16
- package/dist/runtime/runtime.module.d.ts +1 -1
- package/dist/runtime/runtime.module.js +7 -1
- package/dist/runtime/stream.d.ts +7 -1
- package/dist/runtime/stream.js +54 -3
- package/dist/runtime/usage-report.d.ts +2 -1
- package/dist/runtime/usage-report.js +2 -1
- package/dist/sandbox/sandbox-file-reader.js +1 -1
- package/dist/storage/storage.service.d.ts +2 -0
- package/dist/storage/storage.service.js +3 -0
- package/dist/tools/builtin-names.js +2 -2
- package/dist/tools/builtins/agent.js +5 -5
- package/dist/tools/builtins/artifacts.d.ts +34 -8
- package/dist/tools/builtins/artifacts.js +95 -19
- package/dist/tools/builtins/image/generate.d.ts +4 -1
- package/dist/tools/builtins/image/generate.js +70 -14
- package/dist/tools/builtins/platform.d.ts +0 -2
- package/dist/tools/builtins/platform.js +3 -5
- package/dist/tools/builtins/sandbox/bash.js +15 -11
- package/dist/tools/builtins/sandbox/common.d.ts +3 -2
- package/dist/tools/builtins/sandbox/deliver.js +13 -7
- package/dist/tools/builtins/sandbox/glob.js +1 -1
- package/dist/tools/builtins/sandbox/grep.js +1 -1
- package/dist/tools/builtins/sandbox/read.js +3 -3
- package/dist/tools/builtins/sandbox/task-output.d.ts +1 -1
- package/dist/tools/builtins/sandbox/task-output.js +13 -11
- package/dist/tools/builtins/send-message.d.ts +1 -1
- package/dist/tools/builtins/send-message.js +3 -3
- package/dist/tools/builtins/skill-load.d.ts +1 -1
- package/dist/tools/builtins/tool-search.js +1 -1
- package/dist/tools/builtins/web/extract.js +1 -1
- package/dist/tools/builtins/web/search.js +2 -4
- package/dist/tools/connector-account-policies.js +1 -1
- package/dist/tools/info.d.ts +3 -1
- package/dist/tools/registry.d.ts +6 -0
- package/dist/tools/registry.js +1 -1
- package/package.json +3 -3
|
@@ -12,7 +12,7 @@ import { z } from "zod";
|
|
|
12
12
|
import { readPlatformAttribution, } from "../attribution/platform-attribution.js";
|
|
13
13
|
import { ApiError } from "../errors.js";
|
|
14
14
|
import { audit } from "../identity/audit.js";
|
|
15
|
-
import { COMPACTION_SETTINGS_PARTIAL, COMPACTION_SETTINGS_PATCH, readPlatformCompactionSettings, readSandboxLimitOverride, } from "../identity/settings.js";
|
|
15
|
+
import { COMPACTION_SETTINGS_PARTIAL, COMPACTION_SETTINGS_PATCH, readPlatformCompactionSettings, readPromptSuggestions, readSandboxLimitOverride, } from "../identity/settings.js";
|
|
16
16
|
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
17
17
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
18
18
|
import { TransactionHost, withOrderedLocks } from "../infra/database/transaction-host.js";
|
|
@@ -139,6 +139,11 @@ export const GitGatewaySettingSchema = z.object({
|
|
|
139
139
|
/** What an invalid stored `gitGateway` reads as: the gateway off for the org. */
|
|
140
140
|
export const GIT_GATEWAY_INVALID = { enabled: false };
|
|
141
141
|
const ExternalSharingSetting = z.enum(["on", "off"]);
|
|
142
|
+
const PromptSuggestionsSetting = z.enum(["on", "off"]);
|
|
143
|
+
/** Whether prompt suggestions run for an org: the platform is on and the org has not turned it off. */
|
|
144
|
+
export function effectivePromptSuggestions(platform, org) {
|
|
145
|
+
return platform === "on" && org !== "off";
|
|
146
|
+
}
|
|
142
147
|
export const OrgSettingsSchema = z.object({
|
|
143
148
|
toolSearch: z.enum(["on", "off"]).default("on").catch("on"),
|
|
144
149
|
locale: z.enum(["zh", "en"]).default("en").catch("en"),
|
|
@@ -171,6 +176,11 @@ export const OrgSettingsSchema = z.object({
|
|
|
171
176
|
* value reads as `off` (never wider). The platform's switch must allow it too.
|
|
172
177
|
*/
|
|
173
178
|
externalSharing: ExternalSharingSetting.optional().catch("off"),
|
|
179
|
+
/**
|
|
180
|
+
* The org's prompt suggestions switch; absent follows the platform (on). An invalid stored value
|
|
181
|
+
* reads as `off`. The platform's switch must be on too ({@link effectivePromptSuggestions}).
|
|
182
|
+
*/
|
|
183
|
+
promptSuggestions: PromptSuggestionsSetting.optional().catch("off"),
|
|
174
184
|
});
|
|
175
185
|
/** {@link OrgSettingsView} of `settings`, flagged from the stored value `raw`. */
|
|
176
186
|
const viewOf = (settings, raw) => invalidStoredForbiddenTools(raw)
|
|
@@ -226,10 +236,12 @@ export const OrgSettingsPatchSchema = z
|
|
|
226
236
|
* only be turned off (the same code).
|
|
227
237
|
*/
|
|
228
238
|
externalSharing: ExternalSharingSetting.nullable().optional(),
|
|
239
|
+
/** The org's prompt suggestions switch (on or off); null clears it (follow the platform). */
|
|
240
|
+
promptSuggestions: PromptSuggestionsSetting.nullable().optional(),
|
|
229
241
|
})
|
|
230
242
|
.strict()
|
|
231
243
|
.refine((p) => p.autoMode === undefined || p.fullAccess === undefined, {
|
|
232
|
-
message: "
|
|
244
|
+
message: "pass fullAccess only, not together with autoMode",
|
|
233
245
|
path: ["autoMode"],
|
|
234
246
|
});
|
|
235
247
|
/** A patch with the old `autoMode` moved to `fullAccess` (the schema refuses both together). */
|
|
@@ -348,6 +360,11 @@ export function invalidStoredExternalSharing(raw) {
|
|
|
348
360
|
const v = asObject(raw).externalSharing;
|
|
349
361
|
return v !== undefined && !ExternalSharingSetting.safeParse(v).success;
|
|
350
362
|
}
|
|
363
|
+
/** Whether a stored settings object holds a `promptSuggestions` this version reads as `off`. */
|
|
364
|
+
export function invalidStoredPromptSuggestions(raw) {
|
|
365
|
+
const v = asObject(raw).promptSuggestions;
|
|
366
|
+
return v !== undefined && !PromptSuggestionsSetting.safeParse(v).success;
|
|
367
|
+
}
|
|
351
368
|
/** Whether a stored settings object holds a `fullAccess` this version reads as `off`. */
|
|
352
369
|
export function invalidStoredFullAccess(raw) {
|
|
353
370
|
const v = asObject(raw).fullAccess;
|
|
@@ -411,6 +428,11 @@ let OrgSettingsService = class OrgSettingsService {
|
|
|
411
428
|
if (invalidStoredExternalSharing(raw)) {
|
|
412
429
|
this.log?.warn("org settings: stored externalSharing is invalid; it reads as off", { orgId });
|
|
413
430
|
}
|
|
431
|
+
if (invalidStoredPromptSuggestions(raw)) {
|
|
432
|
+
this.log?.warn("org settings: stored promptSuggestions is invalid; it reads as off", {
|
|
433
|
+
orgId,
|
|
434
|
+
});
|
|
435
|
+
}
|
|
414
436
|
if (invalidStoredCloudNetwork(raw)) {
|
|
415
437
|
this.log?.warn("org settings: stored cloudNetwork is invalid; it reads as an empty allowlist", {
|
|
416
438
|
orgId,
|
|
@@ -424,12 +446,13 @@ let OrgSettingsService = class OrgSettingsService {
|
|
|
424
446
|
/** 部署默认值(设置页展示「跟随部署」时的实际取值)。 */
|
|
425
447
|
async deployment() {
|
|
426
448
|
const lim = this.config.get().sandbox.limits;
|
|
427
|
-
const [fullAccess, attribution, compaction, externalSharing, shareMaxExpiry] = await Promise.all([
|
|
449
|
+
const [fullAccess, attribution, compaction, externalSharing, shareMaxExpiry, promptSuggestions,] = await Promise.all([
|
|
428
450
|
readDevicesFullAccess(this.db.db, this.config, this.log),
|
|
429
451
|
readPlatformAttribution(this.db.db, this.config, this.log),
|
|
430
452
|
readPlatformCompactionSettings(this.db.db),
|
|
431
453
|
readExternalSharing(this.db.db, this.config, this.log),
|
|
432
454
|
readShareMaxExpiry(this.db.db, this.config, this.log),
|
|
455
|
+
readPromptSuggestions(this.db.db, this.log),
|
|
433
456
|
]);
|
|
434
457
|
return {
|
|
435
458
|
fullAccess,
|
|
@@ -444,8 +467,24 @@ let OrgSettingsService = class OrgSettingsService {
|
|
|
444
467
|
compaction,
|
|
445
468
|
externalSharing,
|
|
446
469
|
shareMaxExpiryDays: shareMaxExpiry.value,
|
|
470
|
+
promptSuggestions,
|
|
447
471
|
};
|
|
448
472
|
}
|
|
473
|
+
/** Whether prompt suggestions run for the org now: one read of the platform and of the org. */
|
|
474
|
+
async promptSuggestionsEnabled(orgId) {
|
|
475
|
+
const [platform, row] = await Promise.all([
|
|
476
|
+
readPromptSuggestions(this.db.db, this.log),
|
|
477
|
+
this.db
|
|
478
|
+
.selectFrom("orgs")
|
|
479
|
+
.select("settings")
|
|
480
|
+
.where("id", "=", orgId)
|
|
481
|
+
.where("deleted_at", "is", null)
|
|
482
|
+
.executeTakeFirst(),
|
|
483
|
+
]);
|
|
484
|
+
if (!row)
|
|
485
|
+
return false;
|
|
486
|
+
return effectivePromptSuggestions(platform, parseOrgSettings(row.settings).promptSuggestions);
|
|
487
|
+
}
|
|
449
488
|
/**
|
|
450
489
|
* The org's effective sandbox-mode network (spec §D3): the cloud network's mode and the hosts,
|
|
451
490
|
* from the platform's `sandbox.limits` and the org's stored delta.
|
|
@@ -588,7 +627,7 @@ let OrgSettingsService = class OrgSettingsService {
|
|
|
588
627
|
const changes = Object.fromEntries(Object.entries(patch)
|
|
589
628
|
.filter(([, v]) => v !== undefined)
|
|
590
629
|
// null clears fullAccess / cloudNetwork / wakeOnBackgroundTask (follow the deployment
|
|
591
|
-
// again)
|
|
630
|
+
// again), externalSharing (off) and promptSuggestions (follow the platform)
|
|
592
631
|
.map(([k, v]) => [k, v === null ? undefined : v]));
|
|
593
632
|
const arrangementPatch = patch.uiArrangement;
|
|
594
633
|
const compactionPatch = patch.compaction;
|
|
@@ -643,6 +682,8 @@ let OrgSettingsService = class OrgSettingsService {
|
|
|
643
682
|
delete after.compaction;
|
|
644
683
|
if (after.externalSharing === undefined)
|
|
645
684
|
delete after.externalSharing;
|
|
685
|
+
if (after.promptSuggestions === undefined)
|
|
686
|
+
delete after.promptSuggestions;
|
|
646
687
|
// saving an unreadable security setting writes it even when it equals what it read as
|
|
647
688
|
const repairs = (invalidStoredForbiddenTools(stored) && patch.scheduledTasks?.forbiddenTools !== undefined) ||
|
|
648
689
|
(invalidStoredSandboxToolPolicy(stored) && patch.sandboxToolPolicy !== undefined);
|
|
@@ -655,7 +696,7 @@ let OrgSettingsService = class OrgSettingsService {
|
|
|
655
696
|
}
|
|
656
697
|
// Merge with the stored value: keep the keys this version does not know (a cleared fullAccess /
|
|
657
698
|
// cloudNetwork is not kept, nor the old name autoMode)
|
|
658
|
-
const { autoMode: _legacyAutoMode, fullAccess: _oldFullAccess, cloudNetwork: _oldNetwork, wakeOnBackgroundTask: _oldWake, timeZone: _oldZone, theme: _oldTheme, uiArrangement: _oldArrangement, scheduledTasks: _oldScheduled, compaction: _oldCompaction, externalSharing: _oldExternalSharing, ...rest } = stored;
|
|
699
|
+
const { autoMode: _legacyAutoMode, fullAccess: _oldFullAccess, cloudNetwork: _oldNetwork, wakeOnBackgroundTask: _oldWake, timeZone: _oldZone, theme: _oldTheme, uiArrangement: _oldArrangement, scheduledTasks: _oldScheduled, compaction: _oldCompaction, externalSharing: _oldExternalSharing, promptSuggestions: _oldPromptSuggestions, ...rest } = stored;
|
|
659
700
|
const written = {
|
|
660
701
|
...rest,
|
|
661
702
|
...after,
|
package/dist/overrides.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { APP_INTERCEPTOR } from "@nestjs/core";
|
|
|
3
3
|
import { ADMIN_USAGE_TIMINGS, type AdminUsageTimings } from "./admin/usage.service.js";
|
|
4
4
|
import { SCOPE_ORG_CHUNK_SIZE } from "./catalog/scope-jobs.js";
|
|
5
5
|
import { CHANNEL_WEBHOOK_TIMINGS, type ChannelWebhookTimings } from "./channels/webhook.js";
|
|
6
|
+
import { PROMPT_SUGGESTION_TIMEOUT } from "./conversations/prompt-suggestions.js";
|
|
6
7
|
import { EXTENSION_NET_SEAMS, type ExtensionNetSeams } from "./ctx/net.js";
|
|
7
8
|
import type { EvalReplayHooks } from "./evals/run-replay.js";
|
|
8
9
|
import { EVAL_REPLAY_HOOKS } from "./evals/worker.js";
|
|
@@ -59,6 +60,8 @@ import { EMBED_TOKEN_CLOCK } from "./ui/embed-token.js";
|
|
|
59
60
|
* recorded (throwing stands for a crash between the call and the resolve transaction);
|
|
60
61
|
* - `PROJECT_KNOWLEDGE_TIMEOUT`: the run-start read of a bound project's time limit, read at every
|
|
61
62
|
* read (a test shortens it for one run);
|
|
63
|
+
* - `PROMPT_SUGGESTION_TIMEOUT`: the prompt suggestion call's time limit, read at every call (a test
|
|
64
|
+
* shortens it for one call);
|
|
62
65
|
* - `PLUGIN_PUBLIC_WRITE_LIMIT`: a lower limit for unsafe methods on `public` extension routes;
|
|
63
66
|
* - `SCOPE_ORG_CHUNK_SIZE`: fewer orgs per plugin scope sync chunk job (several chunks in a test);
|
|
64
67
|
* - `EXTENSION_NET_SEAMS`: `ctx.net`'s DNS and dispatcher (a hostname resolving to a private address
|
|
@@ -93,6 +96,7 @@ interface KernelSeams {
|
|
|
93
96
|
[ENSURE_RUN_FAILS]: () => boolean;
|
|
94
97
|
[SCOPE_ORG_CHUNK_SIZE]: number;
|
|
95
98
|
[PROJECT_KNOWLEDGE_TIMEOUT]: () => number;
|
|
99
|
+
[PROMPT_SUGGESTION_TIMEOUT]: () => number;
|
|
96
100
|
[PLUGIN_PUBLIC_WRITE_LIMIT]: number;
|
|
97
101
|
[DEVICE_POLICY_AFTER_CALL]: (opId: string) => void;
|
|
98
102
|
[EXTENSION_NET_SEAMS]: ExtensionNetSeams;
|
package/dist/overrides.js
CHANGED
|
@@ -2,6 +2,7 @@ import { APP_INTERCEPTOR } from "@nestjs/core";
|
|
|
2
2
|
import { ADMIN_USAGE_TIMINGS } from "./admin/usage.service.js";
|
|
3
3
|
import { SCOPE_ORG_CHUNK_SIZE } from "./catalog/scope-jobs.js";
|
|
4
4
|
import { CHANNEL_WEBHOOK_TIMINGS } from "./channels/webhook.js";
|
|
5
|
+
import { PROMPT_SUGGESTION_TIMEOUT } from "./conversations/prompt-suggestions.js";
|
|
5
6
|
import { EXTENSION_NET_SEAMS } from "./ctx/net.js";
|
|
6
7
|
import { EVAL_REPLAY_HOOKS } from "./evals/worker.js";
|
|
7
8
|
import { BOOTSTRAP_LOCK_TTL } from "./extensions/bootstrap.js";
|
|
@@ -52,6 +53,7 @@ const SEAM_TOKENS = [
|
|
|
52
53
|
ENSURE_RUN_FAILS,
|
|
53
54
|
SCOPE_ORG_CHUNK_SIZE,
|
|
54
55
|
PROJECT_KNOWLEDGE_TIMEOUT,
|
|
56
|
+
PROMPT_SUGGESTION_TIMEOUT,
|
|
55
57
|
PLUGIN_PUBLIC_WRITE_LIMIT,
|
|
56
58
|
DEVICE_POLICY_AFTER_CALL,
|
|
57
59
|
EXTENSION_NET_SEAMS,
|
|
@@ -6,6 +6,11 @@ export type Availability = {
|
|
|
6
6
|
ok: false;
|
|
7
7
|
reason: string;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Why nothing runs while the org setting `platformTool` is `off` (spec §3): the tool's
|
|
11
|
+
* `unavailable` reason and the operation refusal both use it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PLATFORM_UNAVAILABLE_OFF = "The org turned the Platform tool off; an org admin can switch it on in the organization settings.";
|
|
9
14
|
/**
|
|
10
15
|
* Whether the actor may call `op` now (spec §6), decided on facts read at call time. The reason
|
|
11
16
|
* is model-visible English: it says who can do it or why not, so the agent can offer the next
|
|
@@ -7,6 +7,11 @@ const HOLDER = {
|
|
|
7
7
|
owner: "an org owner",
|
|
8
8
|
};
|
|
9
9
|
const refuse = (reason) => ({ ok: false, reason });
|
|
10
|
+
/**
|
|
11
|
+
* Why nothing runs while the org setting `platformTool` is `off` (spec §3): the tool's
|
|
12
|
+
* `unavailable` reason and the operation refusal both use it.
|
|
13
|
+
*/
|
|
14
|
+
export const PLATFORM_UNAVAILABLE_OFF = "The org turned the Platform tool off; an org admin can switch it on in the organization settings.";
|
|
10
15
|
/**
|
|
11
16
|
* Whether the actor may call `op` now (spec §6), decided on facts read at call time. The reason
|
|
12
17
|
* is model-visible English: it says who can do it or why not, so the agent can offer the next
|
|
@@ -16,9 +21,8 @@ export function availability(op, f) {
|
|
|
16
21
|
if (f.role === null) {
|
|
17
22
|
return refuse("You are not a member of this org any more, or your account is disabled, so no Platform operation is available; ask an org admin to add you back or the super admin to enable your account.");
|
|
18
23
|
}
|
|
19
|
-
if (f.setting === "off")
|
|
20
|
-
return refuse(
|
|
21
|
-
}
|
|
24
|
+
if (f.setting === "off")
|
|
25
|
+
return refuse(PLATFORM_UNAVAILABLE_OFF);
|
|
22
26
|
if ("superAdmin" in op.authz) {
|
|
23
27
|
if (!f.isSuperAdmin) {
|
|
24
28
|
return refuse("Only the super admin can do this; ask them, or use a request operation where one exists.");
|
|
@@ -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)
|
|
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.";
|
|
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)
|
|
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.";
|
|
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,
|
|
@@ -48,6 +48,7 @@ const SettingsInput = DEPLOYMENT_SETTINGS_PATCH.pick({
|
|
|
48
48
|
attribution: true,
|
|
49
49
|
externalSharing: true,
|
|
50
50
|
shareMaxExpiryDays: true,
|
|
51
|
+
promptSuggestions: true,
|
|
51
52
|
htmlRenderCdnAllowlist: true,
|
|
52
53
|
}).strict();
|
|
53
54
|
const ProviderId = ModelProviderParams.shape.provider.describe("The model provider (models.platform-list), e.g. the plugin name of its extension.");
|
|
@@ -207,7 +208,7 @@ let AdminOperations = class AdminOperations {
|
|
|
207
208
|
}),
|
|
208
209
|
defineOperation({
|
|
209
210
|
id: "admin.settings",
|
|
210
|
-
description: "Read the deployment settings (super admin): who may create orgs (orgCreation), the price currency, whether orgs may create their own connectors and skills, whether org admins may browse the marketplaces, the per-org limit overrides keyed by org id (orgs.get reads one org's), the platform's Full permission switch in effect (devicesFullAccess: permission allowed or off
|
|
211
|
+
description: "Read the deployment settings (super admin): who may create orgs (orgCreation), the price currency, whether orgs may create their own connectors and skills, whether org admins may browse the marketplaces, the per-org limit overrides keyed by org id (orgs.get reads one org's), the platform's Full permission switch in effect (devicesFullAccess: permission allowed or off), the platform's attribution defaults for agent-created git commits and pull requests (attribution: commit, pr, sessionUrl), file sharing (externalSharing: value allow or deny, whether orgs may turn on public links to conversation files; shareMaxExpiryDays: value, the longest expiry a share may take in days), htmlRenderCdnAllowlist (the https origins a rendered HTML file may load libraries, styles, fonts and images from) and promptSuggestions (on or off, absent meaning on: whether the composer suggests the person's next message after a completed run; an org's own promptSuggestions must be on too); the switches each with sources: env, file or nacos are set in the startup config and read-only, db chosen in the admin console, default.",
|
|
211
212
|
input: z.object({}).strict(),
|
|
212
213
|
example: {},
|
|
213
214
|
authz: { superAdmin: true },
|
|
@@ -217,7 +218,7 @@ let AdminOperations = class AdminOperations {
|
|
|
217
218
|
}),
|
|
218
219
|
defineOperation({
|
|
219
220
|
id: "admin.update-settings",
|
|
220
|
-
description: "Change deployment settings (super admin); give only the keys to change: orgCreation (anyone or super_admin), priceCurrency (ISO 4217 code), customConnectors / customSkills (allow or deny: whether orgs may create their own instead of installing from the catalog), orgMarketplaceBrowse (true or false), uiTheme ({ id }: the platform default theme, a platform theme whose scope is all, or null for the built-in theme; it is what every org falls back to and what the sign-in pages show), uiArrangement ({ <slot>: { hidden, order } } for a list slot, { <slot>: { use } } for a single slot: the platform default arrangement of UI slots, with contribution keys <extension>/<contribution>; hidden ones are not listed but still open by URL; use names the contribution that replaces the built-in, null for the built-in; null for a slot removes its entry), clientExtensions ({ enabled?, disabled? }: the kill switch of plugin client code; enabled false stops every plugin's interface code in every browser, disabled is the whole list of plugins whose interface code alone is stopped while their tools keep working; read the current list from admin.settings first), devicesFullAccess ({ permission }: the platform's Full permission switch, allowed or off; null clears it back to the default, allowed; through this tool it may only be turned off, never allowed, and a value set in the startup config is read-only
|
|
221
|
+
description: "Change deployment settings (super admin); give only the keys to change: orgCreation (anyone or super_admin), priceCurrency (ISO 4217 code), customConnectors / customSkills (allow or deny: whether orgs may create their own instead of installing from the catalog), orgMarketplaceBrowse (true or false), uiTheme ({ id }: the platform default theme, a platform theme whose scope is all, or null for the built-in theme; it is what every org falls back to and what the sign-in pages show), uiArrangement ({ <slot>: { hidden, order } } for a list slot, { <slot>: { use } } for a single slot: the platform default arrangement of UI slots, with contribution keys <extension>/<contribution>; hidden ones are not listed but still open by URL; use names the contribution that replaces the built-in, null for the built-in; null for a slot removes its entry), clientExtensions ({ enabled?, disabled? }: the kill switch of plugin client code; enabled false stops every plugin's interface code in every browser, disabled is the whole list of plugins whose interface code alone is stopped while their tools keep working; read the current list from admin.settings first), devicesFullAccess ({ permission }: the platform's Full permission switch, allowed or off; null clears it back to the default, allowed; through this tool it may only be turned off, never allowed, and a value set in the startup config is read-only), attribution ({ commit?, pr?, sessionUrl? }: the platform's defaults for agent-created git commits and pull requests; null clears a field back to its default, an empty string turns that line off, and fields set in the startup config are read-only), externalSharing (allow or deny: whether orgs may turn on public links to conversation files; null clears it back to the default, deny; externalSharing may only be turned off through this tool, and a value set in the startup config is read-only), shareMaxExpiryDays (1 to 365: the longest expiry a share may take, in days; null clears it back to 30; through this tool it may only be lowered, never raised, and it is read-only when set in the startup config), htmlRenderCdnAllowlist (the whole list of https origins, scheme and host with an optional port and nothing else, that a rendered HTML file may load from; at most 50; through this tool origins may only be removed, never added, so read the current list from admin.settings first and send it without the ones to drop). promptSuggestions (on or off; null clears it, absent meaning on: whether the composer suggests the person's next message after a completed run; an org's own promptSuggestions must be on too) may be set either way. Per-org limits are orgs.set-limits.",
|
|
221
222
|
input: SettingsInput.refine((b) => Object.keys(b).length > 0, {
|
|
222
223
|
message: "at least one setting is required",
|
|
223
224
|
}),
|
|
@@ -220,7 +220,7 @@ let AgentSkillsOperations = class AgentSkillsOperations {
|
|
|
220
220
|
}),
|
|
221
221
|
defineOperation({
|
|
222
222
|
id: "agents.delete-skill",
|
|
223
|
-
description: "Delete one of an agent's own skills (soft delete; a pending change of the same name is cancelled and the name can be written again). Only the agent's owner can; takes the agent id from agents.list and the skill id from agents.skills.
|
|
223
|
+
description: "Delete one of an agent's own skills (soft delete; a pending change of the same name is cancelled and the name can be written again). Only the agent's owner can; takes the agent id from agents.list and the skill id from agents.skills.",
|
|
224
224
|
input: z.object({ agentId: AgentId, skillId: AgentSkillPathParams.shape.skillId }).strict(),
|
|
225
225
|
example: {
|
|
226
226
|
agentId: "7c1a5b0e-9a53-4c6b-8d64-2f5a1b0c3e77",
|
|
@@ -294,11 +294,11 @@ let AgentSkillsOperations = class AgentSkillsOperations {
|
|
|
294
294
|
},
|
|
295
295
|
{
|
|
296
296
|
code: "sandbox.file_not_found",
|
|
297
|
-
next: "
|
|
297
|
+
next: "No file at that path. Check it with Glob, or build the package first: a zip archive with SKILL.md at its root or in one top-level folder.",
|
|
298
298
|
},
|
|
299
299
|
{
|
|
300
300
|
code: "sandbox.file_is_directory",
|
|
301
|
-
next: "
|
|
301
|
+
next: "The path is a directory; package it as a zip archive (SKILL.md at its root or in one top-level folder) and pass the archive's path.",
|
|
302
302
|
},
|
|
303
303
|
{
|
|
304
304
|
code: "sandbox.file_too_large",
|
|
@@ -456,7 +456,7 @@ let AgentSkillsOperations = class AgentSkillsOperations {
|
|
|
456
456
|
}),
|
|
457
457
|
defineOperation({
|
|
458
458
|
id: "skills.get-change",
|
|
459
|
-
description: "Read one skill change request as the inbox shows it: a share of an agent's skill with the org or a proposed version of a shared skill (kind), the agent, the skill name and description, the version, its file paths and sizes, who asked, its state and who decided. Never file contents: review those on the web, where org admins decide it
|
|
459
|
+
description: "Read one skill change request as the inbox shows it: a share of an agent's skill with the org or a proposed version of a shared skill (kind), the agent, the skill name and description, the version, its file paths and sizes, who asked, its state and who decided. Never file contents: review those on the web, where org admins decide it. Only org admins and the person who asked can read it.",
|
|
460
460
|
input: z.object({ changeId: SkillChangePathParams.shape.id }).strict(),
|
|
461
461
|
example: { changeId: "6a1d3e5f-2b4c-4d70-8e91-0f2a4c6e8b13" },
|
|
462
462
|
// approvals.decide is stricter than the service (a plain-member requester is refused by
|
|
@@ -489,7 +489,7 @@ let AgentSkillsOperations = class AgentSkillsOperations {
|
|
|
489
489
|
decidedAt: d.decidedAt,
|
|
490
490
|
createdAt: d.createdAt,
|
|
491
491
|
...(d.status === "pending" && {
|
|
492
|
-
next: "Review the files and decide it on the web, in the inbox
|
|
492
|
+
next: "Review the files and decide it on the web, in the inbox.",
|
|
493
493
|
}),
|
|
494
494
|
},
|
|
495
495
|
};
|
|
@@ -255,7 +255,7 @@ let AgentsOperations = class AgentsOperations {
|
|
|
255
255
|
}),
|
|
256
256
|
defineOperation({
|
|
257
257
|
id: "agents.update",
|
|
258
|
-
description: 'Change an agent you may edit: your own, private or shared, and as an org admin any agent of the org. Send the version you read from agents.get and only the fields to change; the others keep their value. The description (one short paragraph, "" removes it) is saved with the definition; the avatar and quick actions are changed with agents.update-profile. disabledTools replaces the whole list of turned-off tools (send [] to turn every tool on). disabledSkills replaces the whole list of turned-off skills (send [] to turn every skill on)
|
|
258
|
+
description: 'Change an agent you may edit: your own, private or shared, and as an org admin any agent of the org. Send the version you read from agents.get and only the fields to change; the others keep their value. The description (one short paragraph, "" removes it) is saved with the definition; the avatar and quick actions are changed with agents.update-profile. disabledTools replaces the whole list of turned-off tools (send [] to turn every tool on). disabledSkills replaces the whole list of turned-off skills (send [] to turn every skill on), with entries as agents.create describes. A version that is no longer current is refused, so read the agent again first. The visibility cannot be changed here. A change to your own private agent may be remembered by the person; a change to a shared agent, or one that sets a tool policy to allow, is confirmed every time.',
|
|
259
259
|
input: z
|
|
260
260
|
.object({
|
|
261
261
|
agentId: AgentId,
|
|
@@ -420,7 +420,7 @@ let AgentsOperations = class AgentsOperations {
|
|
|
420
420
|
}),
|
|
421
421
|
defineOperation({
|
|
422
422
|
id: "agents.create-from-template",
|
|
423
|
-
description: "Create a private agent from an agent template, with the previewHash of agents.preview-from-template; a changed template or org makes the hash stale and the preview must be redone. Connectors the template needs that the org lacks become pending entries and a setup request goes to the org admins.
|
|
423
|
+
description: "Create a private agent from an agent template, with the previewHash of agents.preview-from-template; a changed template or org makes the hash stale and the preview must be redone. Connectors the template needs that the org lacks become pending entries and a setup request goes to the org admins.",
|
|
424
424
|
input: AgentFromTemplateBody.pick({
|
|
425
425
|
templateId: true,
|
|
426
426
|
name: true,
|
|
@@ -494,7 +494,7 @@ let AgentsOperations = class AgentsOperations {
|
|
|
494
494
|
}),
|
|
495
495
|
defineOperation({
|
|
496
496
|
id: "agents.delete",
|
|
497
|
-
description: "Delete an agent you may edit: your own, and as an org admin any agent of the org. Its conversations stay readable but it can no longer be used, its eval runs stop and its pending skill changes are cancelled. The
|
|
497
|
+
description: "Delete an agent you may edit: your own, and as an org admin any agent of the org. Its conversations stay readable but it can no longer be used, its eval runs stop and its pending skill changes are cancelled. The agent you are running as cannot be deleted.",
|
|
498
498
|
input: z.object({ agentId: AgentId }).strict(),
|
|
499
499
|
example: { agentId: "7c1a5b0e-9a53-4c6b-8d64-2f5a1b0c3e77" },
|
|
500
500
|
authz: { orgAction: "agents.create" },
|
|
@@ -2,7 +2,7 @@ import { type OnModuleInit } from "@nestjs/common";
|
|
|
2
2
|
import { ApprovalsService, type ApprovalView } from "../../tools/approvals.service.js";
|
|
3
3
|
import { PlatformOperations } from "../registry.js";
|
|
4
4
|
/** Where a person decides an approval: never through an agent (spec §6.4, §14.1 item 2). */
|
|
5
|
-
export declare const DECIDE_ON_WEB = "Decide it on the web, in the inbox or in its conversation
|
|
5
|
+
export declare const DECIDE_ON_WEB = "Decide it on the web, in the inbox or in its conversation.";
|
|
6
6
|
/**
|
|
7
7
|
* An approval as the waiting list shows it: a compact row with the summary the inbox shows (the
|
|
8
8
|
* kernel-rendered summary of a per-call policy, else null). Never the tool input: it may carry
|
|
@@ -15,7 +15,7 @@ import { defineOperation } from "../operation.js";
|
|
|
15
15
|
import { PlatformOperations } from "../registry.js";
|
|
16
16
|
import { Cursor, pageOf, startOf } from "./paging.js";
|
|
17
17
|
/** Where a person decides an approval: never through an agent (spec §6.4, §14.1 item 2). */
|
|
18
|
-
export const DECIDE_ON_WEB = "Decide it on the web, in the inbox or in its conversation
|
|
18
|
+
export const DECIDE_ON_WEB = "Decide it on the web, in the inbox or in its conversation.";
|
|
19
19
|
/**
|
|
20
20
|
* An approval as the waiting list shows it: a compact row with the summary the inbox shows (the
|
|
21
21
|
* kernel-rendered summary of a per-call policy, else null). Never the tool input: it may carry
|
|
@@ -73,7 +73,7 @@ let ApprovalsOperations = class ApprovalsOperations {
|
|
|
73
73
|
this.registry.register([
|
|
74
74
|
defineOperation({
|
|
75
75
|
id: "approvals.waiting",
|
|
76
|
-
description: "List the tool call approvals you can decide in this org, newest first: your own runs' calls and, for org admins, other people's calls that need an admin. One compact row each (tool, state, the summary the inbox shows, agent, expiry);
|
|
76
|
+
description: "List the tool call approvals you can decide in this org, newest first: your own runs' calls and, for org admins, other people's calls that need an admin. One compact row each (tool, state, the summary the inbox shows, agent, expiry); status is one of pending (the default), approved, denied, expired, cancelled. Never the call's input. Deciding is done by you on the web. Pages by 50: pass the returned next as params.cursor.",
|
|
77
77
|
input: z
|
|
78
78
|
.object({ status: ApprovalsListQuerySchema.shape.status, cursor: Cursor.optional() })
|
|
79
79
|
.strict(),
|
|
@@ -65,7 +65,7 @@ let BackgroundOperations = class BackgroundOperations {
|
|
|
65
65
|
}),
|
|
66
66
|
defineOperation({
|
|
67
67
|
id: "conversations.stop-background-task",
|
|
68
|
-
description: "Stop one background command of one of your conversations, as the stop button does: the command is killed. Takes the task id from conversations.background-tasks. A task already stopping or finished is returned as it is.
|
|
68
|
+
description: "Stop one background command of one of your conversations, as the stop button does: the command is killed. Takes the task id from conversations.background-tasks. A task already stopping or finished is returned as it is.",
|
|
69
69
|
input: z.object({ conversationId: ConversationId, taskId: TaskId }).strict(),
|
|
70
70
|
example: {
|
|
71
71
|
conversationId: "3f2b8a40-6c1d-4e0b-9a77-5d1e2c8b9f10",
|
|
@@ -413,7 +413,7 @@ let CatalogAdminOperations = class CatalogAdminOperations {
|
|
|
413
413
|
},
|
|
414
414
|
{
|
|
415
415
|
code: "catalog.item_pending",
|
|
416
|
-
next: "The plugin's first version waits for the super admin's confirmation in the admin console (Plugins →
|
|
416
|
+
next: "The plugin's first version waits for the super admin's confirmation in the admin console (Plugins → Pending); confirm or reject it there first.",
|
|
417
417
|
},
|
|
418
418
|
{
|
|
419
419
|
code: "plugin.skill_conflict",
|
|
@@ -566,7 +566,7 @@ let CatalogAdminOperations = class CatalogAdminOperations {
|
|
|
566
566
|
},
|
|
567
567
|
{
|
|
568
568
|
code: "catalog.item_pending",
|
|
569
|
-
next: "The plugin's first version waits for the super admin's confirmation in the admin console (Plugins →
|
|
569
|
+
next: "The plugin's first version waits for the super admin's confirmation in the admin console (Plugins → Pending); confirm or reject it there first.",
|
|
570
570
|
},
|
|
571
571
|
{
|
|
572
572
|
code: "catalog.org_owned",
|
|
@@ -651,7 +651,7 @@ let CatalogAdminOperations = class CatalogAdminOperations {
|
|
|
651
651
|
}),
|
|
652
652
|
defineOperation({
|
|
653
653
|
id: "plugins.platform-apply-appearance",
|
|
654
|
-
description: "Apply a platform plugin's suggested appearance (super admin; the admin console's
|
|
654
|
+
description: "Apply a platform plugin's suggested appearance (super admin; the admin console's \"Apply this plugin's appearance\" action): in one step, its theme becomes the platform default theme and each component it suggests replaces the built-in block of its slot (shell.brand, conversation.empty, conversation.composer.frame) in the platform arrangement; orgs that set their own keep theirs. The card shows exactly what changes; a theme that cannot be the platform default (scope not all, or off in an org) refuses the whole call, a component that is not available is skipped.",
|
|
655
655
|
input: z.object({ itemId: ItemId }).strict(),
|
|
656
656
|
example: { itemId: "3f1c2a9e-5b7d-4e21-9c0a-1d2e3f4a5b6c" },
|
|
657
657
|
authz: { superAdmin: true },
|
|
@@ -369,7 +369,7 @@ let ConversationsOperations = class ConversationsOperations {
|
|
|
369
369
|
}),
|
|
370
370
|
defineOperation({
|
|
371
371
|
id: "conversations.abort",
|
|
372
|
-
description: "Stop the run that is active in one of your other conversations (its sub-agents stop with it; stopping a sub-agent's conversation stops it and those below it). Nothing happens if no run is active. The
|
|
372
|
+
description: "Stop the run that is active in one of your other conversations (its sub-agents stop with it; stopping a sub-agent's conversation stops it and those below it). Nothing happens if no run is active. The conversation you are working in cannot be stopped.",
|
|
373
373
|
input: Id,
|
|
374
374
|
example: { conversationId: "3f2b8a40-6c1d-4e0b-9a77-5d1e2c8b9f10" },
|
|
375
375
|
authz: { orgAction: "agents.use" },
|
|
@@ -449,7 +449,7 @@ let ConversationsOperations = class ConversationsOperations {
|
|
|
449
449
|
}),
|
|
450
450
|
defineOperation({
|
|
451
451
|
id: "conversations.delete",
|
|
452
|
-
description: "Delete one of your conversations: a running run in it is stopped and the conversation disappears from every list. This cannot be undone from the tool. The
|
|
452
|
+
description: "Delete one of your conversations: a running run in it is stopped and the conversation disappears from every list. This cannot be undone from the tool. The conversation you are working in cannot be deleted.",
|
|
453
453
|
input: Id,
|
|
454
454
|
example: { conversationId: "3f2b8a40-6c1d-4e0b-9a77-5d1e2c8b9f10" },
|
|
455
455
|
authz: { orgAction: "agents.use" },
|
|
@@ -201,7 +201,7 @@ let DevicesOperations = class DevicesOperations {
|
|
|
201
201
|
}),
|
|
202
202
|
defineOperation({
|
|
203
203
|
id: "devices.delete",
|
|
204
|
-
description: "Delete one of your devices, the default one included: its instance and ALL its files are destroyed after the response and cannot be recovered. Conversations bound to it keep pointing at it and their sandbox tools then fail. The
|
|
204
|
+
description: "Delete one of your devices, the default one included: its instance and ALL its files are destroyed after the response and cannot be recovered. Conversations bound to it keep pointing at it and their sandbox tools then fail. The device this conversation works in cannot be deleted. Takes the id from devices.list.",
|
|
205
205
|
input: DeviceId,
|
|
206
206
|
example: { deviceId: "4e8a0c1d-6b2f-4a37-8d19-3c5e7f9a1b20" },
|
|
207
207
|
authz: { orgAction: "agents.use" },
|
|
@@ -236,7 +236,7 @@ let DevicesOperations = class DevicesOperations {
|
|
|
236
236
|
}),
|
|
237
237
|
defineOperation({
|
|
238
238
|
id: "devices.reset-files",
|
|
239
|
-
description: "Wipe one of your devices' files so it starts empty: ALL its files are destroyed (after running commands finish) and cannot be recovered; the next use creates a fresh workspace. Use it when a device reports its files are lost (not for a connected machine's device: its files are on the machine). The
|
|
239
|
+
description: "Wipe one of your devices' files so it starts empty: ALL its files are destroyed (after running commands finish) and cannot be recovered; the next use creates a fresh workspace. Use it when a device reports its files are lost (not for a connected machine's device: its files are on the machine). The device this conversation works in cannot be wiped. Takes the id from devices.list.",
|
|
240
240
|
input: DeviceId,
|
|
241
241
|
example: { deviceId: "4e8a0c1d-6b2f-4a37-8d19-3c5e7f9a1b20" },
|
|
242
242
|
authz: { orgAction: "agents.use" },
|
|
@@ -65,7 +65,7 @@ const detail = (v) => {
|
|
|
65
65
|
return { ...rest, ...why(v) };
|
|
66
66
|
};
|
|
67
67
|
/** Where a super admin confirms permissions: a person, on the web (spec §6.4). */
|
|
68
|
-
const CONFIRM_ON_WEB = "Review and confirm its permissions in the admin console
|
|
68
|
+
const CONFIRM_ON_WEB = "Review and confirm its permissions in the admin console.";
|
|
69
69
|
/** An extension waiting for a permission confirmation: a compact row, the keys it adds. */
|
|
70
70
|
const pendingExtension = (v) => ({
|
|
71
71
|
id: v.name,
|
|
@@ -151,7 +151,7 @@ let ExtensionsAdminOperations = class ExtensionsAdminOperations {
|
|
|
151
151
|
}),
|
|
152
152
|
defineOperation({
|
|
153
153
|
id: "extensions.pending-permissions",
|
|
154
|
-
description: "List what waits for a super admin to confirm extension permissions (super admin): extensions whose permissions changed since they were approved (state pending_approval, with the permission keys added and removed and whether they are sensitive) and catalog plugins waiting for a confirmation, including this org's uploads with an extension. State and permission keys only, never config values. Other orgs' own plugins are only counted (otherOrgItems, otherOrgExtensions). Confirming is done by you in the admin console
|
|
154
|
+
description: "List what waits for a super admin to confirm extension permissions (super admin): extensions whose permissions changed since they were approved (state pending_approval, with the permission keys added and removed and whether they are sensitive) and catalog plugins waiting for a confirmation, including this org's uploads with an extension. State and permission keys only, never config values. Other orgs' own plugins are only counted (otherOrgItems, otherOrgExtensions). Confirming is done by you in the admin console. Pages by 50: pass the returned next as params.cursor.",
|
|
155
155
|
input: z.object({ cursor: Cursor.optional() }).strict(),
|
|
156
156
|
example: {},
|
|
157
157
|
authz: { superAdmin: true },
|
|
@@ -32,10 +32,10 @@ const Tool = OrgExtensionToolParams.shape.tool;
|
|
|
32
32
|
const SwitchConfirm = OrgToolSwitchPut.shape.confirm.unwrap();
|
|
33
33
|
/** The next step of an extension that needs its org config (an org admin enters it on the web). */
|
|
34
34
|
const NEEDS_ORG_CONFIG = {
|
|
35
|
-
orgAdmin: "An org admin fills in its org config on the
|
|
36
|
-
member: "Ask an org admin to fill in its org config on the
|
|
35
|
+
orgAdmin: "An org admin fills in its org config on the Extensions page, where secrets are entered.",
|
|
36
|
+
member: "Ask an org admin to fill in its org config on the Extensions page.",
|
|
37
37
|
};
|
|
38
|
-
/** An extension's state in the org, as the
|
|
38
|
+
/** An extension's state in the org, as the Extensions page shows it. */
|
|
39
39
|
function stateOf(v) {
|
|
40
40
|
if (!v.available)
|
|
41
41
|
return "unavailable";
|
|
@@ -27,9 +27,9 @@ const NOT_FOUND = {
|
|
|
27
27
|
code: "inbox.notice_not_found",
|
|
28
28
|
message: "Notice not found",
|
|
29
29
|
};
|
|
30
|
-
const DECIDE_REQUEST_ON_WEB = "Decide it on the web, in the inbox
|
|
30
|
+
const DECIDE_REQUEST_ON_WEB = "Decide it on the web, in the inbox.";
|
|
31
31
|
const DISMISS_ORG = "Dismiss it with inbox.dismiss-notice once read.";
|
|
32
|
-
const ADMIN_CONSOLE_PENDING = "Review it in the admin console (plugins, pending tab)
|
|
32
|
+
const ADMIN_CONSOLE_PENDING = "Review it in the admin console (plugins, pending tab).";
|
|
33
33
|
/** What a request asks for, by name (the plugin, the marketplace entry or the agent). */
|
|
34
34
|
const requestName = (r) => r.item?.name ?? r.entry?.name ?? r.agent?.name ?? r.kind;
|
|
35
35
|
const requester = (r) => r.requestedByName ?? "a deleted account";
|
|
@@ -85,7 +85,7 @@ function orgRow(i) {
|
|
|
85
85
|
summary: c.kind === "share"
|
|
86
86
|
? `Request by ${by} to share skill ${c.name} of agent ${c.agent.name} with the organization, ${c.files.length} file(s).`
|
|
87
87
|
: `Proposed version ${c.version} of the shared skill ${c.name} by ${by} (agent ${c.agent.name}), ${c.files.length} file(s).`,
|
|
88
|
-
next: "Review and decide it on the web, in the inbox
|
|
88
|
+
next: "Review and decide it on the web, in the inbox.",
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
case "catalog_request": {
|
|
@@ -151,7 +151,7 @@ function platformRow(i) {
|
|
|
151
151
|
name: requestName(r),
|
|
152
152
|
state: r.status,
|
|
153
153
|
summary: `${r.kind} request from org ${r.orgName} by ${requester(r)}. Details: requests.platform-list.`,
|
|
154
|
-
next: "Decide it in the admin console (plugins, pending tab)
|
|
154
|
+
next: "Decide it in the admin console (plugins, pending tab).",
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
case "permission_confirmation":
|
|
@@ -138,7 +138,7 @@ let OrgPluginsOperations = class OrgPluginsOperations {
|
|
|
138
138
|
}),
|
|
139
139
|
defineOperation({
|
|
140
140
|
id: "plugins.upload-review",
|
|
141
|
-
description: "Read one of this org's staged plugin uploads (org admins): what the plugin brings, and for a new version of the org's own plugin the update it applies. Uploading the package and confirming it are done by a person on the web (
|
|
141
|
+
description: "Read one of this org's staged plugin uploads (org admins): what the plugin brings, and for a new version of the org's own plugin the update it applies. Uploading the package and confirming it are done by a person on the web (Plugins page).",
|
|
142
142
|
input: z.object({ stagingId: OrgUploadStagingParams.shape.stagingId }).strict(),
|
|
143
143
|
example: { stagingId: EXAMPLE_ID },
|
|
144
144
|
authz: { orgAction: "catalog.upload" },
|
|
@@ -147,7 +147,7 @@ let OrgPluginsOperations = class OrgPluginsOperations {
|
|
|
147
147
|
errors: [
|
|
148
148
|
{
|
|
149
149
|
code: "plugin.staging_not_found",
|
|
150
|
-
next: "The staged upload expired (24 hours), was confirmed, or is not this org's; the person uploads it again on the
|
|
150
|
+
next: "The staged upload expired (24 hours), was confirmed, or is not this org's; the person uploads it again on the Plugins page.",
|
|
151
151
|
},
|
|
152
152
|
],
|
|
153
153
|
run: async (input, ctx) => {
|
|
@@ -162,7 +162,7 @@ let OrgPluginsOperations = class OrgPluginsOperations {
|
|
|
162
162
|
to: r.update.to,
|
|
163
163
|
components: r.update.components.filter((c) => c.change !== "same").length,
|
|
164
164
|
},
|
|
165
|
-
next: "The person confirms the upload on the web (
|
|
165
|
+
next: "The person confirms the upload on the web (Plugins page).",
|
|
166
166
|
};
|
|
167
167
|
},
|
|
168
168
|
}),
|
|
@@ -334,7 +334,7 @@ let OrgPluginsOperations = class OrgPluginsOperations {
|
|
|
334
334
|
}),
|
|
335
335
|
defineOperation({
|
|
336
336
|
id: "plugins.apply-appearance",
|
|
337
|
-
description: "Apply a plugin's suggested appearance in this org (org admins; the
|
|
337
|
+
description: "Apply a plugin's suggested appearance in this org (org admins; the Extensions page's \"Apply this plugin's appearance\" action), for a plugin whose extension is on here: in one step, its theme becomes the org's default theme (whether members may pick their own stays as it is) and each component it suggests replaces the built-in block of its slot (shell.brand, conversation.empty, conversation.composer.frame) in the org's arrangement. The card shows exactly what changes; a theme that is not on in the org refuses the whole call, a component that is not available is skipped.",
|
|
338
338
|
input: z.object({ extension: OrgExtensionParams.shape.extension }).strict(),
|
|
339
339
|
example: { extension: "theme-cyberpunk" },
|
|
340
340
|
authz: { orgAction: "org.update" },
|
|
@@ -39,7 +39,7 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
39
39
|
this.registry.register([
|
|
40
40
|
defineOperation({
|
|
41
41
|
id: "org-settings.get",
|
|
42
|
-
description: "Read this org's settings: toolSearch, locale, sandboxToolPolicy, platformTool (on, read-only or off), fullAccess (allowed or off: whether the org's devices may run with Full permission; absent follows the deployment's switch, and the org may never exceed it
|
|
42
|
+
description: "Read this org's settings: toolSearch, locale, sandboxToolPolicy, platformTool (on, read-only or off), fullAccess (allowed or off: whether the org's devices may run with Full permission; absent follows the deployment's switch, and the org may never exceed it), cloudNetwork (the org's sandbox-mode network stored as a delta over the platform's allowlist: mode open or allowlist for a cloud device in sandbox mode, absent following the platform; base platform or none; extraHosts the org adds; excludedHosts platform hosts it drops; open means any public host, while loopback, private and cloud metadata addresses stay blocked), wakeOnBackgroundTask (absent means it follows the deployment), theme (the org's default theme id, null or absent following the platform, and personal: allowed or locked), uiArrangement (per list slot, the extension contributions the org hides and their order; per single slot, the contribution that replaces the built-in as use, null for the built-in; a slot not listed follows the platform), the deployment's Full switch (fullAccess) and network (its allowlist, orgHosts: extend lets the org go beyond it, within makes it the ceiling, and off for the platform kill switch), effectiveNetwork (the mode and hosts the org's sandbox mode really gets), externalSharing (on or off, absent meaning off: whether members may share conversation files through public links; the deployment's externalSharing must be allow too) with the deployment's externalSharing and shareMaxExpiryDays, promptSuggestions (on or off, absent meaning on: whether the composer suggests the person's next message after a completed run; the deployment's promptSuggestions must be on too) with the deployment's promptSuggestions, and the sandbox cpu / memory limits in effect.",
|
|
43
43
|
input: z.object({}).strict(),
|
|
44
44
|
example: {},
|
|
45
45
|
authz: { orgAction: "org.read" },
|
|
@@ -57,7 +57,7 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
57
57
|
}),
|
|
58
58
|
defineOperation({
|
|
59
59
|
id: "org-settings.update",
|
|
60
|
-
description: "Change this org's settings (org admins). Give only the settings to change; null clears fullAccess, cloudNetwork or wakeOnBackgroundTask so they follow the deployment again (refused when the deployment value is wider than what this tool may set). fullAccess (allowed or off; the platform must allow it
|
|
60
|
+
description: "Change this org's settings (org admins). Give only the settings to change; null clears fullAccess, cloudNetwork or wakeOnBackgroundTask so they follow the deployment again (refused when the deployment value is wider than what this tool may set). fullAccess (allowed or off; the platform must allow it) and cloudNetwork ({ mode?, base?: platform | none, extraHosts?, excludedHosts? }, replaced whole, so send the stored fields you keep) may only narrow the org's devices here: allowing Full where the org has it off, switching the cloud network from allowlist to open, adding an extra host, dropping an exclusion or moving base from none to platform is refused and needs a person in the organization settings on the web. theme: { id, personal } sets the org's default theme (a theme id from themes.list, or null to follow the platform) and whether members may pick their own (allowed) or not (locked); null clears it. uiArrangement: { <slot>: { hidden, order } } (a list slot) or { <slot>: { use } } (a single slot: shell.brand, conversation.empty, conversation.composer.frame) replaces that slot's entry, where hidden, order and use name contribution keys <extension>/<contribution> (hidden ones are not listed in the web UI but their pages still open by URL; use null is the built-in); null for a slot makes it follow the platform again; platform.page is refused. externalSharing (on or off; null clears it, off) may only be turned off through this tool: turning it on needs a person in the organization settings on the web, and the platform must allow it. promptSuggestions (on or off; null clears it, absent meaning on: whether the composer suggests the person's next message after a completed run; the deployment's promptSuggestions must be on too) may be set either way through this tool. Setting platformTool to off or read-only takes effect from the next call and cuts this Platform tool off in the org; an org admin switches it back on in the web settings.",
|
|
61
61
|
input: OrgSettingsPatchSchema.refine((i) => Object.values(i).some((v) => v !== undefined), {
|
|
62
62
|
message: "give at least one setting",
|
|
63
63
|
}),
|