openvole 0.2.0 → 0.3.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/dist/index.d.ts CHANGED
@@ -611,7 +611,7 @@ declare class SchedulerStore {
611
611
  setPersistence(filePath: string): void;
612
612
  /** Set the handler called when a schedule ticks */
613
613
  setTickHandler(handler: (input: string) => void): void;
614
- /** Load schedule data from disk without starting cron jobs (for read-only access) */
614
+ /** Load schedule data from disk without starting cron jobs (for read-only access). Never persists. */
615
615
  loadFromDisk(): Promise<void>;
616
616
  /** Load persisted schedules from disk and restart their jobs */
617
617
  restore(): Promise<void>;
package/dist/index.js CHANGED
@@ -816,11 +816,13 @@ var SchedulerStore = class {
816
816
  setTickHandler(handler) {
817
817
  this.tickHandler = handler;
818
818
  }
819
- /** Load schedule data from disk without starting cron jobs (for read-only access) */
819
+ /** Load schedule data from disk without starting cron jobs (for read-only access). Never persists. */
820
820
  async loadFromDisk() {
821
821
  if (!this.savePath) return;
822
+ const savedPath = this.savePath;
823
+ this.savePath = void 0;
822
824
  try {
823
- const raw = await fs3.readFile(this.savePath, "utf-8");
825
+ const raw = await fs3.readFile(savedPath, "utf-8");
824
826
  const persisted = JSON.parse(raw);
825
827
  for (const s of persisted) {
826
828
  const job = new Cron(s.cron, { timezone: "UTC", paused: true }, () => {
@@ -835,6 +837,7 @@ var SchedulerStore = class {
835
837
  }
836
838
  } catch {
837
839
  }
840
+ this.savePath = savedPath;
838
841
  }
839
842
  /** Load persisted schedules from disk and restart their jobs */
840
843
  async restore() {
@@ -1896,6 +1899,20 @@ var PawRegistry = class {
1896
1899
  const { type } = params;
1897
1900
  return this.handleQuery(type);
1898
1901
  });
1902
+ transport.onRequest("register_tools", async (params) => {
1903
+ const { tools } = params;
1904
+ if (tools && tools.length > 0) {
1905
+ const toolDefs = tools.map((t) => ({
1906
+ name: t.name,
1907
+ description: t.description,
1908
+ parameters: {},
1909
+ execute: async (toolParams) => this.executeRemoteTool(pawName, t.name, toolParams)
1910
+ }));
1911
+ this.toolRegistry.register(pawName, toolDefs, false);
1912
+ logger12.info(`Paw "${pawName}" late-registered ${tools.length} tool(s)`);
1913
+ }
1914
+ return { ok: true };
1915
+ });
1899
1916
  transport.onRequest("create_task", async (params) => {
1900
1917
  const { input, source, sessionId, metadata } = params;
1901
1918
  if (!this.taskQueue) {
@@ -1978,6 +1995,18 @@ var PawRegistry = class {
1978
1995
  if (registration.hooks?.bootstrap) {
1979
1996
  this.bootstrapPaws.push(pawName);
1980
1997
  }
1998
+ if (registration.hooks?.perceive) {
1999
+ const config = this.paws.get(pawName)?.config;
2000
+ const hookConfig = config?.hooks?.perceive;
2001
+ const hasTools = (registration.tools?.length ?? 0) > 0;
2002
+ this.perceiveHooks.push({
2003
+ pawName,
2004
+ order: hookConfig?.order ?? 100,
2005
+ pipeline: hookConfig?.pipeline ?? true,
2006
+ hasTools
2007
+ });
2008
+ this.perceiveHooks.sort((a, b) => a.order - b.order);
2009
+ }
1981
2010
  if (registration.hooks?.observe) {
1982
2011
  this.observeHookPaws.push(pawName);
1983
2012
  }