@studio-foundation/contracts 0.3.0-beta.6 → 0.4.0-beta
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 +50 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,56 @@
|
|
|
1
1
|
# @studio-foundation/contracts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Studio** is an agentic pipeline runtime that executes multi-stage LLM workflows with structural validation and automatic retry. This package is **contracts**: the shared TypeScript types and interfaces that every other Studio package imports. Zero dependencies, zero logic.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`contracts` is the leaf of the dependency graph. It defines the language all Studio packages speak: `PipelineDefinition`, `StageRun`, `OutputContract`, `AgentConfig`, `LLMRequest`, and the rest. Install it if you're writing tooling that reads or produces Studio configs, or if you're embedding Studio packages into your own code and need the types.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- Homepage: https://github.com/studio-foundation/studio
|
|
8
|
+
- Full docs: [README](https://github.com/studio-foundation/studio#readme) · [INVARIANTS](https://github.com/studio-foundation/studio/blob/main/INVARIANTS.md)
|
|
9
|
+
- Use via the CLI: [`@studio-foundation/cli`](https://www.npmjs.com/package/@studio-foundation/cli)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @studio-foundation/contracts
|
|
15
|
+
# or
|
|
16
|
+
pnpm add @studio-foundation/contracts
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type {
|
|
23
|
+
PipelineDefinition,
|
|
24
|
+
StageDefinition,
|
|
25
|
+
OutputContract,
|
|
26
|
+
AgentConfig,
|
|
27
|
+
StageStatus,
|
|
28
|
+
} from '@studio-foundation/contracts';
|
|
29
|
+
|
|
30
|
+
import { isStageGroup } from '@studio-foundation/contracts'; // the only runtime export
|
|
31
|
+
|
|
32
|
+
for (const stage of pipeline.stages) {
|
|
33
|
+
if (isStageGroup(stage)) {
|
|
34
|
+
// handle a group
|
|
35
|
+
} else {
|
|
36
|
+
// handle a plain stage
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Dependency position
|
|
8
42
|
|
|
9
43
|
```
|
|
10
44
|
contracts ← ralph
|
|
11
45
|
contracts ← runner
|
|
46
|
+
contracts ← anonymizer
|
|
12
47
|
contracts ← engine
|
|
13
48
|
contracts ← cli
|
|
49
|
+
contracts ← api
|
|
14
50
|
```
|
|
15
51
|
|
|
52
|
+
Nothing imports upward. If you find yourself adding a dep here, you're solving the wrong problem.
|
|
53
|
+
|
|
16
54
|
## What's in here
|
|
17
55
|
|
|
18
56
|
| Module | Purpose |
|
|
@@ -98,9 +136,15 @@ interface SpawnConfig {
|
|
|
98
136
|
|
|
99
137
|
Used by the `studio_run` builtin tool to spawn sub-pipelines from within an agent run.
|
|
100
138
|
|
|
101
|
-
##
|
|
139
|
+
## For contributors
|
|
102
140
|
|
|
103
|
-
|
|
104
|
-
|
|
141
|
+
Internal rules that govern this package:
|
|
142
|
+
|
|
143
|
+
- **Zero dependencies**: no imports from other `@studio-foundation/*` packages, ever.
|
|
144
|
+
- **Zero logic**: types and interfaces only. The one exception: `isStageGroup()` in `pipeline.ts` is a pure type guard function (no side effects, no state).
|
|
105
145
|
- If you need to add a type used by two packages, put it here.
|
|
106
146
|
- If you're adding logic, you're in the wrong package.
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
AGPL-3.0-only
|