openmates 0.21.0-alpha.6 → 0.21.0-alpha.7

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.
@@ -87504,6 +87504,7 @@ async function resolveRemoteAccessBindings(client, masterKey, projects, candidat
87504
87504
  }
87505
87505
  const bindings = [];
87506
87506
  for (const item of resolved) {
87507
+ await ensureProjectDefaultFocus(client, item.project, context, item.rootPath);
87507
87508
  const sourceType = remoteAccessSourceType(item.rootPath);
87508
87509
  const source = startRemoteAccessSource({
87509
87510
  sourceId: item.sourceId,
@@ -87591,9 +87592,24 @@ async function createEncryptedRemoteAccessProject(client, name, rootPath, writeM
87591
87592
  };
87592
87593
  }
87593
87594
  async function decryptProjectDefaultFocus(client, project, context) {
87595
+ return ensureProjectDefaultFocus(client, project, context);
87596
+ }
87597
+ async function ensureProjectDefaultFocus(client, project, context, rootPath) {
87594
87598
  const settings = await client.getProjectSettings(project.projectId, context);
87595
87599
  if (!settings.encrypted_settings) {
87596
- throw new CliContractError("project_focus_missing", "This Project does not have an encrypted default focus.");
87600
+ const importedInstructions = rootPath ? readRootProjectInstructions(rootPath) : null;
87601
+ const focus = buildProjectDefaultFocus(
87602
+ project.name,
87603
+ importedInstructions?.instructions,
87604
+ importedInstructions?.source
87605
+ );
87606
+ await client.updateProjectSettings(project.projectId, {
87607
+ write_mode: settings.write_mode === "always_ask" ? "always_ask" : "apply_and_show",
87608
+ default_focus_id: focus.focus_id,
87609
+ encrypted_settings: await encryptWithAesGcmCombined(JSON.stringify({ default_focus: focus }), project.projectKey),
87610
+ updated_at: nowSeconds3()
87611
+ }, context);
87612
+ return focus;
87597
87613
  }
87598
87614
  const plaintext = await decryptWithAesGcmCombined(settings.encrypted_settings, project.projectKey);
87599
87615
  if (!plaintext) throw new CliContractError("project_focus_invalid", "The Project default focus could not be decrypted.");
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  serializeToYaml,
20
20
  shouldRequireTrustedAccountGuard,
21
21
  waitForWorkflowRun
22
- } from "./chunk-WDFC7XBM.js";
22
+ } from "./chunk-3PJYPJJQ.js";
23
23
  import "./chunk-IWKP55ZB.js";
24
24
  import "./chunk-BBKJZ23O.js";
25
25
  export {
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  selectAssistantMessagesForSpeech,
43
43
  serializeToYaml,
44
44
  summarizeAssistantSpeech
45
- } from "./chunk-WDFC7XBM.js";
45
+ } from "./chunk-3PJYPJJQ.js";
46
46
  import "./chunk-IWKP55ZB.js";
47
47
  import "./chunk-BBKJZ23O.js";
48
48
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.21.0-alpha.6",
3
+ "version": "0.21.0-alpha.7",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",