@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.
Files changed (121) hide show
  1. package/dist/admin/admin.module.js +2 -0
  2. package/dist/admin/admin.schemas.d.ts +4 -0
  3. package/dist/admin/health.service.d.ts +2 -2
  4. package/dist/admin/health.service.js +8 -4
  5. package/dist/agents/agents.schemas.js +1 -1
  6. package/dist/agents/instruction-files.js +0 -3
  7. package/dist/background/launch.d.ts +4 -0
  8. package/dist/background/launch.js +6 -2
  9. package/dist/catalog/marketplaces.service.d.ts +1 -1
  10. package/dist/channels/channels.module.js +3 -0
  11. package/dist/channels/connections.service.d.ts +18 -5
  12. package/dist/channels/connections.service.js +21 -5
  13. package/dist/channels/features.d.ts +2 -0
  14. package/dist/channels/features.js +9 -5
  15. package/dist/channels/file-delivery.d.ts +74 -0
  16. package/dist/channels/file-delivery.js +176 -0
  17. package/dist/channels/outbound.d.ts +6 -3
  18. package/dist/channels/outbound.js +156 -4
  19. package/dist/channels/phrases.d.ts +19 -0
  20. package/dist/channels/phrases.js +16 -0
  21. package/dist/config/schema.d.ts +2 -0
  22. package/dist/config/schema.js +18 -0
  23. package/dist/conversations/delivery-scope.d.ts +34 -0
  24. package/dist/conversations/delivery-scope.js +23 -0
  25. package/dist/conversations/event-log.d.ts +18 -0
  26. package/dist/conversations/event-log.js +54 -0
  27. package/dist/conversations/events.d.ts +2 -0
  28. package/dist/conversations/events.js +15 -2
  29. package/dist/conversations/prompt-suggestion-request.d.ts +95 -0
  30. package/dist/conversations/prompt-suggestion-request.js +213 -0
  31. package/dist/conversations/prompt-suggestion-store.d.ts +51 -0
  32. package/dist/conversations/prompt-suggestion-store.js +136 -0
  33. package/dist/conversations/prompt-suggestions.d.ts +153 -0
  34. package/dist/conversations/prompt-suggestions.js +563 -0
  35. package/dist/conversations/titles.js +11 -5
  36. package/dist/evals/reconstruct.d.ts +26 -1
  37. package/dist/evals/reconstruct.js +25 -6
  38. package/dist/identity/settings.d.ts +13 -0
  39. package/dist/identity/settings.js +37 -2
  40. package/dist/infra/queue/queue-names.d.ts +1 -1
  41. package/dist/infra/queue/queue-names.js +1 -0
  42. package/dist/kernel.module.js +4 -1
  43. package/dist/lifecycle/kernel-lifecycle.d.ts +3 -1
  44. package/dist/lifecycle/kernel-lifecycle.js +13 -7
  45. package/dist/models/image-usable.d.ts +30 -6
  46. package/dist/models/image-usable.js +38 -7
  47. package/dist/models/images.js +6 -4
  48. package/dist/models/purposes.d.ts +1 -1
  49. package/dist/models/purposes.js +10 -4
  50. package/dist/orgs/settings.service.d.ts +16 -0
  51. package/dist/orgs/settings.service.js +46 -5
  52. package/dist/overrides.d.ts +4 -0
  53. package/dist/overrides.js +2 -0
  54. package/dist/platform/availability.d.ts +5 -0
  55. package/dist/platform/availability.js +7 -3
  56. package/dist/platform/ops/accounts.ops.d.ts +1 -1
  57. package/dist/platform/ops/accounts.ops.js +1 -1
  58. package/dist/platform/ops/admin.ops.js +3 -2
  59. package/dist/platform/ops/agent-skills.ops.js +5 -5
  60. package/dist/platform/ops/agents.ops.js +3 -3
  61. package/dist/platform/ops/approvals.ops.d.ts +1 -1
  62. package/dist/platform/ops/approvals.ops.js +2 -2
  63. package/dist/platform/ops/background.ops.js +1 -1
  64. package/dist/platform/ops/catalog-admin.ops.js +3 -3
  65. package/dist/platform/ops/conversations.ops.js +2 -2
  66. package/dist/platform/ops/devices.ops.js +2 -2
  67. package/dist/platform/ops/extensions-admin.ops.js +2 -2
  68. package/dist/platform/ops/extensions.ops.js +3 -3
  69. package/dist/platform/ops/inbox.ops.js +4 -4
  70. package/dist/platform/ops/org-plugins.ops.js +4 -4
  71. package/dist/platform/ops/org-settings.ops.js +2 -2
  72. package/dist/platform/ops/orgs.ops.js +1 -0
  73. package/dist/platform/ops/plugins.ops.d.ts +1 -1
  74. package/dist/platform/ops/plugins.ops.js +3 -3
  75. package/dist/platform/ops/requests.ops.js +1 -1
  76. package/dist/platform/ops/schedules.ops.js +6 -6
  77. package/dist/roles/worker-role.d.ts +6 -3
  78. package/dist/roles/worker-role.js +21 -13
  79. package/dist/roles/worker.module.js +2 -0
  80. package/dist/runtime/compaction-settings.service.d.ts +8 -0
  81. package/dist/runtime/compaction-settings.service.js +12 -6
  82. package/dist/runtime/run-processors.d.ts +14 -6
  83. package/dist/runtime/run-processors.js +43 -8
  84. package/dist/runtime/run-worker.d.ts +5 -0
  85. package/dist/runtime/run-worker.js +24 -16
  86. package/dist/runtime/runtime.module.d.ts +1 -1
  87. package/dist/runtime/runtime.module.js +7 -1
  88. package/dist/runtime/stream.d.ts +7 -1
  89. package/dist/runtime/stream.js +54 -3
  90. package/dist/runtime/usage-report.d.ts +2 -1
  91. package/dist/runtime/usage-report.js +2 -1
  92. package/dist/sandbox/sandbox-file-reader.js +1 -1
  93. package/dist/storage/storage.service.d.ts +2 -0
  94. package/dist/storage/storage.service.js +3 -0
  95. package/dist/tools/builtin-names.js +2 -2
  96. package/dist/tools/builtins/agent.js +5 -5
  97. package/dist/tools/builtins/artifacts.d.ts +34 -8
  98. package/dist/tools/builtins/artifacts.js +95 -19
  99. package/dist/tools/builtins/image/generate.d.ts +4 -1
  100. package/dist/tools/builtins/image/generate.js +70 -14
  101. package/dist/tools/builtins/platform.d.ts +0 -2
  102. package/dist/tools/builtins/platform.js +3 -5
  103. package/dist/tools/builtins/sandbox/bash.js +15 -11
  104. package/dist/tools/builtins/sandbox/common.d.ts +3 -2
  105. package/dist/tools/builtins/sandbox/deliver.js +13 -7
  106. package/dist/tools/builtins/sandbox/glob.js +1 -1
  107. package/dist/tools/builtins/sandbox/grep.js +1 -1
  108. package/dist/tools/builtins/sandbox/read.js +3 -3
  109. package/dist/tools/builtins/sandbox/task-output.d.ts +1 -1
  110. package/dist/tools/builtins/sandbox/task-output.js +13 -11
  111. package/dist/tools/builtins/send-message.d.ts +1 -1
  112. package/dist/tools/builtins/send-message.js +3 -3
  113. package/dist/tools/builtins/skill-load.d.ts +1 -1
  114. package/dist/tools/builtins/tool-search.js +1 -1
  115. package/dist/tools/builtins/web/extract.js +1 -1
  116. package/dist/tools/builtins/web/search.js +2 -4
  117. package/dist/tools/connector-account-policies.js +1 -1
  118. package/dist/tools/info.d.ts +3 -1
  119. package/dist/tools/registry.d.ts +6 -0
  120. package/dist/tools/registry.js +1 -1
  121. package/package.json +3 -3
@@ -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 configuration a person must enter; ask them to enable it on the \u63D2\u4EF6 page.";
11
+ export declare const NEEDS_INPUT = "This plugin needs configuration a person must enter; ask them to enable it on the Plugins page.";
12
12
  /**
13
13
  * Plugin operations of the `Platform` tool (spec §7): the org's view (list, get, switch on or off)
14
14
  * and the super admin's platform view (list, get, update with its preview). Every platform result
@@ -40,7 +40,7 @@ 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 configuration a person must enter; ask them to enable it on the 插件 page.";
43
+ export const NEEDS_INPUT = "This plugin needs configuration a person must enter; ask them to enable it on the Plugins page.";
44
44
  /** The English name of a plugin as next steps and messages name it. */
45
45
  const enName = (i) => localized(i.displayName, i.name).en;
46
46
  /** The item with the reason its extension stopped loading (state unchanged), when it has one. */
@@ -211,7 +211,7 @@ let PluginsOperations = class PluginsOperations {
211
211
  }),
212
212
  defineOperation({
213
213
  id: "plugins.set-enabled",
214
- description: "Switch a plugin on or off in this org. Switching on installs it; a plugin whose enabling needs configuration a person enters (connector credentials, extension config) is refused, so point the person to the 插件 page. Switching off removes what the plugin brought and needs confirm: the value plugins.disable-preview returned with the preview the person saw.",
214
+ description: "Switch a plugin on or off in this org. Switching on installs it; a plugin whose enabling needs configuration a person enters (connector credentials, extension config) is refused, so point the person to the Plugins page. Switching off removes what the plugin brought and needs confirm: the value plugins.disable-preview returned with the preview the person saw.",
215
215
  input: z.discriminatedUnion("enabled", [
216
216
  z.object({ itemId: ItemId, enabled: z.literal(true) }).strict(),
217
217
  z.object({ itemId: ItemId, enabled: z.literal(false), confirm: Confirm }).strict(),
@@ -251,7 +251,7 @@ let PluginsOperations = class PluginsOperations {
251
251
  },
252
252
  {
253
253
  code: "plugin.needs_input",
254
- next: "Ask the person to enable it on the 插件 page, where they enter its configuration.",
254
+ next: "Ask the person to enable it on the Plugins page, where they enter its configuration.",
255
255
  },
256
256
  {
257
257
  code: "catalog.approval_required",
@@ -46,7 +46,7 @@ const pendingRow = (r) => ({
46
46
  kind: r.kind,
47
47
  requestedBy: r.requestedByName,
48
48
  note: r.note,
49
- next: "Decide it on the web, in the inbox; agents never decide requests.",
49
+ next: "Decide it on the web, in the inbox.",
50
50
  });
51
51
  /**
52
52
  * Request operations of the `Platform` tool (spec §7): a member asks the org admins to switch a
@@ -189,7 +189,7 @@ let SchedulesOperations = class SchedulesOperations {
189
189
  }),
190
190
  defineOperation({
191
191
  id: "schedules.create",
192
- description: "Create a scheduled task: an agent runs the prompt on a 5-field cron (or once at a local date-time) as you, unattended. The task's time zone is yours; timeZone is only the fallback when you have none set. mode: new (a conversation per run), conversation (post into one conversation) or chat (an IM chat). model ({ provider, model } like an agent definition's), effort and deviceId are for mode new only; a conversation or chat task runs with that conversation's model. Without expiresAt a cron task ends after the org's default expiry, when the org sets one. grants pre-approve tools the unattended run may use. The person confirms every creation; it is never remembered.",
192
+ description: "Create a scheduled task: an agent runs the prompt on a 5-field cron (or once at a local date-time) as you, unattended. The task's time zone is yours; timeZone is only the fallback when you have none set. mode: new (a conversation per run), conversation (post into one conversation) or chat (an IM chat). model ({ provider, model } like an agent definition's), effort and deviceId are for mode new only; a conversation or chat task runs with that conversation's model. Without expiresAt a cron task ends after the org's default expiry, when the org sets one. grants pre-approve tools the unattended run may use.",
193
193
  input: CreateBody,
194
194
  example: {
195
195
  agentId: "4e8a0c1d-6b2f-4a37-8d19-3c5e7f9a1b20",
@@ -237,7 +237,7 @@ let SchedulesOperations = class SchedulesOperations {
237
237
  }),
238
238
  defineOperation({
239
239
  id: "schedules.update",
240
- description: "Change one of your own scheduled tasks (name, prompt, schedule, time zone, target, model, effort, device, expiry; null clears an optional field, and a null expiry on a cron task takes the org's default expiry when set). model, effort and deviceId are for mode new only; switching to another mode clears them. Only the creator can; an org admin can pause it instead. The person confirms every change; it is never remembered. Takes the id from schedules.list.",
240
+ description: "Change one of your own scheduled tasks (name, prompt, schedule, time zone, target, model, effort, device, expiry; null clears an optional field, and a null expiry on a cron task takes the org's default expiry when set). model, effort and deviceId are for mode new only; switching to another mode clears them. Only the creator can; an org admin can pause it instead. Takes the id from schedules.list.",
241
241
  input: UpdateBody.extend({ scheduleId: Id }).strict(),
242
242
  example: { scheduleId: EXAMPLE_ID, prompt: "Summarize the last two days." },
243
243
  authz: { orgAction: "schedules.use" },
@@ -275,7 +275,7 @@ let SchedulesOperations = class SchedulesOperations {
275
275
  }),
276
276
  defineOperation({
277
277
  id: "schedules.delete",
278
- description: "Delete a scheduled task (yours; an org admin can delete any). The person confirms every delete; it is never remembered. Takes the id from schedules.list.",
278
+ description: "Delete a scheduled task (yours; an org admin can delete any). Takes the id from schedules.list.",
279
279
  input: TaskId,
280
280
  example: { scheduleId: EXAMPLE_ID },
281
281
  authz: { orgAction: "org.read" },
@@ -323,7 +323,7 @@ let SchedulesOperations = class SchedulesOperations {
323
323
  }),
324
324
  defineOperation({
325
325
  id: "schedules.resume",
326
- description: "Resume a paused scheduled task: the next run is computed from now (missed ticks are not caught up). An ended task cannot be resumed. The person confirms every resume; it is never remembered. Takes the id from schedules.list.",
326
+ description: "Resume a paused scheduled task: the next run is computed from now (missed ticks are not caught up). An ended task cannot be resumed. Takes the id from schedules.list.",
327
327
  input: TaskId,
328
328
  example: { scheduleId: EXAMPLE_ID },
329
329
  authz: { orgAction: "schedules.use" },
@@ -359,7 +359,7 @@ let SchedulesOperations = class SchedulesOperations {
359
359
  }),
360
360
  defineOperation({
361
361
  id: "schedules.run",
362
- description: "Run one of your own scheduled tasks now, outside its schedule (the schedule does not move). trial=true is an attended trial: you approve its tool calls and they become the task's approved tools. Counts toward the hourly run limit. The person confirms every run; it is never remembered. Takes the id from schedules.list.",
362
+ description: "Run one of your own scheduled tasks now, outside its schedule (the schedule does not move). trial=true is an attended trial: you approve its tool calls and they become the task's approved tools. Counts toward the hourly run limit. Takes the id from schedules.list.",
363
363
  input: RunBody.extend({ scheduleId: Id }).strict(),
364
364
  example: { scheduleId: EXAMPLE_ID, trial: true },
365
365
  authz: { orgAction: "schedules.use" },
@@ -432,7 +432,7 @@ let SchedulesOperations = class SchedulesOperations {
432
432
  }),
433
433
  defineOperation({
434
434
  id: "schedules.grants-add",
435
- description: "Approve tools in advance for one of your own scheduled tasks: an unattended run may then call them without asking. Only tools you could approve with always-allow yourself; never a Platform operation (each is decided per call) and nothing the org forbids. Returns the task's approved tools as { toolKey, connectorId }. The person confirms every change; it is never remembered. Takes the id from schedules.list.",
435
+ description: "Approve tools in advance for one of your own scheduled tasks: an unattended run may then call them without asking. Only tools you could approve with always-allow yourself; never a Platform operation (each is decided per call) and nothing the org forbids. Returns the task's approved tools as { toolKey, connectorId }. Takes the id from schedules.list.",
436
436
  input: GrantsBody.extend({ scheduleId: Id }).strict(),
437
437
  example: { scheduleId: EXAMPLE_ID, grants: [{ toolKey: "WebFetch" }] },
438
438
  authz: { orgAction: "schedules.use" },
@@ -1,6 +1,7 @@
1
1
  import { PluginScopeSyncProcessor } from "../catalog/scope-sync-workers.js";
2
2
  import { ChannelsProcessor } from "../channels/channels.module.js";
3
3
  import { ChannelOutbound } from "../channels/outbound.js";
4
+ import { PromptSuggestionQueue } from "../conversations/prompt-suggestions.js";
4
5
  import { TitleQueue } from "../conversations/titles.js";
5
6
  import { EvalsProcessor } from "../evals/evals.module.js";
6
7
  import { EvalWorker } from "../evals/worker.js";
@@ -10,14 +11,14 @@ import { LockedIntervalScheduler } from "../infra/schedule/locked-interval.js";
10
11
  import { ScheduledRuns } from "../infra/schedule/scheduled-runs.js";
11
12
  import type { KernelLogger } from "../log.js";
12
13
  import { MaintenanceProcessor } from "../runtime/maintenance.js";
13
- import { RunsProcessor, SubagentRunsProcessor, TitleProcessor, UsageReportProcessor } from "../runtime/run-processors.js";
14
+ import { PromptSuggestionProcessor, RunsProcessor, SubagentRunsProcessor, TitleProcessor, UsageReportProcessor } from "../runtime/run-processors.js";
14
15
  import { RunWorker } from "../runtime/run-worker.js";
15
16
  import { UsageReporter } from "../runtime/usage-report.js";
16
17
  /**
17
18
  * The worker role's parts, driven by `KernelLifecycle` at fixed points of its start order and stop
18
19
  * phases (so they stay ordered after the extension load and before the extension host closes): the
19
20
  * queue consumers (runs, sub-agent runs, evals, maintenance, the plugin scope sync, lifecycle
20
- * hook deliveries, channel deliveries, `usage.report`, titles) and the schedulers of the `@LockedCron` / `@LockedInterval` jobs. Provided only by
21
+ * hook deliveries, channel deliveries, `usage.report`, titles, prompt suggestions) and the schedulers of the `@LockedCron` / `@LockedInterval` jobs. Provided only by
21
22
  * `WorkerModule`, so a process without the worker role has none of them.
22
23
  */
23
24
  export declare class WorkerRole {
@@ -28,11 +29,13 @@ export declare class WorkerRole {
28
29
  private readonly evalWorker;
29
30
  private readonly usageReport;
30
31
  private readonly titles;
32
+ private readonly suggestions;
31
33
  private readonly channelOutbound;
32
34
  private readonly runsProcessor;
33
35
  private readonly subagentRunsProcessor;
34
36
  private readonly usageProcessor;
35
37
  private readonly titleProcessor;
38
+ private readonly suggestionProcessor;
36
39
  private readonly channelsProcessor;
37
40
  private readonly evalsProcessor;
38
41
  private readonly maintenanceProcessor;
@@ -44,7 +47,7 @@ export declare class WorkerRole {
44
47
  private runsStarted;
45
48
  /** The eval worker was started: the runs phase drains it. */
46
49
  private evalsStarted;
47
- constructor(config: KernelConfigService, log: KernelLogger, intervals: LockedIntervalScheduler, scheduledRuns: ScheduledRuns, runWorker: RunWorker, evalWorker: EvalWorker, usageReport: UsageReporter, titles: TitleQueue, channelOutbound: ChannelOutbound, runsProcessor: RunsProcessor, subagentRunsProcessor: SubagentRunsProcessor, usageProcessor: UsageReportProcessor, titleProcessor: TitleProcessor, channelsProcessor: ChannelsProcessor, evalsProcessor: EvalsProcessor, maintenanceProcessor: MaintenanceProcessor, scopeProcessor: PluginScopeSyncProcessor, lifecycleProcessor: LifecycleHooksProcessor);
50
+ constructor(config: KernelConfigService, log: KernelLogger, intervals: LockedIntervalScheduler, scheduledRuns: ScheduledRuns, runWorker: RunWorker, evalWorker: EvalWorker, usageReport: UsageReporter, titles: TitleQueue, suggestions: PromptSuggestionQueue, channelOutbound: ChannelOutbound, runsProcessor: RunsProcessor, subagentRunsProcessor: SubagentRunsProcessor, usageProcessor: UsageReportProcessor, titleProcessor: TitleProcessor, suggestionProcessor: PromptSuggestionProcessor, channelsProcessor: ChannelsProcessor, evalsProcessor: EvalsProcessor, maintenanceProcessor: MaintenanceProcessor, scopeProcessor: PluginScopeSyncProcessor, lifecycleProcessor: LifecycleHooksProcessor);
48
51
  /**
49
52
  * Starts the queue consumers (after the extension load), then opens the schedules' start gate:
50
53
  * the cron and interval timers were armed at application bootstrap, but every tick before this
@@ -11,6 +11,7 @@ import { Inject, Injectable } from "@nestjs/common";
11
11
  import { PluginScopeSyncProcessor } from "../catalog/scope-sync-workers.js";
12
12
  import { ChannelsProcessor } from "../channels/channels.module.js";
13
13
  import { ChannelOutbound } from "../channels/outbound.js";
14
+ import { PromptSuggestionQueue } from "../conversations/prompt-suggestions.js";
14
15
  import { TitleQueue } from "../conversations/titles.js";
15
16
  import { EvalsProcessor } from "../evals/evals.module.js";
16
17
  import { EvalWorker } from "../evals/worker.js";
@@ -20,14 +21,14 @@ import { LockedIntervalScheduler } from "../infra/schedule/locked-interval.js";
20
21
  import { ScheduledRuns } from "../infra/schedule/scheduled-runs.js";
21
22
  import { KERNEL_LOGGER } from "../infra/tokens.js";
22
23
  import { MaintenanceProcessor } from "../runtime/maintenance.js";
23
- import { RunsProcessor, SubagentRunsProcessor, TitleProcessor, UsageReportProcessor, } from "../runtime/run-processors.js";
24
+ import { PromptSuggestionProcessor, RunsProcessor, SubagentRunsProcessor, TitleProcessor, UsageReportProcessor, } from "../runtime/run-processors.js";
24
25
  import { RunWorker } from "../runtime/run-worker.js";
25
26
  import { UsageReporter } from "../runtime/usage-report.js";
26
27
  /**
27
28
  * The worker role's parts, driven by `KernelLifecycle` at fixed points of its start order and stop
28
29
  * phases (so they stay ordered after the extension load and before the extension host closes): the
29
30
  * queue consumers (runs, sub-agent runs, evals, maintenance, the plugin scope sync, lifecycle
30
- * hook deliveries, channel deliveries, `usage.report`, titles) and the schedulers of the `@LockedCron` / `@LockedInterval` jobs. Provided only by
31
+ * hook deliveries, channel deliveries, `usage.report`, titles, prompt suggestions) and the schedulers of the `@LockedCron` / `@LockedInterval` jobs. Provided only by
31
32
  * `WorkerModule`, so a process without the worker role has none of them.
32
33
  */
33
34
  let WorkerRole = class WorkerRole {
@@ -38,11 +39,13 @@ let WorkerRole = class WorkerRole {
38
39
  evalWorker;
39
40
  usageReport;
40
41
  titles;
42
+ suggestions;
41
43
  channelOutbound;
42
44
  runsProcessor;
43
45
  subagentRunsProcessor;
44
46
  usageProcessor;
45
47
  titleProcessor;
48
+ suggestionProcessor;
46
49
  channelsProcessor;
47
50
  evalsProcessor;
48
51
  maintenanceProcessor;
@@ -54,7 +57,7 @@ let WorkerRole = class WorkerRole {
54
57
  runsStarted = false;
55
58
  /** The eval worker was started: the runs phase drains it. */
56
59
  evalsStarted = false;
57
- constructor(config, log, intervals, scheduledRuns, runWorker, evalWorker, usageReport, titles, channelOutbound, runsProcessor, subagentRunsProcessor, usageProcessor, titleProcessor, channelsProcessor, evalsProcessor, maintenanceProcessor, scopeProcessor, lifecycleProcessor) {
60
+ constructor(config, log, intervals, scheduledRuns, runWorker, evalWorker, usageReport, titles, suggestions, channelOutbound, runsProcessor, subagentRunsProcessor, usageProcessor, titleProcessor, suggestionProcessor, channelsProcessor, evalsProcessor, maintenanceProcessor, scopeProcessor, lifecycleProcessor) {
58
61
  this.log = log;
59
62
  this.intervals = intervals;
60
63
  this.scheduledRuns = scheduledRuns;
@@ -62,11 +65,13 @@ let WorkerRole = class WorkerRole {
62
65
  this.evalWorker = evalWorker;
63
66
  this.usageReport = usageReport;
64
67
  this.titles = titles;
68
+ this.suggestions = suggestions;
65
69
  this.channelOutbound = channelOutbound;
66
70
  this.runsProcessor = runsProcessor;
67
71
  this.subagentRunsProcessor = subagentRunsProcessor;
68
72
  this.usageProcessor = usageProcessor;
69
73
  this.titleProcessor = titleProcessor;
74
+ this.suggestionProcessor = suggestionProcessor;
70
75
  this.channelsProcessor = channelsProcessor;
71
76
  this.evalsProcessor = evalsProcessor;
72
77
  this.maintenanceProcessor = maintenanceProcessor;
@@ -93,6 +98,7 @@ let WorkerRole = class WorkerRole {
93
98
  this.channelOutbound.startWorker(this.channelsProcessor.worker);
94
99
  this.usageReport.startWorker(this.usageProcessor.worker);
95
100
  this.titles.startWorker(this.titleProcessor.worker);
101
+ this.suggestions.startWorker(this.suggestionProcessor.worker);
96
102
  if (!this.config.roles.includes("gateway")) {
97
103
  this.log.info("this process runs the worker role without gateway; channel long connections are held only by processes with the gateway role", { roles: this.config.roles });
98
104
  }
@@ -137,15 +143,17 @@ WorkerRole = __decorate([
137
143
  __param(5, Inject(EvalWorker)),
138
144
  __param(6, Inject(UsageReporter)),
139
145
  __param(7, Inject(TitleQueue)),
140
- __param(8, Inject(ChannelOutbound)),
141
- __param(9, Inject(RunsProcessor)),
142
- __param(10, Inject(SubagentRunsProcessor)),
143
- __param(11, Inject(UsageReportProcessor)),
144
- __param(12, Inject(TitleProcessor)),
145
- __param(13, Inject(ChannelsProcessor)),
146
- __param(14, Inject(EvalsProcessor)),
147
- __param(15, Inject(MaintenanceProcessor)),
148
- __param(16, Inject(PluginScopeSyncProcessor)),
149
- __param(17, Inject(LifecycleHooksProcessor))
146
+ __param(8, Inject(PromptSuggestionQueue)),
147
+ __param(9, Inject(ChannelOutbound)),
148
+ __param(10, Inject(RunsProcessor)),
149
+ __param(11, Inject(SubagentRunsProcessor)),
150
+ __param(12, Inject(UsageReportProcessor)),
151
+ __param(13, Inject(TitleProcessor)),
152
+ __param(14, Inject(PromptSuggestionProcessor)),
153
+ __param(15, Inject(ChannelsProcessor)),
154
+ __param(16, Inject(EvalsProcessor)),
155
+ __param(17, Inject(MaintenanceProcessor)),
156
+ __param(18, Inject(PluginScopeSyncProcessor)),
157
+ __param(19, Inject(LifecycleHooksProcessor))
150
158
  ], WorkerRole);
151
159
  export { WorkerRole };
@@ -19,6 +19,7 @@ import { ClientReportsCron } from "../client/client-reports.cron.js";
19
19
  import { AttachmentsModule } from "../conversations/attachments.module.js";
20
20
  import { AttachmentCleanupJob } from "../conversations/attachments.service.js";
21
21
  import { EventLogModule } from "../conversations/event-log.js";
22
+ import { PromptSuggestionsModule } from "../conversations/prompt-suggestions.js";
22
23
  import { TitlesModule } from "../conversations/titles.js";
23
24
  import { LegacySandboxCleanupJob } from "../devices/legacy-cleanup.job.js";
24
25
  import { EvalWorkersModule } from "../evals/evals.module.js";
@@ -77,6 +78,7 @@ let WorkerModule = WorkerModule_1 = class WorkerModule {
77
78
  RunJobsModule,
78
79
  UsageReportModule,
79
80
  TitlesModule,
81
+ PromptSuggestionsModule,
80
82
  AttachmentsModule,
81
83
  StorageModule,
82
84
  SandboxModule,
@@ -1,6 +1,14 @@
1
+ import type { KernelSchemaDb } from "../db/kernel-schema.js";
1
2
  import { type CompactionSettings, SettingsService } from "../identity/settings.js";
2
3
  import { KernelDb } from "../infra/database/kernel-db.js";
3
4
  export { COMPACTION_SETTINGS, type CompactionSettings, effectiveCompactionSettings, } from "../identity/settings.js";
5
+ /**
6
+ * The effective compaction settings for `orgId` (org override > platform setting > built-in
7
+ * default), read live from the platform settings and the org row. Shared by
8
+ * {@link CompactionSettingsService} and readers outside the runtime module (the prompt suggestion
9
+ * job), which would otherwise import the runtime module in a cycle.
10
+ */
11
+ export declare function resolveCompactionSettings(settings: Pick<SettingsService, "get">, db: KernelSchemaDb, orgId: string): Promise<CompactionSettings>;
4
12
  /**
5
13
  * The compaction settings in effect for one organization (context compaction spec §4.8):
6
14
  * the organization's override over the platform's stored settings, which carry the built-in
@@ -12,6 +12,16 @@ import { effectiveCompactionSettings, SettingsService, } from "../identity/setti
12
12
  import { KernelDb } from "../infra/database/kernel-db.js";
13
13
  import { readOrgSettings } from "../orgs/settings.service.js";
14
14
  export { COMPACTION_SETTINGS, effectiveCompactionSettings, } from "../identity/settings.js";
15
+ /**
16
+ * The effective compaction settings for `orgId` (org override > platform setting > built-in
17
+ * default), read live from the platform settings and the org row. Shared by
18
+ * {@link CompactionSettingsService} and readers outside the runtime module (the prompt suggestion
19
+ * job), which would otherwise import the runtime module in a cycle.
20
+ */
21
+ export async function resolveCompactionSettings(settings, db, orgId) {
22
+ const [platform, org] = await Promise.all([settings.get(), readOrgSettings(db, orgId)]);
23
+ return effectiveCompactionSettings(platform.compaction, org.compaction);
24
+ }
15
25
  /**
16
26
  * The compaction settings in effect for one organization (context compaction spec §4.8):
17
27
  * the organization's override over the platform's stored settings, which carry the built-in
@@ -26,12 +36,8 @@ let CompactionSettingsService = class CompactionSettingsService {
26
36
  this.db = db;
27
37
  }
28
38
  /** The effective settings for `orgId`: org override > platform setting > built-in default. */
29
- async resolve(orgId) {
30
- const [platform, org] = await Promise.all([
31
- this.settings.get(),
32
- readOrgSettings(this.db.db, orgId),
33
- ]);
34
- return effectiveCompactionSettings(platform.compaction, org.compaction);
39
+ resolve(orgId) {
40
+ return resolveCompactionSettings(this.settings, this.db.db, orgId);
35
41
  }
36
42
  };
37
43
  CompactionSettingsService = __decorate([
@@ -2,6 +2,7 @@ import { WorkerHost } from "@nestjs/bullmq";
2
2
  import { type DynamicModule } from "@nestjs/common";
3
3
  import type { Job, Worker } from "bullmq";
4
4
  import type { KernelConfig } from "../config/schema.js";
5
+ import { type PromptSuggestionJob, PromptSuggestionQueue } from "../conversations/prompt-suggestions.js";
5
6
  import { TitleQueue } from "../conversations/titles.js";
6
7
  import { type RUN_JOB, type RunJobData } from "./run-jobs.js";
7
8
  import { RunWorker } from "./run-worker.js";
@@ -53,13 +54,20 @@ export declare class TitleProcessor extends WorkerHost<Worker<{
53
54
  }>): Promise<void>;
54
55
  error(err: Error): void;
55
56
  }
57
+ /** The consumer of `cap-kernel-suggestions`: {@link PromptSuggestionQueue}. */
58
+ export declare class PromptSuggestionProcessor extends WorkerHost<Worker<PromptSuggestionJob>> {
59
+ private readonly suggestions;
60
+ constructor(suggestions: PromptSuggestionQueue);
61
+ process(job: Job<PromptSuggestionJob>): Promise<void>;
62
+ error(err: Error): void;
63
+ }
56
64
  /**
57
- * The runtime's queue consumers: the run worker on both run queues, `usage.report` deliveries and
58
- * conversation titles. Imported only by the worker role (`WorkerModule`), so other roles get no
59
- * processor and no BullMQ worker. Their worker options come from the startup config (concurrency
60
- * per queue, the run queues' job lock and stalled detection, which the usage and title workers
61
- * follow). The workers never start by themselves: the worker role (`WorkerRole`) starts them after
62
- * the extensions loaded, and pauses them on stop.
65
+ * The runtime's queue consumers: the run worker on both run queues, `usage.report` deliveries,
66
+ * conversation titles and prompt suggestions. Imported only by the worker role (`WorkerModule`),
67
+ * so other roles get no processor and no BullMQ worker. Their worker options come from the
68
+ * startup config (concurrency per queue, the run queues' job lock and stalled detection, which
69
+ * the usage, title and suggestion workers follow). The workers never start by themselves: the
70
+ * worker role (`WorkerRole`) starts them after the extensions loaded, and pauses them on stop.
63
71
  */
64
72
  export declare class RuntimeWorkersModule {
65
73
  static forRoot(config: KernelConfig): DynamicModule;
@@ -11,6 +11,7 @@ var RuntimeWorkersModule_1;
11
11
  import { hostname } from "node:os";
12
12
  import { OnWorkerEvent, WorkerHost } from "@nestjs/bullmq";
13
13
  import { Inject, Injectable, Module } from "@nestjs/common";
14
+ import { PROMPT_SUGGESTION_CONCURRENCY, PROMPT_SUGGESTION_QUEUE, PromptSuggestionQueue, PromptSuggestionsModule, } from "../conversations/prompt-suggestions.js";
14
15
  import { TITLE_QUEUE, TitleQueue, TitlesModule } from "../conversations/titles.js";
15
16
  import { configuredProcessor } from "../infra/queue/configured-processor.js";
16
17
  import { runJob } from "../infra/queue/run-job.js";
@@ -136,13 +137,35 @@ TitleProcessor = __decorate([
136
137
  __param(0, Inject(TitleQueue))
137
138
  ], TitleProcessor);
138
139
  export { TitleProcessor };
140
+ /** The consumer of `cap-kernel-suggestions`: {@link PromptSuggestionQueue}. */
141
+ let PromptSuggestionProcessor = class PromptSuggestionProcessor extends WorkerHost {
142
+ suggestions;
143
+ constructor(suggestions) {
144
+ super();
145
+ this.suggestions = suggestions;
146
+ }
147
+ process(job) {
148
+ return runJob(PROMPT_SUGGESTION_QUEUE, job, () => this.suggestions.process(job));
149
+ }
150
+ error(err) {
151
+ this.suggestions.onError(err);
152
+ }
153
+ };
154
+ __decorate([
155
+ OnWorkerEvent("error")
156
+ ], PromptSuggestionProcessor.prototype, "error", null);
157
+ PromptSuggestionProcessor = __decorate([
158
+ Injectable(),
159
+ __param(0, Inject(PromptSuggestionQueue))
160
+ ], PromptSuggestionProcessor);
161
+ export { PromptSuggestionProcessor };
139
162
  /**
140
- * The runtime's queue consumers: the run worker on both run queues, `usage.report` deliveries and
141
- * conversation titles. Imported only by the worker role (`WorkerModule`), so other roles get no
142
- * processor and no BullMQ worker. Their worker options come from the startup config (concurrency
143
- * per queue, the run queues' job lock and stalled detection, which the usage and title workers
144
- * follow). The workers never start by themselves: the worker role (`WorkerRole`) starts them after
145
- * the extensions loaded, and pauses them on stop.
163
+ * The runtime's queue consumers: the run worker on both run queues, `usage.report` deliveries,
164
+ * conversation titles and prompt suggestions. Imported only by the worker role (`WorkerModule`),
165
+ * so other roles get no processor and no BullMQ worker. Their worker options come from the
166
+ * startup config (concurrency per queue, the run queues' job lock and stalled detection, which
167
+ * the usage, title and suggestion workers follow). The workers never start by themselves: the
168
+ * worker role (`WorkerRole`) starts them after the extensions loaded, and pauses them on stop.
146
169
  */
147
170
  let RuntimeWorkersModule = RuntimeWorkersModule_1 = class RuntimeWorkersModule {
148
171
  static forRoot(config) {
@@ -157,7 +180,7 @@ let RuntimeWorkersModule = RuntimeWorkersModule_1 = class RuntimeWorkersModule {
157
180
  };
158
181
  return {
159
182
  module: RuntimeWorkersModule_1,
160
- imports: [RuntimeModule, TitlesModule, UsageReportModule],
183
+ imports: [RuntimeModule, TitlesModule, PromptSuggestionsModule, UsageReportModule],
161
184
  providers: [
162
185
  configuredProcessor(RunsProcessor, RUN_QUEUE_NAME, runs),
163
186
  configuredProcessor(SubagentRunsProcessor, SUBAGENT_RUN_QUEUE_NAME, runs),
@@ -173,8 +196,20 @@ let RuntimeWorkersModule = RuntimeWorkersModule_1 = class RuntimeWorkersModule {
173
196
  stalledInterval: stalledIntervalMs,
174
197
  maxStalledCount: 1,
175
198
  }),
199
+ configuredProcessor(PromptSuggestionProcessor, PROMPT_SUGGESTION_QUEUE, {
200
+ concurrency: PROMPT_SUGGESTION_CONCURRENCY,
201
+ lockDuration: jobLockMs,
202
+ stalledInterval: stalledIntervalMs,
203
+ maxStalledCount: 1,
204
+ }),
205
+ ],
206
+ exports: [
207
+ RunsProcessor,
208
+ SubagentRunsProcessor,
209
+ UsageReportProcessor,
210
+ TitleProcessor,
211
+ PromptSuggestionProcessor,
176
212
  ],
177
- exports: [RunsProcessor, SubagentRunsProcessor, UsageReportProcessor, TitleProcessor],
178
213
  };
179
214
  }
180
215
  };
@@ -1,6 +1,7 @@
1
1
  import type { ExtensionContext, Logger } from "@capybara-hq/plugin-sdk";
2
2
  import { type Job, type Worker } from "bullmq";
3
3
  import { EventLog } from "../conversations/event-log.js";
4
+ import { PromptSuggestionQueue } from "../conversations/prompt-suggestions.js";
4
5
  import { TitleQueue } from "../conversations/titles.js";
5
6
  import { SettingsService } from "../identity/settings.js";
6
7
  import { KernelConfigService } from "../infra/config/kernel-config.service.js";
@@ -71,6 +72,8 @@ export declare class RunWorker {
71
72
  private readonly events;
72
73
  /** A completed run enqueues the conversation's title job. */
73
74
  private readonly titles;
75
+ /** A completed or max_steps run enqueues its prompt suggestion job (a hint, never throws). */
76
+ private readonly suggestions;
74
77
  /** Resolves a switched-to model at run start (fallback when it is gone; UI refresh B). */
75
78
  private readonly models;
76
79
  /** Run start's skills catalog snapshot. */
@@ -107,6 +110,8 @@ export declare class RunWorker {
107
110
  events: KernelEvents,
108
111
  /** A completed run enqueues the conversation's title job. */
109
112
  titles: Pick<TitleQueue, "maybeEnqueue">,
113
+ /** A completed or max_steps run enqueues its prompt suggestion job (a hint, never throws). */
114
+ suggestions: Pick<PromptSuggestionQueue, "maybeEnqueue">,
110
115
  /** Resolves a switched-to model at run start (fallback when it is gone; UI refresh B). */
111
116
  models: Pick<ProviderRegistry, "resolve">,
112
117
  /** Run start's skills catalog snapshot. */
@@ -13,6 +13,7 @@ import { sql } from "kysely";
13
13
  import { normalizeStoredDefinition } from "../agents/definition.js";
14
14
  import { EventLog } from "../conversations/event-log.js";
15
15
  import { isAbsorbable, } from "../conversations/events.js";
16
+ import { PromptSuggestionQueue } from "../conversations/prompt-suggestions.js";
16
17
  import { effectiveDefinition, NO_SELECTION, readSelection, sameModel, sameSelection, } from "../conversations/selection.js";
17
18
  import { TitleQueue } from "../conversations/titles.js";
18
19
  import { ApiError } from "../errors.js";
@@ -101,6 +102,7 @@ let RunWorker = class RunWorker {
101
102
  waits;
102
103
  events;
103
104
  titles;
105
+ suggestions;
104
106
  models;
105
107
  skillsCatalog;
106
108
  runContext;
@@ -130,6 +132,8 @@ let RunWorker = class RunWorker {
130
132
  events,
131
133
  /** A completed run enqueues the conversation's title job. */
132
134
  titles,
135
+ /** A completed or max_steps run enqueues its prompt suggestion job (a hint, never throws). */
136
+ suggestions,
133
137
  /** Resolves a switched-to model at run start (fallback when it is gone; UI refresh B). */
134
138
  models,
135
139
  /** Run start's skills catalog snapshot. */
@@ -159,6 +163,7 @@ let RunWorker = class RunWorker {
159
163
  this.waits = waits;
160
164
  this.events = events;
161
165
  this.titles = titles;
166
+ this.suggestions = suggestions;
162
167
  this.models = models;
163
168
  this.skillsCatalog = skillsCatalog;
164
169
  this.runContext = runContext;
@@ -913,7 +918,7 @@ let RunWorker = class RunWorker {
913
918
  // (如续跑时已超过 started_at + maxRunSeconds),这些消息没有被回复,留给结束后的 ensureRun 起新一轮。
914
919
  const consumed = Math.max(outcome.consumedUpToSeq, startConsumed);
915
920
  await this.finish(conversationId, runId, "completed", consumed, { type: "run_finished", payload: { reason: outcome.kind, consumedUpToSeq: consumed } }, true, false);
916
- this.completed(conversationId);
921
+ this.completed(conversationId, runId, outcome.kind);
917
922
  break;
918
923
  }
919
924
  default: {
@@ -924,7 +929,7 @@ let RunWorker = class RunWorker {
924
929
  type: "run_finished",
925
930
  payload: { reason: outcome.kind, consumedUpToSeq: consumed },
926
931
  });
927
- this.completed(conversationId);
932
+ this.completed(conversationId, runId, outcome.kind);
928
933
  }
929
934
  }
930
935
  return "finished";
@@ -1040,9 +1045,11 @@ let RunWorker = class RunWorker {
1040
1045
  });
1041
1046
  return "finished";
1042
1047
  }
1043
- completed(conversationId) {
1044
- // a completed run enqueues the conversation's title job (never throws)
1048
+ completed(conversationId, runId, kind) {
1049
+ // a completed run enqueues the conversation's title job and, for completed / max_steps, its
1050
+ // prompt suggestion job; both are hints after the commit and never throw
1045
1051
  void this.titles.maybeEnqueue(conversationId);
1052
+ void this.suggestions.maybeEnqueue(conversationId, runId, kind);
1046
1053
  }
1047
1054
  /**
1048
1055
  * The run's extension tool keys by plugin, resolved as a chat run's first step lists them
@@ -1262,17 +1269,18 @@ RunWorker = __decorate([
1262
1269
  __param(14, Inject(Waits)),
1263
1270
  __param(15, Inject(KernelEvents)),
1264
1271
  __param(16, Inject(TitleQueue)),
1265
- __param(17, Inject(ProviderRegistry)),
1266
- __param(18, Inject(SkillsCatalogService)),
1267
- __param(19, Inject(RunContextService)),
1268
- __param(20, Inject(PluginContextService)),
1269
- __param(21, Inject(ProjectKnowledgeService)),
1270
- __param(22, Inject(ToolRegistry)),
1271
- __param(23, Inject(RunExecution)),
1272
- __param(24, Inject(RunFinish)),
1273
- __param(25, Inject(TransactionHost)),
1274
- __param(26, Inject(RunDrafts)),
1275
- __param(27, Optional()),
1276
- __param(27, Inject(RUN_HOOKS))
1272
+ __param(17, Inject(PromptSuggestionQueue)),
1273
+ __param(18, Inject(ProviderRegistry)),
1274
+ __param(19, Inject(SkillsCatalogService)),
1275
+ __param(20, Inject(RunContextService)),
1276
+ __param(21, Inject(PluginContextService)),
1277
+ __param(22, Inject(ProjectKnowledgeService)),
1278
+ __param(23, Inject(ToolRegistry)),
1279
+ __param(24, Inject(RunExecution)),
1280
+ __param(25, Inject(RunFinish)),
1281
+ __param(26, Inject(TransactionHost)),
1282
+ __param(27, Inject(RunDrafts)),
1283
+ __param(28, Optional()),
1284
+ __param(28, Inject(RUN_HOOKS))
1277
1285
  ], RunWorker);
1278
1286
  export { RunWorker };
@@ -2,7 +2,7 @@
2
2
  * The run runtime: the conversation run lock, this process's event streams, the run queue and its
3
3
  * worker (consumed through `RuntimeWorkersModule`'s processors), the waits (a run nobody runs is
4
4
  * the worker role's `RunOrphanCheck`'s to repair), run stops, the checkpoints, the org quotas, the step writes and the agent loops. The model provider
5
- * registry, the sub-agent dispatch, `usage.report` and the titles have modules of their own (the
5
+ * registry, the sub-agent dispatch, `usage.report`, the titles and the prompt suggestions have modules of their own (the
6
6
  * tools, models and conversations domains import them without the runtime).
7
7
  */
8
8
  export declare class RuntimeModule {
@@ -11,6 +11,7 @@ import { ConversationAccessModule } from "../conversations/access.js";
11
11
  import { AttachmentsModule } from "../conversations/attachments.module.js";
12
12
  import { EventLogModule } from "../conversations/event-log.js";
13
13
  import { PermissionProfileStoreModule } from "../conversations/permission-profile-store.module.js";
14
+ import { PromptSuggestionsModule } from "../conversations/prompt-suggestions.js";
14
15
  import { TitlesModule } from "../conversations/titles.js";
15
16
  import { DevicesModule } from "../devices/devices.module.js";
16
17
  import { ExtensionsModule } from "../extensions/extensions.module.js";
@@ -19,6 +20,7 @@ import { IdentityModule } from "../identity/identity.module.js";
19
20
  import { LockService } from "../infra/lock/lock.service.js";
20
21
  import { QueueModule } from "../infra/queue/queue.module.js";
21
22
  import { REDIS } from "../infra/tokens.js";
23
+ import { OrgSettingsModule } from "../orgs/settings.service.js";
22
24
  import { OperationAuthorityModule } from "../sandbox/operation-authority.module.js";
23
25
  import { PermissionAuthorityModule } from "../sandbox/permission-authority.module.js";
24
26
  import { SandboxModule } from "../sandbox/sandbox.module.js";
@@ -56,7 +58,7 @@ import { Waits } from "./waits.js";
56
58
  * The run runtime: the conversation run lock, this process's event streams, the run queue and its
57
59
  * worker (consumed through `RuntimeWorkersModule`'s processors), the waits (a run nobody runs is
58
60
  * the worker role's `RunOrphanCheck`'s to repair), run stops, the checkpoints, the org quotas, the step writes and the agent loops. The model provider
59
- * registry, the sub-agent dispatch, `usage.report` and the titles have modules of their own (the
61
+ * registry, the sub-agent dispatch, `usage.report`, the titles and the prompt suggestions have modules of their own (the
60
62
  * tools, models and conversations domains import them without the runtime).
61
63
  */
62
64
  let RuntimeModule = class RuntimeModule {
@@ -85,6 +87,9 @@ RuntimeModule = __decorate([
85
87
  SubagentsModule,
86
88
  UsageReportModule,
87
89
  TitlesModule,
90
+ PromptSuggestionsModule,
91
+ // the stream reads the org's prompt suggestion switch
92
+ OrgSettingsModule,
88
93
  StepLogModule,
89
94
  BackgroundModule,
90
95
  // a scheduled task's run follows its kernel run's end (`RunFinish`)
@@ -157,6 +162,7 @@ RuntimeModule = __decorate([
157
162
  SubagentsModule,
158
163
  UsageReportModule,
159
164
  TitlesModule,
165
+ PromptSuggestionsModule,
160
166
  ],
161
167
  })
162
168
  ], RuntimeModule);