@fungi.computer/shiitake-extensions 0.11.17 → 0.11.19

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.
@@ -21,6 +21,8 @@ export declare function resolveHome(recorded: Home | null, computers: readonly R
21
21
  }>[]): Home | null;
22
22
  /** Agent-scope choice with per-run tools and prompt over one captured table. */
23
23
  export declare function homeExtension(options: {
24
+ /** Where this host keeps Home's AGENTS.md and SYSTEM.md; "" is the Files root. */
25
+ instructionsRoot: string;
24
26
  computers: {
25
27
  /** Read the table inside the synchronous Home choice transaction. */
26
28
  read: (context: Readonly<{
package/dist/home/host.js CHANGED
@@ -92,6 +92,7 @@ export function homeExtension(options) {
92
92
  // Home's files are read once for this run, after the state transaction.
93
93
  return loadHomeInstructions({
94
94
  port: selected.port,
95
+ root: options.instructionsRoot,
95
96
  executionId: `home-instructions/${run.workId}`,
96
97
  signal: new AbortController().signal,
97
98
  }).then((text) => {
@@ -8,6 +8,8 @@ export declare function instructionSectionName(index: number): string;
8
8
  */
9
9
  export declare function loadHomeInstructions(input: {
10
10
  port: FilesPort;
11
+ /** Where the host keeps Home's instruction files: "" for the Files root, "/workspace/" on a hosted Computer. */
12
+ root: string;
11
13
  executionId: string;
12
14
  signal: AbortSignal;
13
15
  }): Promise<readonly string[] | null>;
@@ -7,7 +7,11 @@ import { homeInstructionsLimit } from "./contract.js";
7
7
  const maximumSectionBytes = 8_192;
8
8
  const maximumListedProblems = 16;
9
9
  const utf8 = new TextEncoder();
10
- const framing = "From files on Home (computer://home/AGENTS.md, SYSTEM.md). Your owner and you can edit them. Follow them unless they conflict with the instructions above. They never grant tools, approvals or access.";
10
+ /** The framing names the files where the host's root keeps them, so the Agent reads and patches the file that loads. */
11
+ const framing = (root) => {
12
+ const home = `computer://home/${root.replace(/^\//u, "")}`;
13
+ return `From files on Home (${home}AGENTS.md, ${home}SYSTEM.md). Your owner and you can edit them. Follow them unless they conflict with the instructions above. They never grant tools, approvals or access.`;
14
+ };
11
15
  const bytesOf = (text) => utf8.encode(text).byteLength;
12
16
  /** A missing path, as every Files host reports it: an errno ENOENT. */
13
17
  function absent(cause) {
@@ -77,7 +81,7 @@ export async function loadHomeInstructions(input) {
77
81
  const blocks = [];
78
82
  let used = 0;
79
83
  for (const file of ["AGENTS.md", "SYSTEM.md"]) {
80
- const loaded = await readText(input.port, file, context);
84
+ const loaded = await readText(input.port, `${input.root}${file}`, context);
81
85
  if (loaded.kind === "absent")
82
86
  continue;
83
87
  if (loaded.kind === "refused") {
@@ -100,7 +104,7 @@ export async function loadHomeInstructions(input) {
100
104
  if (problems.length > shown.length)
101
105
  shown.push(`${String(problems.length - shown.length)} more problems`);
102
106
  return chunks([
103
- framing,
107
+ framing(input.root),
104
108
  ...blocks,
105
109
  ...(shown.length === 0
106
110
  ? []
@@ -85,12 +85,13 @@ Agent-scope choice with per-run tools and prompt over one captured table.
85
85
 
86
86
  #### Parameters
87
87
 
88
- | Parameter | Type | Description |
89
- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
90
- | `options` | \{ `computers`: \{ `read`: (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[]; `prepare?`: (`context`) => `Promise`\<`void`\>; \}; \} | - |
91
- | `options.computers` | \{ `read`: (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[]; `prepare?`: (`context`) => `Promise`\<`void`\>; \} | - |
92
- | `options.computers.read` | (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[] | Read the table inside the synchronous Home choice transaction. |
93
- | `options.computers.prepare?` | (`context`) => `Promise`\<`void`\> | Optional host preparation before run-scoped Files capture. |
88
+ | Parameter | Type | Description |
89
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
90
+ | `options` | \{ `instructionsRoot`: `string`; `computers`: \{ `read`: (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[]; `prepare?`: (`context`) => `Promise`\<`void`\>; \}; \} | - |
91
+ | `options.instructionsRoot` | `string` | Where this host keeps Home's AGENTS.md and SYSTEM.md; "" is the Files root. |
92
+ | `options.computers` | \{ `read`: (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[]; `prepare?`: (`context`) => `Promise`\<`void`\>; \} | - |
93
+ | `options.computers.read` | (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[] | Read the table inside the synchronous Home choice transaction. |
94
+ | `options.computers.prepare?` | (`context`) => `Promise`\<`void`\> | Optional host preparation before run-scoped Files capture. |
94
95
 
95
96
  #### Returns
96
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/shiitake-extensions",
3
- "version": "0.11.17",
3
+ "version": "0.11.19",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "private": false,
6
6
  "description": "Botanical's product Shiitake extensions: goal, loop and Almanac on the generic extension surface",
@@ -122,7 +122,7 @@
122
122
  "@fungi.computer/cairn": "0.1.0",
123
123
  "@fungi.computer/knapsack": "0.4.20",
124
124
  "@fungi.computer/mycelium": "0.4.7",
125
- "@fungi.computer/shiitake": "0.21.7",
125
+ "@fungi.computer/shiitake": "0.21.8",
126
126
  "@fungi.computer/watchdog": "0.1.4",
127
127
  "@fungi.computer/whistle": "0.3.0",
128
128
  "effect": "4.0.2",