@trailstep/authoring 0.1.2 → 0.2.1
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 +7 -0
- package/dist/index.d.ts +1 -14
- package/dist/index.js +25 -18
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Use this package to author continuation workflows with:
|
|
|
17
17
|
- `defineWorkflow({ start })` as the workflow boundary.
|
|
18
18
|
- `step(...)` for focused units of agent or local work.
|
|
19
19
|
- `.prompt(...).do(...)` for agent-backed steps with structured output.
|
|
20
|
+
- `subPrompt(...)` for dispatching typed helper prompts from inside a running step.
|
|
20
21
|
- `done(...)` and `fail(...)` for terminal continuations.
|
|
21
22
|
- `shape(...)` or `jsonSchema(...)` for JSON-object validation.
|
|
22
23
|
- prompt helpers such as `promptSections`, `section`, `loadFragments`, and `promptTemplate`.
|
|
@@ -62,6 +63,10 @@ import { summarizeRequestStep } from "./steps/summarize-request.step.js";
|
|
|
62
63
|
export const featureSummary = defineWorkflow<FeatureSummaryInput, FeatureSummaryOutput>({
|
|
63
64
|
id: "feature-summary",
|
|
64
65
|
description: "Summarize a feature request and suggest one next step.",
|
|
66
|
+
skill: {
|
|
67
|
+
description: "Use when an agent needs to summarize a feature request.",
|
|
68
|
+
instructions: "Capture the user's request faithfully and recommend one concrete next step.",
|
|
69
|
+
},
|
|
65
70
|
inputShape: featureSummaryInput,
|
|
66
71
|
outputShape: featureSummaryOutput,
|
|
67
72
|
agents: {
|
|
@@ -108,6 +113,8 @@ export const summarizeRequestStep = step({ id: "summarize-request" })
|
|
|
108
113
|
.do((output) => done(output));
|
|
109
114
|
```
|
|
110
115
|
|
|
116
|
+
The optional `skill` block customizes generated agent skill metadata. TrailStep still appends generated CLI usage, input-file, and schema instructions when creating the skill. Raw skill markdown that starts with YAML frontmatter keeps that frontmatter exactly; raw markdown without frontmatter is wrapped in generated `name`/`description` frontmatter before the custom body.
|
|
117
|
+
|
|
111
118
|
Run direct refs while developing:
|
|
112
119
|
|
|
113
120
|
```bash
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Document, FailNode, PromptOptions, PromptTemplateSource, RetryPolicy, RetryPolicyInput, Schema, ShapeInput, ShapeObject, ShapePrimitive, StepConfig, StepFactory, TimeoutPolicy, TimeoutPolicyInput, Workflow, document, done, fail, jsonSchema, list, loadFragments, promptSections, promptTemplate, section, shape, state, step } from '@trailstep/core';
|
|
3
|
-
|
|
4
|
-
interface WorkflowBuilderOptions<TInput extends PlainObject = PlainObject, TOutput extends PlainObject = PlainObject> extends Workflow<TInput, TOutput> {
|
|
5
|
-
readonly description?: string;
|
|
6
|
-
readonly start: (input: TInput) => ReturnType<NonNullable<Workflow<TInput, TOutput>["start"]>>;
|
|
7
|
-
}
|
|
8
|
-
type DefinedWorkflow<TInput extends PlainObject = PlainObject, TOutput extends PlainObject = PlainObject> = Workflow<TInput, TOutput> & {
|
|
9
|
-
readonly description?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
declare function defineWorkflow<TInput extends PlainObject = PlainObject, TOutput extends PlainObject = PlainObject>(options: WorkflowBuilderOptions<TInput, TOutput>): DefinedWorkflow<TInput, TOutput>;
|
|
13
|
-
|
|
14
|
-
export { type DefinedWorkflow, type WorkflowBuilderOptions, defineWorkflow };
|
|
1
|
+
export { AbsoluteDoneNode, AbsoluteFailNode, CheckWaitCallback, CheckWaitContext, CheckWaitHelpers, ContinuationArray, ContinuationResult, DeepReadonly, DefinedWorkflow, DisplayPhase, DoPhase, Document, FailNode, NotifyApi, NotifyArtifact, ParallelNode, PostContinuation, PromptOptions, PromptPhase, PromptTemplateSource, RetryPolicy, RetryPolicyInput, RunnableContinuationNode, Schema, ShapeInput, ShapeObject, ShapePrimitive, StepConfig, StepContextContinuation, StepContinuationOutput, StepCwdCallback, StepCwdContext, StepCwdInput, StepDisplayCallback, StepDisplayContent, StepDisplayContext, StepDisplayLevel, StepDisplayObject, StepDisplayValue, StepFactory, StepPhase, StepWaitContext, SubPromptFactory, SubPromptOptions, TerminalMessageOptions, TimeoutPolicy, TimeoutPolicyInput, WaitCallback, WaitCheckResult, WaitDefinition, WaitDoneResult, WaitInput, WaitOptions, WaitPendingInput, WaitPendingResult, WaitPhase, Workflow, WorkflowBuilderOptions, WorkflowInputApi, WorkflowInvocationNode, WorkflowInvocationOptions, WorkflowSkillOptions, absoluteDone, absoluteFail, defineWorkflow, document, done, fail, globalState, isAbsoluteDoneNode, isAbsoluteFailNode, isParallelNode, isWorkflowInvocationNode, jsonSchema, list, loadFragments, notify, parallel, promptSections, promptTemplate, section, shape, state, step, subPrompt, workflow } from '@trailstep/core';
|
package/dist/index.js
CHANGED
|
@@ -1,51 +1,58 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
|
+
absoluteDone,
|
|
4
|
+
absoluteFail,
|
|
3
5
|
Document,
|
|
4
6
|
document,
|
|
5
7
|
done,
|
|
6
8
|
fail,
|
|
9
|
+
globalState,
|
|
10
|
+
isAbsoluteDoneNode,
|
|
11
|
+
isAbsoluteFailNode,
|
|
12
|
+
isParallelNode,
|
|
13
|
+
isWorkflowInvocationNode,
|
|
7
14
|
jsonSchema,
|
|
8
15
|
list,
|
|
9
16
|
loadFragments,
|
|
17
|
+
notify,
|
|
18
|
+
parallel,
|
|
10
19
|
promptSections,
|
|
11
20
|
promptTemplate,
|
|
12
21
|
section,
|
|
13
22
|
shape,
|
|
14
23
|
state,
|
|
15
|
-
step
|
|
24
|
+
step,
|
|
25
|
+
subPrompt,
|
|
26
|
+
workflow
|
|
16
27
|
} from "@trailstep/core";
|
|
17
28
|
|
|
18
|
-
// src/shared/assert-builder-object.ts
|
|
19
|
-
function assertBuilderObject(value, builderName) {
|
|
20
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
21
|
-
throw new TypeError(`${builderName} requires a single object argument.`);
|
|
22
|
-
}
|
|
23
|
-
if (typeof value.id !== "string") {
|
|
24
|
-
throw new TypeError(`${builderName} requires an id string.`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
29
|
// src/workflow-builder/workflow-builder.ts
|
|
29
|
-
|
|
30
|
-
assertBuilderObject(options, "defineWorkflow");
|
|
31
|
-
if (typeof options.start !== "function")
|
|
32
|
-
throw new TypeError("defineWorkflow requires a start function.");
|
|
33
|
-
return options;
|
|
34
|
-
}
|
|
30
|
+
import { defineWorkflow } from "@trailstep/core";
|
|
35
31
|
export {
|
|
36
32
|
Document,
|
|
33
|
+
absoluteDone,
|
|
34
|
+
absoluteFail,
|
|
37
35
|
defineWorkflow,
|
|
38
36
|
document,
|
|
39
37
|
done,
|
|
40
38
|
fail,
|
|
39
|
+
globalState,
|
|
40
|
+
isAbsoluteDoneNode,
|
|
41
|
+
isAbsoluteFailNode,
|
|
42
|
+
isParallelNode,
|
|
43
|
+
isWorkflowInvocationNode,
|
|
41
44
|
jsonSchema,
|
|
42
45
|
list,
|
|
43
46
|
loadFragments,
|
|
47
|
+
notify,
|
|
48
|
+
parallel,
|
|
44
49
|
promptSections,
|
|
45
50
|
promptTemplate,
|
|
46
51
|
section,
|
|
47
52
|
shape,
|
|
48
53
|
state,
|
|
49
|
-
step
|
|
54
|
+
step,
|
|
55
|
+
subPrompt,
|
|
56
|
+
workflow
|
|
50
57
|
};
|
|
51
58
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/workflow-builder/workflow-builder.ts"],"sourcesContent":["export type {\n AbsoluteDoneNode,\n AbsoluteFailNode,\n CheckWaitCallback,\n CheckWaitContext,\n CheckWaitHelpers,\n ContinuationArray,\n ContinuationResult,\n DeepReadonly,\n DisplayPhase,\n DoPhase,\n FailNode,\n NotifyApi,\n NotifyArtifact,\n ParallelNode,\n PostContinuation,\n PromptOptions,\n PromptPhase,\n PromptTemplateSource,\n RetryPolicy,\n RetryPolicyInput,\n RunnableContinuationNode,\n Schema,\n ShapeInput,\n ShapeObject,\n ShapePrimitive,\n StepConfig,\n StepContextContinuation,\n StepContinuationOutput,\n StepCwdCallback,\n StepCwdContext,\n StepCwdInput,\n StepDisplayCallback,\n StepDisplayContent,\n StepDisplayContext,\n StepDisplayLevel,\n StepDisplayObject,\n StepDisplayValue,\n StepFactory,\n StepPhase,\n StepWaitContext,\n SubPromptFactory,\n SubPromptOptions,\n TerminalMessageOptions,\n TimeoutPolicy,\n TimeoutPolicyInput,\n WaitCallback,\n WaitCheckResult,\n WaitDefinition,\n WaitDoneResult,\n WaitInput,\n WaitOptions,\n WaitPendingInput,\n WaitPendingResult,\n WaitPhase,\n Workflow,\n WorkflowInputApi,\n WorkflowInvocationNode,\n WorkflowInvocationOptions,\n WorkflowSkillOptions,\n} from \"@trailstep/core\";\nexport {\n absoluteDone,\n absoluteFail,\n Document,\n document,\n done,\n fail,\n globalState,\n isAbsoluteDoneNode,\n isAbsoluteFailNode,\n isParallelNode,\n isWorkflowInvocationNode,\n jsonSchema,\n list,\n loadFragments,\n notify,\n parallel,\n promptSections,\n promptTemplate,\n section,\n shape,\n state,\n step,\n subPrompt,\n workflow,\n} from \"@trailstep/core\";\nexport { defineWorkflow } from \"./workflow-builder/workflow-builder.js\";\nexport type {\n DefinedWorkflow,\n WorkflowBuilderOptions,\n} from \"./workflow-builder/workflow-builder.types.js\";\n","export { defineWorkflow } from \"@trailstep/core\";\n"],"mappings":";AA6DA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACtFP,SAAS,sBAAsB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trailstep/authoring",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "TypeScript authoring helpers for TrailStep workflows.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"LICENSE"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@trailstep/core": "0.
|
|
32
|
+
"@trailstep/core": "0.3.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@trailstep/core": "^0.
|
|
35
|
+
"@trailstep/core": "^0.3.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@biomejs/biome": "^2.5.8",
|