eve-hub 0.16.15 → 0.16.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve-hub",
3
- "version": "0.16.15",
3
+ "version": "0.16.16",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
6
6
  "type": "module",
package/prepare.mjs CHANGED
@@ -11,20 +11,20 @@
11
11
  // is the host's fails the build, and the build never writes a sandbox;
12
12
  // - the kit extension, host-only workers and kit stubs are dropped, the
13
13
  // Vercel Kit connection is wired in, every bot of a build from a repo gets eve's git extension, and the
14
- // workspace's memory and each bot's team architecture are embedded in the bots' memory providers (a function
15
- // has no workspace cwd);
14
+ // workspace's memory and each bot's team architecture are embedded in the bots' memory providers, and main's
15
+ // standing decisions in its dash schedule (a function has no workspace cwd);
16
16
  // - /hub/manifest: the roster and the commit sha the deployment was built
17
17
  // from, for the hub to sync from: a custom channel on main, routed in
18
18
  // vercel.mjs. From the hub, as on each bot's eve channel (hub-oidc.mjs).
19
19
  import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
20
20
  import { createRequire } from "node:module";
21
21
  import { basename, dirname, join } from "node:path";
22
- import { DEPLOYED_KIT_FILES, KIT_FILES, MAIN_KIT_FILES } from "./stubs.mjs";
22
+ import { DEPLOYED_KIT_FILES, KIT_FILES, MAIN_KIT_FILES, isKitReexport } from "./stubs.mjs";
23
23
  import KIT_MODULES from "./kit-modules.json" with { type: "json" };
24
24
  import { applyKit, readBotFiles, syncKit } from "./sync-kit.mjs";
25
25
  export { DEPLOYED_KIT_FILES };
26
26
  import { deploymentFacts, hostedContext } from "./execution-context.mjs";
27
- import { botDomains, domainFolders, readBotMemory, readMemory, validateMemory } from "./memory.mjs";
27
+ import { activeEntries, botDomains, domainFolders, entryText, readBotMemory, readMemory, validateMemory } from "./memory.mjs";
28
28
  import { agentRunsOn, readWorkspaceFile, removeWorkspaceAgent } from "./workspace.mjs";
29
29
  import { architectureText } from "./team.mjs";
30
30
  import { sandboxReady } from "./sandbox-migrate.mjs";
@@ -140,6 +140,16 @@ const recall = () => teamRecall(text);
140
140
  export default defineMemory({ namespace: "hub-team-memory", scope: "workspace", provider: defineMemoryProvider({ recall: { "turn.started": recall } }) });
141
141
  `;
142
142
 
143
+ // A hosted main's dash schedule: the standing decisions main's turns recall, embedded at build
144
+ // time for the Dash plan, since a function has no memory/ to read. It replaces only the kit's
145
+ // re-export; a workspace's own dash schedule (.ts or another source for the slot) stays.
146
+ const DASH_SCHEDULE_FILE = join("schedules", "dash.ts");
147
+ const isKitDashSchedule = (bot) => existsSync(join(bot, DASH_SCHEDULE_FILE)) && isKitReexport(readFileSync(join(bot, DASH_SCHEDULE_FILE), "utf8"), "schedules/dash");
148
+ export const dashScheduleStub = (entries) => `import { dashSchedule } from "eve-hub/schedules/dash";
149
+ const decisions = ${JSON.stringify(activeEntries(entries).map((e) => entryText(e)).join("\n"))};
150
+ export default dashSchedule({ decisions: () => decisions });
151
+ `;
152
+
143
153
  // Replaces the kit's execution-context stub (the local page) with the hosted
144
154
  // page, for a bot the definition says is hosted. Its removed-tools list is read
145
155
  // from the bot's folder as pruned.
@@ -207,7 +217,9 @@ export function prepareDeployment(dir) {
207
217
  writeFileSync(join(bot, "connections", "vercel-kit.ts"), 'export { default } from "eve-hub/connections/vercel-kit";\n');
208
218
  mkdirSync(join(bot, "memory"), { recursive: true });
209
219
  const botDir = join(dir, "agents", name);
210
- writeFileSync(join(bot, "memory", "workspace.ts"), memoryProvider("workspace", readMemory(dir, { folders: domainFolders(botDomains(dir, botDir)) }).entries, "Standing decision", "workspace"));
220
+ const { entries } = readMemory(dir, { folders: domainFolders(botDomains(dir, botDir)) });
221
+ writeFileSync(join(bot, "memory", "workspace.ts"), memoryProvider("workspace", entries, "Standing decision", "workspace"));
222
+ if (name === "main" && isKitDashSchedule(bot)) writeFileSync(join(bot, DASH_SCHEDULE_FILE), dashScheduleStub(entries));
211
223
  // A folder the roster doesn't list has no place in the team, and a function can't read the file the stub would.
212
224
  if (definition.agents.some((a) => a.name === name)) writeFileSync(join(bot, "memory", "team.ts"), teamProvider(architectureText(definition.data, name)));
213
225
  else rmSync(join(bot, "memory", "team.ts"), { force: true });
@@ -1,3 +1,9 @@
1
+ export declare function dashSchedule({ decisions }: {
2
+ decisions: () => string;
3
+ }): {
4
+ cron: string;
5
+ run(): Promise<void>;
6
+ };
1
7
  declare const _default: {
2
8
  cron: string;
3
9
  run(): Promise<void>;
package/schedules/dash.js CHANGED
@@ -4,7 +4,9 @@
4
4
  // whose facts changed (openai/gpt-6-luna-decisions through eve`s `decide`,
5
5
  // eve's gateway credentials) and a model call per track with news
6
6
  // (anthropic/claude-sonnet-5.5 through the AI SDK). The pass: runPass in
7
- // ./dash-pass.mjs.
7
+ // ./dash-pass.mjs. `decisions` gives the human's standing decisions for the plan: read from the
8
+ // workspace's memory/ on the hub's machine (the default export), embedded at build time on a
9
+ // hosted main, whose function has no workspace files (prepare.mjs writes that stub).
8
10
  import { defineSchedule } from "eve/schedules";
9
11
  import { decide } from "eve/ai";
10
12
  import { generateText, Output } from "ai";
@@ -15,11 +17,14 @@ import { PLAN_MODEL, PLAN_TIMEOUT_MS } from "./dash-plan.mjs";
15
17
  import { PlanOut } from "./dash-plan-schema.mjs";
16
18
  import { standingDecisions } from "./dash-decisions.mjs";
17
19
  import { modelSummarize } from "./track-summaries.mjs";
18
- export default defineSchedule({
19
- cron: "*/8 * * * *",
20
- async run() {
21
- const hub = createHub();
22
- const plan = async (prompt) => (await generateText({ model: PLAN_MODEL, prompt, output: Output.object({ schema: PlanOut }), maxRetries: 1, abortSignal: AbortSignal.timeout(PLAN_TIMEOUT_MS) })).output;
23
- await hub.track("dash", () => dashPass(hub, { classify: modelClassify({ evaluate: decide }), summarize: modelSummarize({ generateText }), plan, decisions: standingDecisions() }));
24
- },
25
- });
20
+ export function dashSchedule({ decisions }) {
21
+ return defineSchedule({
22
+ cron: "*/8 * * * *",
23
+ async run() {
24
+ const hub = createHub();
25
+ const plan = async (prompt) => (await generateText({ model: PLAN_MODEL, prompt, output: Output.object({ schema: PlanOut }), maxRetries: 1, abortSignal: AbortSignal.timeout(PLAN_TIMEOUT_MS) })).output;
26
+ await hub.track("dash", () => dashPass(hub, { classify: modelClassify({ evaluate: decide }), summarize: modelSummarize({ generateText }), plan, decisions: decisions() }));
27
+ },
28
+ });
29
+ }
30
+ export default dashSchedule({ decisions: () => standingDecisions() });