vibe64 0.1.65 → 0.1.67

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 (153) hide show
  1. package/bin/run.js +2004 -1363
  2. package/bin/server.js +282 -276
  3. package/bin/upgrade-state.js +4673 -4470
  4. package/dist/assets/{GithubBrowserTabs-D21Nl3QI.js → GithubBrowserTabs-CW3GBeJu.js} +1 -1
  5. package/dist/assets/{LocalDatabaseServer-POxY1K1U.js → LocalDatabaseServer-DYh3UF9q.js} +1 -1
  6. package/dist/assets/{SelectField-Dezd0B3y.js → SelectField-Df50ZFLj.js} +1 -1
  7. package/dist/assets/{ShellOutlet-DfF9vsWA.js → ShellOutlet-DkLdtzJW.js} +1 -1
  8. package/dist/assets/{Vibe64AuthSettingsButton-I3ufyScN.js → Vibe64AuthSettingsButton-Cksj7FS6.js} +1 -1
  9. package/dist/assets/{Vibe64AuthSettingsButton-DFfFPrd7.css → Vibe64AuthSettingsButton-DfKYI6ZS.css} +1 -1
  10. package/dist/assets/{Vibe64ConversationLog-C04oOQ2g.js → Vibe64ConversationLog-BC0eDtUP.js} +1 -1
  11. package/dist/assets/{Vibe64DashboardShell-BbrOUmRD.js → Vibe64DashboardShell-DX5dOXAB.js} +1 -1
  12. package/dist/assets/{Vibe64DatabaseWorkspace-VPEM2o1v.js → Vibe64DatabaseWorkspace-8i-RDc9y.js} +1 -1
  13. package/dist/assets/{Vibe64FileArea-C_nC2bPk.js → Vibe64FileArea-EK5yUio3.js} +1 -1
  14. package/dist/assets/{Vibe64OutputControls-DTO3Fw3x.js → Vibe64OutputControls--LB4G83q.js} +1 -1
  15. package/dist/assets/{Vibe64RepositoryWorkspace-B8xcCOvL.js → Vibe64RepositoryWorkspace-D6uJCype.js} +1 -1
  16. package/dist/assets/{Vibe64SessionFiles-Cb9Mxsyq.js → Vibe64SessionFiles-DVHGc7hd.js} +1 -1
  17. package/dist/assets/{Vibe64SessionSourceEditor-CVQ3NRjh.js → Vibe64SessionSourceEditor-Bws5ihr-.js} +1 -1
  18. package/dist/assets/{Vibe64UiStoryboardView-BV4JFgcZ.js → Vibe64UiStoryboardView-BmABkyG4.js} +1 -1
  19. package/dist/assets/{Vibe64UnavailableSessions-DGQAxYE-.js → Vibe64UnavailableSessions-C6Bkwsqk.js} +1 -1
  20. package/dist/assets/{_pageId_-CkG15vv4.js → _pageId_-FjW-3sqF.js} +1 -1
  21. package/dist/assets/{_sessionId_-Bka3RUmK.js → _sessionId_-4cH83Bfi.js} +1 -1
  22. package/dist/assets/_slug_-Cazfy5ui.js +14 -0
  23. package/dist/assets/_slug_-DQDycgFK.css +1 -0
  24. package/dist/assets/{access-Xo3unxGO.js → access-mxcxtn7b.js} +1 -1
  25. package/dist/assets/{app-B0spNegd.js → app-8zP_FAuO.js} +1 -1
  26. package/dist/assets/assistantRouting-Bbxguvre.js +3 -0
  27. package/dist/assets/{changes-DFv4tuoO.js → changes-cmlEyHug.js} +1 -1
  28. package/dist/assets/{client-4uCr4dYG.js → client-BJBzomgt.js} +1 -1
  29. package/dist/assets/{client-CVuXqm4b.js → client-C1i-bIgL.js} +1 -1
  30. package/dist/assets/{client-Dlg1kjjO.js → client-C7yZ1hEm.js} +1 -1
  31. package/dist/assets/{client-CevjVK2b.js → client-CQ49uWhR.js} +1 -1
  32. package/dist/assets/{client-DR0w56e8.js → client-D46Uu-YO.js} +2 -2
  33. package/dist/assets/{client-BjMjS6lX.js → client-DKNTl1to.js} +2 -2
  34. package/dist/assets/{conversation-OkWbkHjm.js → conversation-CFJRkeTj.js} +3 -3
  35. package/dist/assets/{conversation-DReMq0MF.css → conversation-COcuIkcD.css} +1 -1
  36. package/dist/assets/conversation-CexAK3Qk.js +1 -0
  37. package/dist/assets/{dashboard-CAca9MQn.js → dashboard-CMtWKazq.js} +1 -1
  38. package/dist/assets/{english-definitions-BtX8KA5g.js → english-definitions-DiyU9O9D.js} +1 -1
  39. package/dist/assets/{env-DrNyBVkB.js → env-LUc22Wgd.js} +1 -1
  40. package/dist/assets/{error-BqMxhgpB.js → error-BccdQn04.js} +1 -1
  41. package/dist/assets/{error-BQ7r64JO.js → error-DPDAz9Td.js} +1 -1
  42. package/dist/assets/{errorMessageHelpers-B49LyMJi.js → errorMessageHelpers-G32Hjqfm.js} +1 -1
  43. package/dist/assets/{health-B5yTW5Tt.js → health-CfMjMJFf.js} +1 -1
  44. package/dist/assets/{history-S3anp6xg.js → history-hX_kNskf.js} +1 -1
  45. package/dist/assets/{httpClient-Bwitq9Xf.js → httpClient-C71X5grL.js} +1 -1
  46. package/dist/assets/{i18n-BuXRXGaO.js → i18n-5EHeMSvt.js} +1 -1
  47. package/dist/assets/{i18n-DQPYjuW7.js → i18n-BSfPKqM3.js} +1 -1
  48. package/dist/assets/{i18n-Dm74yE_M.js → i18n-Dq-ep9n7.js} +1 -1
  49. package/dist/assets/index-BJWiPV6i.css +1 -0
  50. package/dist/assets/index-FVeEbKiO.js +134 -0
  51. package/dist/assets/{integrations-C7dj7el_.js → integrations-Ccb8EOEO.js} +14 -15
  52. package/dist/assets/{integrations-CwgrZgmM.css → integrations-CtnIjM1Y.css} +1 -1
  53. package/dist/assets/{issues-OkV4v4GX.js → issues-Bxtt7oqi.js} +1 -1
  54. package/dist/assets/{learning-lW9nBGjT.js → learning-BUx9jo91.js} +1 -1
  55. package/dist/assets/{pages-shOT9IVe.js → pages-D43zM2UW.js} +1 -1
  56. package/dist/assets/{project-files-D_K1N0JF.js → project-files-BX3zZCcl.js} +1 -1
  57. package/dist/assets/{publish-Bxe4ZCqe.js → publish-DatierL2.js} +1 -1
  58. package/dist/assets/{pull-requests-CQvk0TeH.js → pull-requests-DNkOjcuy.js} +1 -1
  59. package/dist/assets/{repository-CI2CqDwF.js → repository-0EKOcyTL.js} +1 -1
  60. package/dist/assets/{settings-DIVrFrs4.js → settings-DbR9JIc3.js} +1 -1
  61. package/dist/assets/{studioGateApi-UqmdV50W.js → studioGateApi-B9EUTtMx.js} +1 -1
  62. package/dist/assets/{studioUrls-k_pQIuPs.js → studioUrls-BR4ZL-TN.js} +1 -1
  63. package/dist/assets/{useArchivedVibe64Sessions-BkWrTOzg.js → useArchivedVibe64Sessions-B8VDhA9F.js} +1 -1
  64. package/dist/assets/useAssistantAttachments-C9kAnWqw.js +2 -0
  65. package/dist/assets/useCommand-CfqxMb4C.js +1 -0
  66. package/dist/assets/{useEndpointResource-DZTjr9gg.js → useEndpointResource-BwGXpV2u.js} +1 -1
  67. package/dist/assets/{useUiFeedback-BU4NyMq8.js → useUiFeedback-8Wvg7A_S.js} +1 -1
  68. package/dist/assets/{useVibe64ConversationLog-BADhWyNY.js → useVibe64ConversationLog-7wgLlKG5.js} +2 -2
  69. package/dist/assets/useVibe64Learning-DkneotqS.js +5 -0
  70. package/dist/assets/{useVibe64SessionData-DvFvAJC-.js → useVibe64SessionData-DuJ-dHR8.js} +1 -1
  71. package/dist/assets/{useVibe64SessionSelection-BukDTAxb.js → useVibe64SessionSelection-BwjtqeIR.js} +1 -1
  72. package/dist/assets/{vibe64FileUpload-BDkcaUyk.js → vibe64FileUpload-D_rOa1R8.js} +1 -1
  73. package/dist/assets/{vibe64RepositoryRealtime-DX2DEqIz.js → vibe64RepositoryRealtime-CVGNqwxz.js} +1 -1
  74. package/dist/assets/vibe64SavedEnvValues-CCZew0j7.js +1 -0
  75. package/dist/assets/{vibe64SessionFocus-CzuP3qPT.js → vibe64SessionFocus-B4diopOJ.js} +1 -1
  76. package/dist/index.html +23 -23
  77. package/docs/colleague-usage/ai-accounts.md +7 -7
  78. package/docs/colleague-usage/ai-model-setups.md +1 -1
  79. package/docs/colleague-usage/ai-tasks.md +2 -1
  80. package/docs/colleague-usage/auto-workflow.md +67 -44
  81. package/docs/colleague-usage/chat-settings.md +115 -114
  82. package/docs/colleague-usage/coding-agent-goal-pause.md +34 -12
  83. package/docs/colleague-usage/coding-agent-goals.md +33 -16
  84. package/docs/colleague-usage/coding-agent-history.md +9 -0
  85. package/docs/colleague-usage/coding-agent-questions.md +7 -0
  86. package/docs/colleague-usage/coding-agent-recovery.md +3 -0
  87. package/docs/colleague-usage/coding-agents.md +10 -4
  88. package/docs/colleague-usage/connected-repositories.md +4 -1
  89. package/docs/colleague-usage/developing-vibe64.md +11 -5
  90. package/docs/colleague-usage/development-env.md +74 -32
  91. package/docs/colleague-usage/github-work.md +39 -5
  92. package/docs/colleague-usage/integrations.md +2 -2
  93. package/docs/colleague-usage/main-chat-approvals.md +7 -6
  94. package/docs/colleague-usage/message-delivery-recovery.md +1 -1
  95. package/docs/colleague-usage/passes.md +260 -0
  96. package/docs/colleague-usage/plans.md +27 -16
  97. package/docs/colleague-usage/session-timeline.md +93 -0
  98. package/docs/colleague-usage/temporary-chats.md +6 -0
  99. package/docs/colleague-usage/ui-pass.md +30 -32
  100. package/docs/colleague-usage/workspace-preparation.md +51 -0
  101. package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +12 -0
  102. package/node_modules/@jskit-ai/assistant-core/locales/en.json +2 -0
  103. package/node_modules/@jskit-ai/assistant-core/package.json +1 -1
  104. package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +5 -0
  105. package/node_modules/@jskit-ai/assistant-runtime/package.json +1 -1
  106. package/node_modules/@jskit-ai/assistant-voice/package.json +1 -1
  107. package/node_modules/@jskit-ai/connector-google-calendar/CHANGELOG.md +1 -0
  108. package/node_modules/@jskit-ai/connector-google-calendar/package.json +1 -1
  109. package/node_modules/@jskit-ai/connector-google-calendar/patterns/calendar-cli/example/.env.example +1 -0
  110. package/node_modules/@jskit-ai/connectors-catalog/CHANGELOG.md +1 -0
  111. package/node_modules/@jskit-ai/connectors-catalog/package.json +1 -1
  112. package/node_modules/@jskit-ai/connectors-catalog/patterns/api-key-connection/PATTERN.md +4 -1
  113. package/node_modules/@jskit-ai/connectors-catalog/patterns/oauth-connection/PATTERN.md +3 -1
  114. package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +1 -0
  115. package/node_modules/@jskit-ai/connectors-core/README.md +3 -1
  116. package/node_modules/@jskit-ai/connectors-core/package.json +1 -1
  117. package/node_modules/@jskit-ai/http-runtime/CHANGELOG.md +1 -0
  118. package/node_modules/@jskit-ai/http-runtime/package.json +1 -1
  119. package/node_modules/@jskit-ai/kernel/CHANGELOG.md +6 -0
  120. package/node_modules/@jskit-ai/kernel/package.json +3 -4
  121. package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +1 -0
  122. package/node_modules/@jskit-ai/payments-core/locales/en.json +1 -1
  123. package/node_modules/@jskit-ai/payments-core/package.json +1 -1
  124. package/node_modules/@jskit-ai/realtime/CHANGELOG.md +1 -0
  125. package/node_modules/@jskit-ai/realtime/package.json +1 -1
  126. package/node_modules/@jskit-ai/realtime/patterns/realtime-application/example/.env.example +1 -0
  127. package/node_modules/@jskit-ai/resource-core/package.json +1 -1
  128. package/node_modules/@jskit-ai/uploads-runtime/package.json +1 -1
  129. package/node_modules/@local/vibe64-core/package.json +2 -0
  130. package/node_modules/@local/vibe64-execution/package.json +1 -0
  131. package/node_modules/@local/vibe64-execution/src/host/execHelper.js +715 -666
  132. package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +989 -847
  133. package/node_modules/@local/vibe64-genesis/src/server/agentSpecs.js +129 -107
  134. package/node_modules/@local/vibe64-genesis/src/server/index.js +632 -614
  135. package/node_modules/@local/vibe64-genesis/src/server/packaging.js +27 -28
  136. package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +172 -162
  137. package/node_modules/@local/vibe64-runtime/package.json +1 -0
  138. package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +1042 -898
  139. package/node_modules/@local/vibe64-terminals/package.json +2 -1
  140. package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +560 -420
  141. package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +586 -581
  142. package/package.json +15 -15
  143. package/server.bundle.mjs +44592 -44103
  144. package/dist/assets/_slug_-7Oo7pGKn.js +0 -14
  145. package/dist/assets/_slug_-BaxjtsgP.css +0 -1
  146. package/dist/assets/assistantRouting-B9cub38g.js +0 -3
  147. package/dist/assets/conversation-D7T_us2O.js +0 -1
  148. package/dist/assets/index-DSyb-mRJ.css +0 -1
  149. package/dist/assets/index-JBqyg0mr.js +0 -134
  150. package/dist/assets/useAssistantAttachments-DqlNFiha.js +0 -2
  151. package/dist/assets/useCommand-D-MIMmhp.js +0 -1
  152. package/dist/assets/useVibe64Learning-CbsI-XHB.js +0 -5
  153. package/dist/assets/vibe64SavedEnvValues-CgfMvj_h.js +0 -1
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - An application decides each new turn of the database-backed assistant by providing the optional `assistant.turnGuard` capability, `{ admit({ targetSurfaceId, context, input, conversationId, messageId }) }`, which the chat service asks once per new turn, after the replay check and before the AI connection is resolved, the turn is claimed or anything is saved or sent. `{ allowed: true }` runs the turn as before. `{ reply }` answers it with that text instead of the model: the message and the reply are saved as one completed turn and streamed like any answer, and no AI connection is resolved and the model is never called. An `AppError` it throws refuses the turn with its status, code and details (for example 429, `weekly_limit`, `{ resetsOn }`), and nothing is saved. Any other value fails the turn with a 500 and an error log naming the value. A replayed message ID never calls `admit`; two simultaneous first sends of one message ID can both call it, so a guard that counts counts each `messageId` once. Without the capability nothing changes. A fixed reply saves the message's text, not its files. `createAssistantRuntime` takes `turnGuard` (`AssistantFeature` passes `NO_TURN_GUARD` without the capability), and `createChatService` takes `conversationStorage` and `turnAdmission`. `test/turnGuard.test.js` proves each decision through the chat route on SQLite.
6
+ - A completed turn's `done` event names its two saved messages, `storedMessageIds: { user, assistant }`, and the replay of a completed turn repeats them. `useAssistantRuntime`'s messages carry `storedId`, the saved row's ID: a restored message has it at once, a message sent in the view gets it from the `done` event, and an unsaved one (a failed or stopped reply) has `null`.
7
+ - `AssistantSurfaceClientElement` forwards an application's `message-actions` slot, with `{ message }` (its `id`, `storedId` and `role`), under each assistant reply after the reply's failed or stopped notice, for controls such as a Report button. `conversation.browser.test.js` renders one beside the failed and stopped notices and checks each reply's role and stored ID, live and restored.
8
+ - A database surface's assistant offers the app's unsaved actions (`extensions.assistant.unsaved: true`) to its API conversations and lists them in its system prompt among the tools on offer. Their calls and results are never written to the conversation's message rows, its turn requests, the stream or the action log, and the conversation's export and later turns hold neither.
9
+ - A conversation's question form (`questions`) stays when the AI follows its questions with a short message in the same turn, such as "I'll build it once you've answered those three.": the retained conversation reads the form's questions with `@jskit-ai/assistant-core`'s new `latestAssistantQuestionsAwaitingUserReply`, the newest questions among the AI's last ten messages since the person's latest message, instead of only the AI's last reply. Nothing is offered while the reply is in progress, and dismissing or answering works as before.
5
10
  - `assistantServer.<surface>.maxToolArgumentBytes` (a whole number of bytes, at most 1 MiB) raises a surface's limit on an application tool call's arguments from the default 32 KiB, for an assistant that writes a large document in one call. The surface's own limit is the one its conversations' calls are held to and the one every engine is given (the OpenCode tool connection included); before, the runtime enforced and handed engines the default surface's 32 KiB whatever a surface's catalogue allowed. `assistantServer.<surface>.maxToolResultBytes` (also at most 1 MiB) raises its limit on a tool call's result from the default 48 KiB in the same way, for an assistant that reads a large document back: a larger result reaches the model as `assistant_tool_result_too_large` instead. A malformed value of either stops the server from starting. **Breaking.** The surface-aware tool catalogue no longer has a `limits` property, which always answered the default surface's: each tool set it resolves carries its surface's `limits`. New migration `assistant_transcripts_tool_arguments`: on MySQL and MariaDB, `assistant_messages.content_text` becomes LONGTEXT, so a saved call's arguments and result may pass TEXT's 64 KiB; PostgreSQL and SQLite are unchanged.
6
11
  - A Set or Resume goal that the server refuses after its message already appeared in the conversation shows the server's reason (for example that Claude's goal attachment is not available yet) instead of only `jskit.assistant.runtime.goal.changeFailed` ("Could not change the goal."): the transcript turn settled the optimistic message first, so the failure's own text was dropped with it.
7
12
  - The saved-conversations list (`GET /api/assistant/:surfaceId/conversations`, and its workspace form) answers 200 again instead of 500 ("metadata is required!") once a person has a conversation: the route still serialized each item with the conversation's read schema, which requires `metadata`, after list items stopped carrying it. It serializes them with assistant-core's `assistantConversationListItemOutputValidator`, the item of `assistantContract`'s `conversationsList`. `conversationsListRoute.test.js` lists a saved conversation over HTTP through the real route, actions and SQL repositories.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-runtime",
3
- "version": "0.2.54",
3
+ "version": "0.2.76",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-voice",
3
- "version": "0.2.54",
3
+ "version": "0.2.76",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - The calendar CLI pattern passes `appEnv: appEnvironment(process.env)` and its `.env.example` declares `APP_ENV=development`; writing an event is logged outside production (`APP_ENV`).
5
6
  - Creating, changing and cancelling an event are marked `sideEffect`, since they can invite or notify people: a test copy (`SIDE_EFFECTS` is not `live`) logs them instead of sending them.
6
7
 
7
8
  ## 0.2.0 - 2026-10-29
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/connector-google-calendar",
3
- "version": "0.2.30",
3
+ "version": "0.2.43",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared": "./src/shared/english-definition.js",
@@ -1,3 +1,4 @@
1
+ APP_ENV=development
1
2
  DATABASE_URL=
2
3
  GOOGLE_CLIENT_SECRET=
3
4
  GOOGLE_CALLBACK_URL=http://127.0.0.1:8080/integrations/google/callback
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - The patterns and docs give `createConnectionService` `appEnv: appEnvironment(env)` in place of `sideEffects`; a marked operation is logged outside production (`APP_ENV`).
5
6
  - Operations that act on the world are marked `sideEffect`, so a test copy (`SIDE_EFFECTS` is not `live`) simulates them: Brevo email, SMS, campaign sends and events; Calendly cancellations and invitees; Chargebee subscription changes; Firebase Cloud Messaging; GatewayAPI; Gmail sends; Google Ads campaign status; incident.io incidents; Inngest events; LinkedIn posts; Mailgun; Outlook mail and events; Teams messages; Resend emails and broadcasts; Slack messages; Telegram; Twilio messages and calls; Twitch chat; Wave invoice and estimate sends; Wix Bookings changes; WooCommerce refunds. The api-key and Firebase messaging patterns pass `sideEffects: resolveSideEffectsMode(env)`.
6
7
  - The browser catalog (`./shared`) no longer bundles the whole AI model snapshot. The AI connector definition now reads only the 13 configurable providers (0.2 MB, in `ai-models.json`). The other 200 providers, which are framework metadata (2.0 MB), moved to `ai-framework-models.json`, which only `./shared/ai` and `./server/ai` load. Exports, the catalogue and every configurable model's choices, hints and credential scopes are unchanged. The definition no longer recognises a framework provider's model key, which its settings schema already rejected.
7
8
  - The Resend guide shows local auth's `auth.local.confirmation-sender` next to its recovery sender.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/connectors-catalog",
3
- "version": "0.2.30",
3
+ "version": "0.2.45",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared/ai": "./src/shared/english-ai.js",
@@ -161,6 +161,7 @@ A server module or manually written CLI composes the same library calls:
161
161
  import { readFile } from "node:fs/promises";
162
162
  import { parseIntegrationConfiguration } from "@jskit-ai/connectors-core/shared/configuration";
163
163
  import { createConnectionService, createEnvironmentReferenceResolver } from "@jskit-ai/connectors-core/server";
164
+ import { appEnvironment } from "@jskit-ai/kernel/shared/support/appEnvironment";
164
165
  import { createFileConnectionStore, createCredentialProtection } from "@jskit-ai/connectors-core/server/file-storage";
165
166
  import { resendProvider } from "@jskit-ai/connectors-catalog/server/resend";
166
167
  import { firecrawlProvider } from "@jskit-ai/connectors-catalog/server/firecrawl";
@@ -175,7 +176,9 @@ const store = createFileConnectionStore({ directory: process.env.CONNECTOR_STATE
175
176
  const connections = createConnectionService({
176
177
  configuration, providers, store,
177
178
  resolveReference: createEnvironmentReferenceResolver(process.env),
178
- authorize: applicationConnectionPolicy
179
+ authorize: applicationConnectionPolicy,
180
+ // Only production (APP_ENV) sends side-effect operations, such as an email; elsewhere they are logged.
181
+ appEnv: appEnvironment(process.env)
179
182
  });
180
183
 
181
184
  // context comes from the existing application's authentication or local operator policy.
@@ -58,6 +58,7 @@ package APIs in an application module:
58
58
  import { readFile } from "node:fs/promises";
59
59
  import { parseIntegrationConfiguration } from "@jskit-ai/connectors-core/shared/configuration";
60
60
  import { createConnectionService, createEnvironmentReferenceResolver } from "@jskit-ai/connectors-core/server";
61
+ import { appEnvironment } from "@jskit-ai/kernel/shared/support/appEnvironment";
61
62
  import { createFileConnectionStore, createCredentialProtection } from "@jskit-ai/connectors-core/server/file-storage";
62
63
  import { wordpressComProvider } from "@jskit-ai/connectors-catalog/server/wordpress-com";
63
64
 
@@ -69,7 +70,8 @@ const protection = createCredentialProtection({
69
70
  const connections = createConnectionService({
70
71
  configuration, providers,
71
72
  store: createFileConnectionStore({ directory: process.env.CONNECTOR_STATE_DIRECTORY, protection }),
72
- resolveReference: createEnvironmentReferenceResolver(process.env), authorize: applicationConnectionPolicy
73
+ resolveReference: createEnvironmentReferenceResolver(process.env), authorize: applicationConnectionPolicy,
74
+ appEnv: appEnvironment(process.env)
73
75
  });
74
76
  ```
75
77
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - **Breaking:** `createConnectionService` takes `appEnv` (the application's `APP_ENV`, `appEnvironment(env)`) in place of `sideEffects`, and requires it: anything but the four environments throws `Supply appEnv, the application's APP_ENV: appEnvironment(env).` Only production sends an operation marked `sideEffect`; elsewhere it is checked, logged (`Staging: the resend emails.send request was logged, not sent: only production acts for real.`) and answered `{ simulated: true }`. `createConnectorsFeature` reads `APP_ENV` from `runtime.env` itself.
5
6
  - An operation marked `sideEffect: true` (one that sends a message, posts, books, charges or triggers another system) runs only when the application's `SIDE_EFFECTS` is `live`. Otherwise it is checked exactly as a real one, logged with `logSimulatedSideEffect`, and `invoke` answers `{ simulated: true }` without reaching the provider or touching the connection's `verifiedAt`. `createConnectionService` takes `sideEffects` (default `simulate`) and an optional `logger`; `createConnectorsFeature` reads the setting from `runtime.env` and logs through `runtime.logger`, which it now requires, and its options cannot override it.
6
7
  - A connection's status reads its row without a transaction or lock, and no longer creates an empty row for every person and integration whose status is viewed. `status()` calls `withConnection(slot, work, { readOnly: true })`; the SQL store reads the row with a plain get for such work, and the file store and a custom store that ignores the option still answer correctly.
7
8
  - connector_authorization_attempts declares its foreign key, connection_key to connector_connections.connection_key (`foreignKeys`), so json-rest-api 3.1.0 can skip the visibility query a system-context read makes for a record such a key guarantees exists. `jskit test --databases` checks each against an app's test database. `knexConnectionStore.test.js` proves it matches the migration on the connector test database.
@@ -116,7 +116,9 @@ const connections = createConnectionService({
116
116
  providers: [googleCalendarProvider],
117
117
  store,
118
118
  resolveReference: createEnvironmentReferenceResolver(process.env),
119
- authorize: applicationConnectionPolicy
119
+ authorize: applicationConnectionPolicy,
120
+ // The application's APP_ENV, appEnvironment(process.env): only production sends side-effect operations.
121
+ appEnv: appEnvironment(process.env)
120
122
  });
121
123
  ```
122
124
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/connectors-core",
3
- "version": "0.2.30",
3
+ "version": "0.2.43",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared/configuration": "./src/shared/configuration.js",
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - `request(url, { response: "file" })` answers a download as `{ blob, fileName, contentType }`: the body as a Blob, the name its `Content-Disposition` gives (the RFC 5987 `filename*` before the plain `filename`, as RFC 6266 asks; null when it names none) and its content type. A refusal is read and thrown as for any request, so a step-up or validation refusal reaches the caller's usual handling. Any other `response` value, and `response: "file"` on `requestStream()`, is refused. Before, the client read a body that was not JSON as `{}`, so a page could not download a file through it and keep its credentials, CSRF token and refusal handling.
5
6
  - The JSON:API route transport's error document takes the transaction outcome the kernel's error handler passes it (`transactionOutcome`, the wrapper's when the handler answers a refusal a json-rest-api write wrapped), and otherwise the error's own, so a CRUD route's refusal keeps `meta.transactionOutcome`.
6
7
  - `simplifyJsonApiResult(result, { lookupFieldMap })` and `simplifyJsonApiDocument(document, { lookupFieldMap })` take the field key of a to-one relationship whose key is not its name plus `Id` (`{ owner: "ownerUserId" }`), so a decorated CRUD service reads the record it wrote from its own answer, with its real field keys, instead of reading it again.
7
8
  - `createTransientRetryHttpClient` marks a `GET`/`HEAD` transient failure whose retries it spent (kernel `markTransientRetriesSpent`), so the app QueryClient's `shouldRetryTransientQueryFailure` does not retry the whole retried call again: one unreachable read is 3 requests and 3 s to the recovery banner instead of 9 requests and 11 s. Which requests it retries, how often and when are unchanged.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/http-runtime",
3
- "version": "0.2.21",
3
+ "version": "0.2.27",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - **Breaking: `APP_ENV` says where an application runs, replacing `SIDE_EFFECTS` and every decision `NODE_ENV` made.** It is exactly `development`, `test`, `staging` or `production`; `NODE_ENV` now only picks optimised builds. `@jskit-ai/kernel/shared/support/appEnvironment` gives `appEnvironment(env)` (the value; a missing or unknown one throws, naming the fix), `isDeployed(env)` (staging or production), `pageAppEnvironment()`, `withAppEnvironmentMeta(html, appEnv)` and `APP_ENVIRONMENTS`. `@jskit-ai/kernel/server/runtime/appEnvironment` gives `deliverMessage({ env, logger, channel, to, summary, details, send })`, which sends an email or SMS in production, sends it only to `STAGING_EMAIL_TO` or `STAGING_SMS_TO` in staging (calling `send(stagingAddress, { originalTo })`), and logs it in development, test and staging without that address; `markStagingEmail(message, originalTo)`, which adds the `X-Staging-Original-To` header and a first line `Staging: this email was for <address>.` to its text and HTML; `logSideEffect(logger, appEnv, { kind, summary, details, reason })` for any other effect logged outside production; `assertDevelopmentOnlySettings(env, names)`; and `assertAppEnvironment(env)`. `createInstalledRuntime` refuses to start when `APP_ENV` is missing or unknown, when `SIDE_EFFECTS` is set at all (`SIDE_EFFECTS was replaced by APP_ENV: remove SIDE_EFFECTS. …`), and when `APP_ENV` is staging or production without `NODE_ENV=production`; it logs once where it runs and what that means, and names the environment in every HTML page it sends (the `jskit-app-environment` meta tag, replacing `jskit-side-effects`). The security headers' HSTS and content security policy follow `APP_ENV` (staging and production), not `NODE_ENV`. The Vite plugin names `APP_ENV` in the development server's pages and refuses without one; a built page names none. Removed: `@jskit-ai/kernel/shared/support/sideEffects`, `@jskit-ai/kernel/server/runtime/sideEffects` and `@jskit-ai/kernel/server/runtime/runtimeMode` (`isProductionEnv`).
6
+ - `resolveApiErrorStatus(error)` from `@jskit-ai/kernel/server/runtime/errors` gives the HTTP status an error answers a client with: json-rest-api's refusals, which carry no status, by their code (`REST_API_VALIDATION` a 422, a `REST_API_RESOURCE` by its subtype: 404, 403, 409 or 400), any other error by its own status when that is 400 to 599, else 500. It is the HTTP error handler's own mapping, moved there so that anything else telling a client of a refusal, such as the assistant's tool results, answers with the same status; the HTTP error handler's answers are unchanged.
7
+ - `withoutExecutionLog(context)` from `@jskit-ai/kernel/server/actions` returns the same execution context marked so the action pipeline writes no `action.execution` log line for it, for a caller that keeps every trace of a call out of what it saves (an assistant's unsaved tool). `isExecutionLogged(context)` reads the mark, so an action or action policy can keep its own logs quiet too. The mark is a private symbol: it passes through `normalizeExecutionContext` and never reaches a serialized context.
8
+ - A feature or provider may declare **late requirements**, `late: { evidence: "evidence.files" }`, local names to capability ids as `requires` and `optional` are, for a ring that only a read at call time closes, such as a row policy that narrows through an owner which itself requires the policy's feature. A late requirement takes no part in the order providers start in nor in the cycle check, so the ring starts instead of failing with `Provider capability cycle detected`; `createCapabilityRuntime().start()` resolves it once, after every provider's `boot()`. Until then its local name is a getter that throws `Provider "audit" read its late requirement "evidence" (capability "evidence.files") before every provider booted: a late requirement can only be read at call time after boot, such as inside a row policy or a request handler, never in setup or boot, and never destructured in setup.`; after, it answers the capability. A capability nothing provides fails start() at the end of boot with `Provider "audit" late-requires missing capability "evidence.files": no provider or runtime input provides it.` (and the provider's hint for it, if any), and start() stops what started as for any startup failure. The value reaches everything a feature's dependencies reach: setup's dependencies, actions(), boot() and shutdown(), and each owned table's row policy as `requires`; defineFeature now copies dependencies by property descriptors, so a copy keeps the getter instead of reading it. Late local names must differ from the provider's requires, optional and provides names; a provider cannot late-require a capability it provides, or one it already requires or takes as optional; and defineFeature refuses the reserved local names and `runtime.resources` under `late` as under `requires`. A package's manifest drift counts late requirements as requirements, so its manifest lists them under `requires`.
9
+ - **Behaviour change: a route handler's returned value is now sent as the response; previously it was dropped and the answer was an empty 200.** This applies to every route registered through the kernel's router whose handler returns something other than `undefined` without replying. That includes every `actionRoute` of `createActionRouteScope` registered without an application's own `wrapHandler`: it returns its action's result, so until now it answered 200 with an empty body. The router sends the returned value unless the handler started a send itself, which only the router can tell, since a send can still be finishing after it returns (see the `FST_ERR_SEND_INSIDE_ONERR` entry below). A handler that sends its reply (`reply.send(...)`, `return reply.send(...)`, `return reply`, or a hijacked reply) keeps that reply, whatever it returns, and one that returns nothing without replying still answers an empty 200. **What an application should check:** every route handler that returns a value without replying, since that value now reaches the browser. Make sure each one returns only what the browser should see, never an internal object such as a service's result, a database row or a record with internal fields, and that a handler writing to `reply.raw` (a stream or server-sent events) hijacks the reply or returns nothing. A route with a response schema serializes the value through it, which writes only the properties the schema declares unless it allows others; a route without one sends the whole value as JSON. An application whose `wrapHandler` already sent the result keeps working unchanged, and can drop that send.
10
+ - A route may ask for a second factor: `secondFactor: true` for one done at any time in the request's session, or `secondFactor: { maxAgeSeconds }` for one done within that many seconds, for a dangerous action. The router checks it when the route is defined (anything else, or a route whose `auth` is not "required" or "own", stops startup with a `RouteDefinitionError` naming the route) and passes it to the route's policy config, where `@jskit-ai/auth-core`'s auth policy enforces it.
5
11
  - A route with a body schema answers 400 `validation_failed` when the body is missing or is not a JSON object, instead of 500. A missing body is validated as an empty one: a body validated in `create` or `replace` mode names each required field (`Field is required`, code `kernel.validation.field.required`), and one in the default `patch` mode, or with no required fields, reaches the handler as `{}`; a body of `null`, an array, a string or a number answers `request: "must be object"` (code `kernel.validation.type`). The kernel's own body check replaces Fastify's, and json-rest-schema throws on anything but an object, so a DELETE sent without its body ended in a 500.
6
12
  - **Side effects.** An application reads `SIDE_EFFECTS`: exactly `live` acts for real; anything else, including unset, simulates (a test copy). `@jskit-ai/kernel/shared/support/sideEffects` gives `resolveSideEffectsMode(env)`, `sideEffectsAreLive(env)` and the page's own `pageSideEffectsMode()`; `@jskit-ai/kernel/server/runtime/sideEffects` gives `logSimulatedSideEffect(logger, { kind, summary, details })`, which logs "Test copy: … was simulated, not sent". `createInstalledRuntime` names the setting in every HTML page the server sends (the `jskit-side-effects` meta tag, with the page's length corrected) and logs once at startup whether the server acts for real, as a warning when a production server simulates. The Vite plugin names the development server's setting in its pages; a built page carries none until its server sends it.
7
13
  - An action definition may give `checkInput(input)`, a check of its input that its schema cannot make until the application runs, such as one that needs what boot resolved. The action pipeline runs it on the input as the schema validated it, before the policy and the action, and answers a refusal (an error with field errors, as `createValidationError` throws) exactly as it answers the schema's: 400 `ACTION_VALIDATION_FAILED`, "Validation failed.", with `details.fieldErrors` and their `fieldErrorCodes`, so an HTTP client and an assistant tool read both alike and the action never runs. Any other error it throws fails the action as it is. A `checkInput` that is not a function is refused at registration.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/kernel",
3
- "version": "0.2.21",
3
+ "version": "0.2.27",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./_testable": "./_testable/index.js",
@@ -27,11 +27,10 @@
27
27
  "./server/i18n": "./server/i18n.js",
28
28
  "./server/platform": "./server/platform/index.js",
29
29
  "./server/runtime": "./server/runtime/index.js",
30
+ "./server/runtime/appEnvironment": "./server/runtime/appEnvironment.js",
30
31
  "./server/runtime/errors": "./server/runtime/errors.js",
31
32
  "./server/runtime/logger": "./server/runtime/logger.js",
32
33
  "./server/runtime/requestUrl": "./server/runtime/requestUrl.js",
33
- "./server/runtime/runtimeMode": "./server/runtime/runtimeMode.js",
34
- "./server/runtime/sideEffects": "./server/runtime/sideEffects.js",
35
34
  "./server/support": "./server/support/index.js",
36
35
  "./server/types": "./server/types.js",
37
36
  "./shared": "./shared/index.js",
@@ -47,7 +46,7 @@
47
46
  "./shared/support/deepFreeze": "./shared/support/deepFreeze.js",
48
47
  "./shared/support/listenerSet": "./shared/support/listenerSet.js",
49
48
  "./shared/support/shellLayoutTargets": "./shared/support/shellLayoutTargets.js",
50
- "./shared/support/sideEffects": "./shared/support/sideEffects.js",
49
+ "./shared/support/appEnvironment": "./shared/support/appEnvironment.js",
51
50
  "./shared/support/providerLogger": "./shared/support/providerLogger.js",
52
51
  "./shared/support/silentLogger": "./shared/support/silentLogger.js",
53
52
  "./shared/support/returnToPath": "./shared/support/returnToPath.js",
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - **Breaking:** `createPaymentCheckoutService` takes `appEnv` (the application's `APP_ENV`, `appEnvironment(env)`) in place of `sideEffects`, and requires it. Only production takes real payments: checkout and the billing portal in the live payment environment are refused elsewhere with `payment_sandbox_only` (409, "Only production takes real payments: use the sandbox payment environment."), which replaces `payment_test_copy`, before any provider write. The sandbox environment works everywhere.
5
6
  - A test copy takes no real money: `createPaymentCheckoutService` takes `sideEffects` (default `simulate`), and unless it is `live`, checkout and the billing portal in the live payment environment are refused with `payment_test_copy` (409) before any provider write. The sandbox environment works either way.
6
7
  - `PAYMENT_STORE_FEATURE` is no longer exported from `PaymentStoreFeature.js` (no public entry point offered it): the feature's id is written as `"payments.store"`, so `jskit check` sees a module that requires that capability where it names it.
7
8
  - payment_entries declares its foreign key, account_key to payment_accounts.account_key (`foreignKeys`), so json-rest-api 3.1.0 can skip the visibility query a system-context read makes for a record such a key guarantees exists. `jskit test --databases` checks each against an app's test database. `paymentStore.mysql.test.js` proves it matches the migration on MariaDB.
@@ -18,7 +18,7 @@
18
18
  "payment_insufficient_credits": "Not enough credits for this action.",
19
19
  "payment_debit_missing": "No debit exists for this reference.",
20
20
  "payment_customer_unbound": "Bind this provider customer before processing its events.",
21
- "payment_test_copy": "This test copy takes no real payments. Use the sandbox payment environment, or set SIDE_EFFECTS=live to take real payments."
21
+ "payment_sandbox_only": "Only production takes real payments: use the sandbox payment environment."
22
22
  },
23
23
  "payments": {
24
24
  "scope": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/payments-core",
3
- "version": "0.2.18",
3
+ "version": "0.2.31",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared": "./src/shared/configuration.js",
@@ -2,6 +2,7 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - **Breaking.** The Redis backplane's address is read from `REALTIME_REDIS_URL`, the name the realtime guide, the `realtime/realtime-application` pattern and its `.env.example` give. It was read from `REDIS_URL`, so an app that set the documented name stayed on the in-process adapter, and each of its copies behind a load balancer delivered events only to the browsers connected to that copy. An app that set `REDIS_URL` for realtime sets `REALTIME_REDIS_URL` instead; `REDIS_NAMESPACE` is unchanged. The pattern's test now reads the name from the runtime, so the two cannot drift apart again.
5
6
  - A publish to a user or workspace room no longer reads the memberships of every online actor. It asks each audience contributor about the actors of the sockets outside its target rooms only for those rooms' scopes, `resolveActorsScopes(actorIds, { scopes })`, and keeps only those rooms of the answer, while the actors already inside are looked up in full for their checks. A contributor that ignores `scopes` still answers correctly. Before, every write action read the memberships of every signed-in socket's actor, so the cost grew with everyone online, also for an event to one user.
6
7
  - Since 0.2.20, an event a background job publishes (an action run with no request, so no request workspace) no longer reads its audience's `audienceUsers` in the `workspaceId` its payload names: with no workspace or user in its scope it reads with no context, so an audience over an owned table reaches nobody. Run the job's action with the workspace in its context (`context.workspace`, or a visibility scope naming it) so its audience reads there.
7
8
  - Since 0.2.20, `all_workspace_users` on an event written on a customer's or a public surface reaches the users of the workspace the request resolved; before, such an event reached no workspace's users. An audience meant for the writer alone names the user instead.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/realtime",
3
- "version": "0.2.33",
3
+ "version": "0.2.45",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./server/RealtimeProvider": "./src/server/RealtimeProvider.js",
@@ -1 +1,2 @@
1
+ # Empty for one server process. With several copies of the app, the same Redis on every copy.
1
2
  REALTIME_REDIS_URL=
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/resource-core",
3
- "version": "0.1.212",
3
+ "version": "0.1.218",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./shared/apiContract": "./src/shared/apiContract.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/uploads-runtime",
3
- "version": "0.2.21",
3
+ "version": "0.2.27",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": "./src/client/index.js",
@@ -34,6 +34,8 @@
34
34
  "./server/sessionUiSyncState": "./src/server/sessionUiSyncState.js",
35
35
  "./server/sourceEditorRealtimeEvents": "./src/server/sourceEditorRealtimeEvents.js",
36
36
  "./server/sessionSourcePath": "./src/server/sessionSourcePath.js",
37
+ "./server/sessionTimeline": "./src/server/sessionTimeline.js",
38
+ "./server/sessionTimelineCli": "./src/server/sessionTimelineCli.js",
37
39
  "./server/studioProjectContext": "./src/server/studioProjectContext.js",
38
40
  "./server/studioRoots": "./src/server/studioRoots.js",
39
41
  "./server/terminalWebSocketRoutes": "./src/server/terminalWebSocketRoutes.js",
@@ -7,6 +7,7 @@
7
7
  ".": "./src/server/index.js",
8
8
  "./server": "./src/server/index.js",
9
9
  "./server/hostProfile": "./src/server/hostProfile.js",
10
+ "./server/hostSettings": "./src/host/hostSettings.js",
10
11
  "./server/terminalSessions": "./src/server/engines/terminalSessions.js",
11
12
  "./server/types": "./src/server/types.js"
12
13
  }