@fungi.computer/shiitake-extensions 0.1.1 → 0.2.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.
@@ -14,8 +14,13 @@ export declare const homeGrant: ExtensionGrantV0;
14
14
  /** Agent-scope choice with per-run tools and prompt over one captured table. */
15
15
  export declare function homeExtension(options: {
16
16
  computers: {
17
+ /** Read the table inside the synchronous Home choice transaction. */
17
18
  read: (context: Readonly<{
18
19
  sessionId: string;
19
20
  }>) => readonly HomeComputer[];
21
+ /** Optional host preparation before run-scoped Files capture. */
22
+ prepare?: (context: Readonly<{
23
+ sessionId: string;
24
+ }>) => Promise<void>;
20
25
  };
21
26
  }): RosteredExtensionV0;
package/dist/home/host.js CHANGED
@@ -51,7 +51,8 @@ export function homeExtension(options) {
51
51
  schema: Schema.NullOr(Home),
52
52
  read: (ctx) => Option.some(Option.getOrNull(ctx.state.choice.peek("default"))),
53
53
  },
54
- files: (ctx, run) => {
54
+ files: async (ctx, run) => {
55
+ await options.computers.prepare?.(run);
55
56
  const computers = [...options.computers.read(run)];
56
57
  const choice = ctx.state.update((state) => {
57
58
  const recorded = Option.getOrNull(state.choice.get("default"));
@@ -35,9 +35,9 @@ export function createConversationAgents(storage) {
35
35
  function created(parentSessionId, agentId) {
36
36
  sql().exec("INSERT OR IGNORE INTO oyster_conversation_agents(parent_session_id, agent_id, session_id, at) VALUES (?, ?, NULL, ?)", parentSessionId, agentId, Date.now());
37
37
  }
38
- /** A send names the conversation to open and moves the row to the front. */
38
+ /** A send may not know its Session until the recipient accepts it. */
39
39
  function sent(parentSessionId, agentId, sessionId) {
40
- sql().exec("INSERT INTO oyster_conversation_agents(parent_session_id, agent_id, session_id, at) VALUES (?, ?, ?, ?) ON CONFLICT(parent_session_id, agent_id) DO UPDATE SET session_id = excluded.session_id, at = excluded.at", parentSessionId, agentId, sessionId, Date.now());
40
+ sql().exec("INSERT INTO oyster_conversation_agents(parent_session_id, agent_id, session_id, at) VALUES (?, ?, ?, ?) ON CONFLICT(parent_session_id, agent_id) DO UPDATE SET session_id = excluded.session_id, at = excluded.at", parentSessionId, agentId, sessionId ?? null, Date.now());
41
41
  }
42
42
  /** One conversation's directory: its accepted creates and sends are recorded. */
43
43
  function recording(parentSessionId, directory) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/shiitake-extensions",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
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",
@@ -108,9 +108,9 @@
108
108
  "dependencies": {
109
109
  "@fungi.computer/almanac": "0.2.0",
110
110
  "@fungi.computer/cairn": "0.1.0",
111
- "@fungi.computer/knapsack": "0.2.1",
112
- "@fungi.computer/mycelium": "0.2.1",
113
- "@fungi.computer/shiitake": "0.3.1",
111
+ "@fungi.computer/knapsack": "0.3.0",
112
+ "@fungi.computer/mycelium": "0.2.2",
113
+ "@fungi.computer/shiitake": "0.4.0",
114
114
  "@fungi.computer/watchdog": "0.1.0",
115
115
  "@fungi.computer/whistle": "0.1.0",
116
116
  "effect": "4.0.2",