@intentic/sandbox-contract 1.379.0 → 1.380.0

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 (36) hide show
  1. package/dist/contracts/agent.contract.d.ts +18 -0
  2. package/dist/contracts/agent.contract.d.ts.map +1 -1
  3. package/dist/contracts/agents.contract.d.ts +8 -0
  4. package/dist/contracts/agents.contract.d.ts.map +1 -1
  5. package/dist/contracts/sessions.contract.d.ts +4 -0
  6. package/dist/contracts/sessions.contract.d.ts.map +1 -1
  7. package/dist/events/agent-events.d.ts +12 -0
  8. package/dist/events/agent-events.d.ts.map +1 -1
  9. package/dist/events/agent-transcript.d.ts +4 -0
  10. package/dist/events/agent-transcript.d.ts.map +1 -1
  11. package/dist/events/agent-words.d.ts +7 -0
  12. package/dist/events/agent-words.d.ts.map +1 -1
  13. package/dist/events/agent-words.js +29 -5
  14. package/dist/events/agent-words.js.map +1 -1
  15. package/dist/events/transcript.d.ts +24 -0
  16. package/dist/events/transcript.d.ts.map +1 -1
  17. package/dist/events/transcript.js +4 -0
  18. package/dist/events/transcript.js.map +1 -1
  19. package/dist/index.d.ts +30 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/schemas/conversation-links.d.ts.map +1 -1
  22. package/dist/schemas/conversation-links.js.map +1 -1
  23. package/dist/schemas/run-targets.d.ts +1 -0
  24. package/dist/schemas/run-targets.d.ts.map +1 -1
  25. package/dist/schemas/run-targets.js +1 -0
  26. package/dist/schemas/run-targets.js.map +1 -1
  27. package/dist/state/workspace-state.d.ts.map +1 -1
  28. package/dist/state/workspace-state.js +3 -1
  29. package/dist/state/workspace-state.js.map +1 -1
  30. package/package.json +5 -5
  31. package/src/events/agent-words.ts +39 -5
  32. package/src/events/transcript.ts +4 -0
  33. package/src/schemas/conversation-links.ts +2 -1
  34. package/src/schemas/run-targets.ts +5 -0
  35. package/src/state/workspace-state.test.ts +6 -1
  36. package/src/state/workspace-state.ts +4 -4
@@ -14,6 +14,11 @@ import { ArtifactNameSchema } from "./device-artifacts.js";
14
14
 
15
15
  export const RUN_TARGETS_FILE = `${STATE_DIR}/run.json`;
16
16
 
17
+ // The files under the workspace root's `.intentic/` that are the project's rather than the sandbox's, which no store of
18
+ // the daemon's owns: a project kept at the workspace root declares its targets there, as any repository does in its own.
19
+ // The root repo tracks them (VERSIONED_STATE_PATHS in state/workspace-state.ts), so an agent's edit lands like code.
20
+ export const ROOT_PROJECT_PATHS: readonly string[] = [RUN_TARGETS_FILE];
21
+
17
22
  const RepoPathSchema = z
18
23
  .string()
19
24
  .min(1)
@@ -1,5 +1,6 @@
1
1
  import { HISTORY_ROOT, STATE_DIR } from "@intentic/constants";
2
2
  import type { FileContribution } from "@intentic/extension-manifest";
3
+ import { ROOT_PROJECT_PATHS } from "../schemas/run-targets.js";
3
4
  import {
4
5
  BACKED_UP_STATE_PATHS,
5
6
  isLockedWorkspacePath,
@@ -412,6 +413,9 @@ describe(`VERSIONED_STATE_PATHS`, () => {
412
413
  `${STATE_DIR}/config/templates.json`,
413
414
  `${STATE_DIR}/config/workflows.json`,
414
415
  `${STATE_DIR}/config/workspace-extensions/`,
416
+ // A project kept at the workspace root declares its run targets here, as any repository does in its own
417
+ // `.intentic/`: the project's file, not the sandbox's, landed and committed like code.
418
+ `${STATE_DIR}/run.json`,
415
419
  ]);
416
420
  });
417
421
 
@@ -463,7 +467,8 @@ describe(`state groups`, () => {
463
467
  it(`agrees with the two lists that were derived before it`, () => {
464
468
  // The git exclude reads versioned; the search floor reads versioned||authored. Both must land inside config.
465
469
  const written = stateGroupPaths(`config`);
466
- for (const path of VERSIONED_STATE_PATHS) {
470
+ // Less a root project's run targets: tracked, but the project's own file rather than any of the sandbox's state.
471
+ for (const path of VERSIONED_STATE_PATHS.filter((tracked) => !ROOT_PROJECT_PATHS.includes(tracked))) {
467
472
  expect([path, written.includes(path)]).toEqual([path, true]);
468
473
  }
469
474
  expect(SEARCHABLE_STATE_PATHS.toSorted()).toEqual(written.toSorted());
@@ -1,5 +1,6 @@
1
1
  import { HISTORY_ROOT, STATE_DIR } from "@intentic/constants";
2
2
  import type { FileContribution } from "@intentic/extension-manifest";
3
+ import { ROOT_PROJECT_PATHS } from "../schemas/run-targets.js";
3
4
  import type { StateFile } from "./state-portability.js";
4
5
 
5
6
  // Declares which workspace file backs which browser view, imported by both the daemon (builds store paths from
@@ -539,10 +540,9 @@ const STATE_FILES = [
539
540
 
540
541
  export const WORKSPACE_STATE_FILES: readonly WorkspaceStateFile[] = STATE_FILES;
541
542
 
542
- // Entries the root repo tracks, in declaration order; history.ts turns this into the negations that carve them out
543
- // of the wholesale `.intentic` exclusion. Derived here rather than duplicated beside the git rule, so marking an
544
- // entry `versioned` is the only change needed.
545
- export const VERSIONED_STATE_PATHS: readonly string[] = WORKSPACE_STATE_FILES.filter((file) => file.versioned).map((file) => file.path);
543
+ // Entries the root repo tracks, which history.ts carves out of the `.intentic` exclusion; a root project's run targets too.
544
+ const versionedFiles = WORKSPACE_STATE_FILES.filter((file) => file.versioned).map((file) => file.path);
545
+ export const VERSIONED_STATE_PATHS: readonly string[] = [...versionedFiles, ...ROOT_PROJECT_PATHS];
546
546
 
547
547
  // What a workspace search may surface: `versioned` config plus `authored` content (approvals, staged docs,
548
548
  // workspace extensions). Everything else under `.intentic` is machine state, denied by default. `auth/`, where