@repogo/plugins 0.1.35 → 0.1.37

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/runtime.d.ts CHANGED
@@ -2,14 +2,17 @@ import { z } from "zod";
2
2
  import { type Schedule } from "./cron";
3
3
  import type { Caller, CronEntry, CronStatus, Manifest, Notice } from "./context";
4
4
  export type { Manifest, ManifestCron, ManifestMethod } from "./context";
5
- import type { PluginDefinition, MethodKind } from "./define";
5
+ import type { HTTPAccess, PluginDefinition, MethodKind } from "./define";
6
6
  import { EventBus } from "./events";
7
+ import type { WorkflowBridge } from "./workflow/contracts";
8
+ import { type UploadedFile } from "./uploads";
7
9
  export type RegisteredMethod = {
8
10
  name: string;
9
11
  plugin: string;
10
12
  kind: MethodKind;
11
13
  description?: string;
12
14
  confirm?: string;
15
+ http?: HTTPAccess;
13
16
  input: z.ZodType;
14
17
  output?: z.ZodType;
15
18
  /** `raw` is the input as sent, before defaults filled it in. */
@@ -51,11 +54,15 @@ export declare class Runtime {
51
54
  private dataDir;
52
55
  private root;
53
56
  private host?;
57
+ private workflows?;
54
58
  readonly events: EventBus;
55
59
  readonly methods: Map<string, RegisteredMethod>;
56
60
  readonly plugins: Map<string, PluginDefinition>;
57
61
  readonly crons: CronJob[];
62
+ private contexts;
58
63
  private databases;
64
+ /** Each namespace's saved answers of `cached` methods. */
65
+ private answerCaches;
59
66
  /** Every kv, stream and bucket by tag, shared by the plugins that name it, with its schema's JSON. */
60
67
  private stores;
61
68
  private invalidationListeners;
@@ -80,10 +87,16 @@ export declare class Runtime {
80
87
  dataDir: string;
81
88
  root?: string;
82
89
  host?: HostCaller;
90
+ workflows?: WorkflowBridge;
83
91
  }): Promise<Runtime>;
84
92
  /** `only` names the plugins to import, for a Worker that runs schedules: their neighbours' code never runs. */
85
93
  loadDir(pluginsDir: string, only?: string[] | null): Promise<void>;
86
94
  add(name: string, plugin: PluginDefinition): Promise<void>;
95
+ executeWorkflow(plugin: string, name: string, input: unknown, context: import("./workflow/runner").RunContext & {
96
+ root: string;
97
+ runId: string;
98
+ caller: Caller;
99
+ }): Promise<unknown>;
87
100
  /**
88
101
  * Calls a method and reports what it read and wrote. `expect: "query"` is how
89
102
  * a card runs a method on its own: it refuses anything that might write, and
@@ -100,6 +113,7 @@ export declare class Runtime {
100
113
  root?: string;
101
114
  caller?: Caller;
102
115
  chat?: string;
116
+ files?: UploadedFile[];
103
117
  }): Promise<CallResult>;
104
118
  /**
105
119
  * Runs a stream method, passing each item it yields to `onItem` until it
@@ -149,6 +163,7 @@ export declare class Runtime {
149
163
  tickStorage(now?: number): Promise<void>;
150
164
  close(): void;
151
165
  private database;
166
+ private answerCache;
152
167
  private store;
153
168
  private storesOf;
154
169
  private notifyInvalidated;
package/dist/self.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Caller, CronEntry, CronStatus, Manifest, Notice } from "./context";
2
2
  import type { PluginDefinition } from "./define";
3
3
  import { type LogRecord } from "./logs";
4
+ import type { UploadedFile } from "./uploads";
4
5
  export type TestCall = {
5
6
  /** False is a tap the user hasn't answered yet: a method with a `confirm` answers CONFIRM. */
6
7
  confirmed?: boolean;
@@ -8,6 +9,8 @@ export type TestCall = {
8
9
  root?: string;
9
10
  /** The chat an agent calls from, kept on the call's log lines. */
10
11
  chat?: string;
12
+ /** Files as an `<Upload>` sends them, given to the method as `input.files`. */
13
+ files?: UploadedFile[];
11
14
  };
12
15
  export type TestRuntime = {
13
16
  /** Runs `<plugin>.<method>` and returns its answer, or throws its MethodError. */
@@ -47,3 +50,4 @@ export declare function testRuntime(plugins: Record<string, PluginDefinition>, o
47
50
  mcp?: TestMCP;
48
51
  host?: TestHost;
49
52
  }): Promise<TestRuntime>;
53
+ export { testWorkflowRuntime } from "./workflow/testing";