@langchain/quickjs 1.0.0-alpha.0 → 1.0.0-rc.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.
package/README.md CHANGED
@@ -100,7 +100,9 @@ PTC configuration is progressive:
100
100
 
101
101
  ### Recursive Language Model (RLM)
102
102
 
103
- When the `task` tool is exposed via PTC, the agent can spawn sub-agents in parallel from within the REPL:
103
+ When the agent has subagents configured, a `task()` global is available inside
104
+ the REPL (no PTC needed), so the agent can spawn sub-agents in parallel from
105
+ within the REPL:
104
106
 
105
107
  ```typescript
106
108
  const agent = createDeepAgent({
@@ -112,7 +114,7 @@ const agent = createDeepAgent({
112
114
  systemPrompt: "...",
113
115
  },
114
116
  ],
115
- middleware: [createQuickJSMiddleware({ ptc: ["task"] })],
117
+ middleware: [createQuickJSMiddleware()],
116
118
  });
117
119
  ```
118
120
 
@@ -122,16 +124,21 @@ The agent then writes code like:
122
124
  const topics = ["quantum computing", "fusion energy", "CRISPR"];
123
125
  const results = await Promise.all(
124
126
  topics.map((topic) =>
125
- tools.task({
127
+ task({
126
128
  description: `Research ${topic} in depth`,
127
129
  subagentType: "general-purpose",
128
130
  }),
129
131
  ),
130
132
  );
133
+ // Aggregate and return the report from the eval; the agent then writes it to a
134
+ // file with its own write_file tool.
131
135
  const report = topics.map((t, i) => `## ${t}\n${results[i]}`).join("\n\n");
132
- await writeFile("/research.md", report);
136
+ report;
133
137
  ```
134
138
 
139
+ > `task` cannot be exposed via `ptc` — it is reserved for the `task()` global,
140
+ > so passing `ptc: ["task"]` throws.
141
+
135
142
  ## API
136
143
 
137
144
  ### `createQuickJSMiddleware(options?)`