@graview/tools 0.1.62 → 0.1.64
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/agent/tools.d.ts +15 -0
- package/dist/agent/tools.d.ts.map +1 -1
- package/dist/agent/tools.js +46 -6
- package/dist/agent/tools.js.map +1 -1
- package/dist/agent/workflow-tools.d.ts +55 -0
- package/dist/agent/workflow-tools.d.ts.map +1 -0
- package/dist/agent/workflow-tools.js +82 -0
- package/dist/agent/workflow-tools.js.map +1 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +11 -3
- package/dist/cli.js.map +1 -1
- package/dist/edit.d.ts +10 -2
- package/dist/edit.d.ts.map +1 -1
- package/dist/edit.js +4 -1
- package/dist/edit.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/starter.d.ts +17 -3
- package/dist/starter.d.ts.map +1 -1
- package/dist/starter.js +64 -7
- package/dist/starter.js.map +1 -1
- package/dist/tidy/away.d.ts +8 -1
- package/dist/tidy/away.d.ts.map +1 -1
- package/dist/tidy/away.js +3 -1
- package/dist/tidy/away.js.map +1 -1
- package/dist/tidy/dream.d.ts.map +1 -1
- package/dist/tidy/dream.js +7 -0
- package/dist/tidy/dream.js.map +1 -1
- package/dist/tidy/system-one.d.ts +6 -0
- package/dist/tidy/system-one.d.ts.map +1 -1
- package/dist/tidy/system-one.js +10 -1
- package/dist/tidy/system-one.js.map +1 -1
- package/dist/workflow-cli.d.ts +20 -0
- package/dist/workflow-cli.d.ts.map +1 -0
- package/dist/workflow-cli.js +187 -0
- package/dist/workflow-cli.js.map +1 -0
- package/dist/workflows/ask.d.ts +20 -0
- package/dist/workflows/ask.d.ts.map +1 -0
- package/dist/workflows/ask.js +42 -0
- package/dist/workflows/ask.js.map +1 -0
- package/dist/workflows/log.d.ts +4 -0
- package/dist/workflows/log.d.ts.map +1 -0
- package/dist/workflows/log.js +16 -0
- package/dist/workflows/log.js.map +1 -0
- package/dist/workflows/run-act.d.ts +4 -0
- package/dist/workflows/run-act.d.ts.map +1 -0
- package/dist/workflows/run-act.js +147 -0
- package/dist/workflows/run-act.js.map +1 -0
- package/dist/workflows/run-agent.d.ts +4 -0
- package/dist/workflows/run-agent.d.ts.map +1 -0
- package/dist/workflows/run-agent.js +91 -0
- package/dist/workflows/run-agent.js.map +1 -0
- package/dist/workflows/run-archive.d.ts +4 -0
- package/dist/workflows/run-archive.d.ts.map +1 -0
- package/dist/workflows/run-archive.js +121 -0
- package/dist/workflows/run-archive.js.map +1 -0
- package/dist/workflows/run-classify.d.ts +4 -0
- package/dist/workflows/run-classify.d.ts.map +1 -0
- package/dist/workflows/run-classify.js +157 -0
- package/dist/workflows/run-classify.js.map +1 -0
- package/dist/workflows/run-generate.d.ts +4 -0
- package/dist/workflows/run-generate.d.ts.map +1 -0
- package/dist/workflows/run-generate.js +126 -0
- package/dist/workflows/run-generate.js.map +1 -0
- package/dist/workflows/run.d.ts +5 -0
- package/dist/workflows/run.d.ts.map +1 -0
- package/dist/workflows/run.js +247 -0
- package/dist/workflows/run.js.map +1 -0
- package/dist/workflows/seat.d.ts +20 -0
- package/dist/workflows/seat.d.ts.map +1 -0
- package/dist/workflows/seat.js +27 -0
- package/dist/workflows/seat.js.map +1 -0
- package/dist/workflows/steps.d.ts +7 -0
- package/dist/workflows/steps.d.ts.map +1 -0
- package/dist/workflows/steps.js +21 -0
- package/dist/workflows/steps.js.map +1 -0
- package/dist/workflows/types.d.ts +213 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +3 -0
- package/dist/workflows/types.js.map +1 -0
- package/dist/workflows.d.ts +14 -0
- package/dist/workflows.d.ts.map +1 -0
- package/dist/workflows.js +24 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +7 -3
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { AnySchema, Author, GraviewApp, MutationCall, Operation, Store, Via } from "@graview/core";
|
|
2
|
+
import type { WorkflowApproval, WorkflowOrigin, WorkflowPolicy, WorkflowStep } from "@graview/core/workflows";
|
|
3
|
+
import type { HostAi } from "../ai.js";
|
|
4
|
+
import type { Severity } from "../tidy/policy.js";
|
|
5
|
+
/** What became of a run as a whole. */
|
|
6
|
+
export type WorkflowOutcome =
|
|
7
|
+
/** It did what it was declared to. */
|
|
8
|
+
"ok"
|
|
9
|
+
/** It ran and there was nothing new to do. */
|
|
10
|
+
| "nothing-new"
|
|
11
|
+
/** Some of it did not run — a step skipped (no model lent), or refused — and the rest did. */
|
|
12
|
+
| "partial"
|
|
13
|
+
/** It did not run: paused, or held back as a whole. */
|
|
14
|
+
| "held"
|
|
15
|
+
/** It stopped on a failure; what it kept before the failure stands, and a rerun is safe. */
|
|
16
|
+
| "failed";
|
|
17
|
+
/** What started a run. */
|
|
18
|
+
export type WorkflowRunTrigger = {
|
|
19
|
+
readonly kind: "schedule";
|
|
20
|
+
readonly at: string;
|
|
21
|
+
}
|
|
22
|
+
/** `by`: another workflow's run made the change (`FiredTrigger.by` from `triggeredBy`); the run carries its chain. */
|
|
23
|
+
| {
|
|
24
|
+
readonly kind: "made" | "changed";
|
|
25
|
+
readonly records: readonly string[];
|
|
26
|
+
readonly by?: WorkflowOrigin;
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: "synced";
|
|
29
|
+
readonly connection: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly kind: "byHand";
|
|
32
|
+
readonly who?: string;
|
|
33
|
+
};
|
|
34
|
+
/** What one step's model calls spent. */
|
|
35
|
+
export interface StepSpend {
|
|
36
|
+
/** The step's place in the workflow. */
|
|
37
|
+
readonly step: number;
|
|
38
|
+
/** Requests sent to a model. */
|
|
39
|
+
readonly calls: number;
|
|
40
|
+
readonly inputTokens: number;
|
|
41
|
+
readonly outputTokens: number;
|
|
42
|
+
/** Dollars, when the model's reply or the host's price said. */
|
|
43
|
+
readonly costUsd?: number;
|
|
44
|
+
/** The model it asked. */
|
|
45
|
+
readonly model?: string;
|
|
46
|
+
}
|
|
47
|
+
/** What a run's model steps spent: the totals, and each step that asked a model. All zero when none did. */
|
|
48
|
+
export interface WorkflowSpend {
|
|
49
|
+
readonly calls: number;
|
|
50
|
+
readonly inputTokens: number;
|
|
51
|
+
readonly outputTokens: number;
|
|
52
|
+
readonly costUsd?: number;
|
|
53
|
+
readonly steps: readonly StepSpend[];
|
|
54
|
+
}
|
|
55
|
+
/** The most runs a chain of workflows waking each other goes to before a run is held: `RunWorkflowOptions.chainLimit` when unsaid. */
|
|
56
|
+
export declare const MOST_CHAIN = 3;
|
|
57
|
+
/** One run, as a host keeps it. */
|
|
58
|
+
export interface WorkflowRun {
|
|
59
|
+
/** `workflow:<name>:<started>`: on every op the run made, as `lineage.run`. */
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly workflow: string;
|
|
62
|
+
readonly trigger: WorkflowRunTrigger;
|
|
63
|
+
readonly started: string;
|
|
64
|
+
readonly finished: string;
|
|
65
|
+
readonly outcome: WorkflowOutcome;
|
|
66
|
+
/** Nothing was kept: a dry run says what it would have done. */
|
|
67
|
+
readonly dry: boolean;
|
|
68
|
+
readonly made: readonly string[];
|
|
69
|
+
readonly changed: readonly string[];
|
|
70
|
+
readonly archived: readonly string[];
|
|
71
|
+
/** The ops that hold what it suggested. */
|
|
72
|
+
readonly suggested: readonly string[];
|
|
73
|
+
/** What it held back, by step (its index), and why, in words. */
|
|
74
|
+
readonly heldBack: readonly {
|
|
75
|
+
readonly step: number;
|
|
76
|
+
readonly why: string;
|
|
77
|
+
}[];
|
|
78
|
+
/** How far it read the log: every op before this seq. The next run reads from here (`StepContext.since`); a dry or failed run leaves it where the last good run had it. */
|
|
79
|
+
readonly through: number;
|
|
80
|
+
/** A hash of the workflow as declared when it ran: the first run after a change is a dry run. */
|
|
81
|
+
readonly specHash: string;
|
|
82
|
+
/** What it says, in sentences, in order. */
|
|
83
|
+
readonly notes: readonly string[];
|
|
84
|
+
/** What its model steps spent — calls and tokens, by step and in all — so a host meters a run from the run alone. */
|
|
85
|
+
readonly spent: WorkflowSpend;
|
|
86
|
+
/**
|
|
87
|
+
* The workflows whose runs started this one, the first first: empty for
|
|
88
|
+
* a run a clock, a person, a connection or a person's change started.
|
|
89
|
+
* Its length is the run's depth; past the runner's `chainLimit` the run
|
|
90
|
+
* is held and says so.
|
|
91
|
+
*/
|
|
92
|
+
readonly chain: readonly string[];
|
|
93
|
+
}
|
|
94
|
+
/** The host's log of runs: the last of a workflow's, all of them newest first, and keeping one. */
|
|
95
|
+
export interface WorkflowLog {
|
|
96
|
+
last(name: string): WorkflowRun | undefined;
|
|
97
|
+
add(run: WorkflowRun): void;
|
|
98
|
+
runs(name: string, limit?: number): readonly WorkflowRun[];
|
|
99
|
+
}
|
|
100
|
+
export interface RunWorkflowOptions<S extends AnySchema = AnySchema> {
|
|
101
|
+
/** The app: its declaration says the workflow; its brand the clock. */
|
|
102
|
+
readonly app: GraviewApp<S>;
|
|
103
|
+
/** The store that keeps the log — a server's, for a hosted app. */
|
|
104
|
+
readonly store: Store<S>;
|
|
105
|
+
/** Which workflow, by name. */
|
|
106
|
+
readonly workflow: string;
|
|
107
|
+
/** The run's moment. Now when unsaid. */
|
|
108
|
+
readonly now?: Date | string | number;
|
|
109
|
+
/** What started it. By hand when unsaid. */
|
|
110
|
+
readonly trigger?: WorkflowRunTrigger;
|
|
111
|
+
/** Keep nothing; say what it would do. A run by hand of a paused workflow, and the first run after a change, are dry whatever this says. */
|
|
112
|
+
readonly dryRun?: boolean;
|
|
113
|
+
/** Where the runs are kept. */
|
|
114
|
+
readonly log: WorkflowLog;
|
|
115
|
+
/** The host's AI, for an agent step: its `complete` proposes. Without one an agent step is skipped. */
|
|
116
|
+
readonly ai?: HostAi;
|
|
117
|
+
/** Who runs: an automated system author, `workflow:<name>` named by its title, when unsaid. */
|
|
118
|
+
readonly principal?: Author;
|
|
119
|
+
/** What its changes come through, as the log records it. `workflow:<name>` when unsaid. */
|
|
120
|
+
readonly via?: Via;
|
|
121
|
+
/** How deep a chain of workflows started by each other's changes may go before a run is held (`MOST_CHAIN`, 3, when unsaid). */
|
|
122
|
+
readonly chainLimit?: number;
|
|
123
|
+
}
|
|
124
|
+
/** One change a step would make, before what `approve` makes of it. */
|
|
125
|
+
export interface StepChange {
|
|
126
|
+
readonly calls: readonly MutationCall[];
|
|
127
|
+
/** Why, in words: on the lineage. */
|
|
128
|
+
readonly basis: string;
|
|
129
|
+
/** How sure: 1 for a deterministic step. */
|
|
130
|
+
readonly confidence?: number;
|
|
131
|
+
/** How much it would undo, for `suggest`'s routing. "categorize" when unsaid. */
|
|
132
|
+
readonly severity?: Severity;
|
|
133
|
+
/** The model that proposed it. */
|
|
134
|
+
readonly model?: string;
|
|
135
|
+
/** The stable key of what it makes (an act step's `key`), kept on the lineage. */
|
|
136
|
+
readonly key?: string;
|
|
137
|
+
/** It waits for a person whatever `approve` says: a label a host shows the public (a classify step's `confirm`). */
|
|
138
|
+
readonly ask?: boolean;
|
|
139
|
+
/** It is made whatever `approve` says, unless `ask`: a judgment sure enough for its option's `applyAt`. */
|
|
140
|
+
readonly apply?: boolean;
|
|
141
|
+
}
|
|
142
|
+
/** What a step tells the run a model call spent: `calls` 1 when unsaid. */
|
|
143
|
+
export interface SpendSaid {
|
|
144
|
+
readonly calls?: number;
|
|
145
|
+
readonly inputTokens?: number;
|
|
146
|
+
readonly outputTokens?: number;
|
|
147
|
+
readonly costUsd?: number;
|
|
148
|
+
readonly model?: string;
|
|
149
|
+
}
|
|
150
|
+
/** What `StepContext.change` did with one change. */
|
|
151
|
+
export type ChangeOutcome = {
|
|
152
|
+
readonly as: "applied";
|
|
153
|
+
readonly ops: readonly Operation[];
|
|
154
|
+
} | {
|
|
155
|
+
readonly as: "previewed";
|
|
156
|
+
readonly ops: readonly Operation[];
|
|
157
|
+
} | {
|
|
158
|
+
readonly as: "suggested";
|
|
159
|
+
readonly op?: string;
|
|
160
|
+
} | {
|
|
161
|
+
readonly as: "dropped" | "unchanged";
|
|
162
|
+
} | {
|
|
163
|
+
readonly as: "refused";
|
|
164
|
+
readonly error: string;
|
|
165
|
+
};
|
|
166
|
+
/** What a step runner is handed: the store, the run, and the one door every change goes through. */
|
|
167
|
+
export interface StepContext<S extends AnySchema = AnySchema> {
|
|
168
|
+
readonly app: GraviewApp<S>;
|
|
169
|
+
/** The store, whole; read it as the run's principal sees it with `seen`. */
|
|
170
|
+
readonly store: Store<AnySchema>;
|
|
171
|
+
/** The store as the run's principal sees it. */
|
|
172
|
+
readonly seen: Store<AnySchema>;
|
|
173
|
+
readonly workflow: {
|
|
174
|
+
readonly name: string;
|
|
175
|
+
readonly title: string;
|
|
176
|
+
};
|
|
177
|
+
/** The step's place in the workflow. */
|
|
178
|
+
readonly index: number;
|
|
179
|
+
readonly run: string;
|
|
180
|
+
readonly principal: Author;
|
|
181
|
+
readonly now: number;
|
|
182
|
+
/** The run's day on the app's clock: what `$today` reads. */
|
|
183
|
+
readonly today: string;
|
|
184
|
+
readonly dry: boolean;
|
|
185
|
+
/** What this step's changes become: its own word, else the workflow's, else the default. */
|
|
186
|
+
readonly approve: WorkflowApproval;
|
|
187
|
+
readonly trigger: WorkflowRunTrigger;
|
|
188
|
+
readonly ai?: HostAi;
|
|
189
|
+
/** The policy records the workflow follows (`follows`), read once for the run; none when it follows none. */
|
|
190
|
+
readonly follows: readonly WorkflowPolicy[];
|
|
191
|
+
/** The ops from the last good run's `through` on: what was made and changed since it. */
|
|
192
|
+
readonly since: readonly Operation[];
|
|
193
|
+
/**
|
|
194
|
+
* THE ONE DOOR: a change made, previewed (a dry run), suggested or let
|
|
195
|
+
* go by `approve` and its confidence, with the run's lineage, and what it
|
|
196
|
+
* made, changed and set aside counted on the run.
|
|
197
|
+
*/
|
|
198
|
+
change(change: StepChange): ChangeOutcome;
|
|
199
|
+
/** Hold something back, said in words. */
|
|
200
|
+
holdBack(why: string): void;
|
|
201
|
+
/** Say something on the run. */
|
|
202
|
+
note(said: string): void;
|
|
203
|
+
/** The step did not run, and the run is `partial` for it. */
|
|
204
|
+
skipped(why: string): void;
|
|
205
|
+
/** What a model call of this step spent, counted on the run's `spent`. */
|
|
206
|
+
spent(usage: SpendSaid): void;
|
|
207
|
+
}
|
|
208
|
+
/** One kind of step, run: keyed as `STEP_KINDS` is. */
|
|
209
|
+
export interface StepRunner<Step extends WorkflowStep = WorkflowStep> {
|
|
210
|
+
readonly key: string;
|
|
211
|
+
run(step: Step, context: StepContext): Promise<void>;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workflows/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC9G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAUlD,uCAAuC;AACvC,MAAM,MAAM,eAAe;AACzB,sCAAsC;AACpC,IAAI;AACN,8CAA8C;GAC5C,aAAa;AACf,8FAA8F;GAC5F,SAAS;AACX,uDAAuD;GACrD,MAAM;AACR,4FAA4F;GAC1F,QAAQ,CAAC;AAEb,0BAA0B;AAC1B,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE;AACpD,sHAAsH;GACpH;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO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,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workflows/types.ts"],"names":[],"mappings":"AAyDA,sIAAsI;AACtI,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { runWorkflow } from "./workflows/run.js";
|
|
2
|
+
export { memoryWorkflowLog } from "./workflows/log.js";
|
|
3
|
+
export { STEP_RUNNERS, stepRunnerOf } from "./workflows/steps.js";
|
|
4
|
+
export { runActStep } from "./workflows/run-act.js";
|
|
5
|
+
export { runAgentStep } from "./workflows/run-agent.js";
|
|
6
|
+
export { runGenerateStep } from "./workflows/run-generate.js";
|
|
7
|
+
export { runArchiveStep } from "./workflows/run-archive.js";
|
|
8
|
+
export { askedOf, type Asked, type AskedOptions } from "./workflows/ask.js";
|
|
9
|
+
export { runClassifyStep } from "./workflows/run-classify.js";
|
|
10
|
+
export { MOST_CHAIN } from "./workflows/types.js";
|
|
11
|
+
export type { ChangeOutcome, RunWorkflowOptions, SpendSaid, StepChange, StepContext, StepRunner, StepSpend, WorkflowLog, WorkflowOutcome, WorkflowRun, WorkflowRunTrigger, WorkflowSpend } from "./workflows/types.js";
|
|
12
|
+
export { seatWorkflows } from "./workflows/seat.js";
|
|
13
|
+
export type { WorkflowTools } from "./agent/workflow-tools.js";
|
|
14
|
+
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../src/workflows.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvN,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `@graview/tools/workflows` — RUNNING WHAT THE APP DOES ON ITS OWN
|
|
3
|
+
* (Roadmap f-jobs-declared, f-job-idempotency, f-job-pause-dry-run).
|
|
4
|
+
*
|
|
5
|
+
* `runWorkflow` runs one of the declaration's workflows once, as an
|
|
6
|
+
* automated system author (`workflow:<name>`, named by its title), every
|
|
7
|
+
* op it makes under one `lineage.run` so Activity reads the run as one
|
|
8
|
+
* row. Each step goes to its runner (`STEP_RUNNERS`, keyed as core's
|
|
9
|
+
* `STEP_KINDS` are) and every change through one door that applies,
|
|
10
|
+
* previews, suggests or lets it go. The host keeps the runs
|
|
11
|
+
* (`WorkflowLog`, `memoryWorkflowLog`). On no page.
|
|
12
|
+
*/
|
|
13
|
+
export { runWorkflow } from "./workflows/run.js";
|
|
14
|
+
export { memoryWorkflowLog } from "./workflows/log.js";
|
|
15
|
+
export { STEP_RUNNERS, stepRunnerOf } from "./workflows/steps.js";
|
|
16
|
+
export { runActStep } from "./workflows/run-act.js";
|
|
17
|
+
export { runAgentStep } from "./workflows/run-agent.js";
|
|
18
|
+
export { runGenerateStep } from "./workflows/run-generate.js";
|
|
19
|
+
export { runArchiveStep } from "./workflows/run-archive.js";
|
|
20
|
+
export { askedOf } from "./workflows/ask.js";
|
|
21
|
+
export { runClassifyStep } from "./workflows/run-classify.js";
|
|
22
|
+
export { MOST_CHAIN } from "./workflows/types.js";
|
|
23
|
+
export { seatWorkflows } from "./workflows/seat.js";
|
|
24
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../src/workflows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAiC,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graview/tools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.64",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -64,11 +64,15 @@
|
|
|
64
64
|
"./reshape": {
|
|
65
65
|
"types": "./dist/reshape.d.ts",
|
|
66
66
|
"default": "./dist/reshape.js"
|
|
67
|
+
},
|
|
68
|
+
"./workflows": {
|
|
69
|
+
"types": "./dist/workflows.d.ts",
|
|
70
|
+
"default": "./dist/workflows.js"
|
|
67
71
|
}
|
|
68
72
|
},
|
|
69
73
|
"dependencies": {
|
|
70
|
-
"@graview/core": "0.1.
|
|
71
|
-
"@graview/ship": "0.1.
|
|
74
|
+
"@graview/core": "0.1.64",
|
|
75
|
+
"@graview/ship": "0.1.64"
|
|
72
76
|
},
|
|
73
77
|
"devDependencies": {
|
|
74
78
|
"@modelcontextprotocol/sdk": "^1.32.0",
|