@meistrari/tela-cli 0.8.0 → 1.0.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.
@@ -12,9 +12,13 @@ Import the authoring helpers from `@meistrari/workflow-code`.
12
12
  import {
13
13
  agent,
14
14
  build,
15
+ canvas,
15
16
  code,
16
17
  input,
17
18
  llm,
19
+ splitter,
20
+ vault,
21
+ remote,
18
22
  workflow,
19
23
  } from '@meistrari/workflow-code'
20
24
  import type { WorkflowCodeConfig } from '@meistrari/workflow-code'
@@ -27,14 +31,18 @@ import type { WorkflowCodeConfig } from '@meistrari/workflow-code'
27
31
  | [`input.text()`](#inputtextoptions) | Text input supplied by a user, API caller, or run payload. |
28
32
  | [`input.file()`](#inputfileoptions) | File input supplied by upload or Vault reference. |
29
33
  | [`llm()`](#llmoptions) | Single model-call transformation with optional structured output. |
30
- | [`agent()`](#agentoptions) | Multi-round reasoning, tool use, Tela tools, or external skills. |
34
+ | [`splitter()`](#splitteroptions) | Splitting file inputs, compatible prior outputs, or existing Vault files. |
35
+ | [`vault.ref()`](#vaultrefreference) | Declaring an inert reference to an existing `vault://...` file. |
36
+ | [`remote()`](#remote) | Generated catalog paths and explicit ID refs for inert remote authoring. |
37
+ | [`canvas()`](#canvasremoteref-options) | Executable Canvas or Workflow refs from the remote catalog. |
38
+ | [`agent(remoteRef, options)`](#agentremoteref-options) | Published-Agent calls from the remote catalog. |
31
39
  | [`code()`](#codeoptions) | Sandboxed runtime JavaScript/TypeScript execution. |
32
40
  | [`ref()` / `paths()` / `formats()`](#references-ref-paths-and-formats) | References to workflow inputs or prior node output in prompt callbacks and code handlers. |
33
41
 
34
42
  A workflow file normally creates inputs, creates nodes, then default-exports `build(workflow(...), { inputs, nodes })`.
35
43
 
36
44
  ```ts
37
- import { agent, build, input, llm, workflow } from '@meistrari/workflow-code'
45
+ import { agent, build, input, llm, remote, workflow } from '@meistrari/workflow-code'
38
46
 
39
47
  const topic = input.text({ name: 'topic', required: true })
40
48
 
@@ -49,14 +57,16 @@ const outline = llm({
49
57
  },
50
58
  })
51
59
 
52
- const review = agent({
60
+ const reviewer = remote().agent().byId('published-agent-id')
61
+
62
+ const review = agent(reviewer, {
53
63
  name: 'Review outline',
54
64
  input: {
55
- maxRounds: 8,
56
- prompt: ({ ref, paths }) => [
65
+ message: ({ ref, paths }) => [
57
66
  'Review this outline for a new Tela user.',
58
67
  `Bullets: ${ref(outline, paths(outline).bullets).formats().format}`,
59
68
  ].join('\n'),
69
+ inputs: {},
60
70
  },
61
71
  })
62
72
 
@@ -74,6 +84,42 @@ Rules to keep in mind:
74
84
  - References in node inputs may target workflow inputs or earlier nodes. Forward references are compile diagnostics.
75
85
 
76
86
 
87
+ ### `remote()`
88
+
89
+ ```ts
90
+ import { agent, build, canvas, input, remote, workflow } from '@meistrari/workflow-code'
91
+
92
+ const document = input.file({ name: 'document', required: true })
93
+ const extractInvoice = remote().canvas().Finance['Extract Invoice']
94
+ const triage = remote().agent().byId('published-agent-id')
95
+
96
+ const extract = canvas(extractInvoice, {
97
+ name: 'Extract invoice',
98
+ input: {
99
+ variables: ({ ref }) => ({ file: ref(document) }),
100
+ },
101
+ })
102
+
103
+ const classify = agent(triage, {
104
+ name: 'Triage extraction',
105
+ input: {
106
+ message: ({ ref }) => `Classify ${ref(extract).formats().parser}`,
107
+ inputs: ({ ref }) => ({ document: ref(document) }),
108
+ },
109
+ })
110
+
111
+ export default build(workflow('remote-catalog-example'), {
112
+ inputs: [document],
113
+ nodes: [extract, classify],
114
+ })
115
+ ```
116
+
117
+ Run `tela workflow codegen` before typechecking to generate named paths. User workflow source still imports only from `@meistrari/workflow-code`; generated catalog declarations augment those public types and should not be imported from workflow files.
118
+
119
+ `remote()` values are inert path refs, not API calls or runtime resource objects. `remote().canvas()`, `.workflow()`, `.agent()`, and `.models()` expose generated namespaces. Use bracket access for names with spaces, punctuation, reserved words, or any other segment that is not a safe JavaScript identifier. `byId()` and model `raw()` are explicit escape hatches when a generated name is unavailable or an ID is clearer.
120
+
121
+ `compile` preserves remote refs symbolically and remains offline. `sync` refreshes the active catalog, validates and locks referenced resources, resolves the refs, then lowers them for remote mutation.
122
+
77
123
  ### References: `ref()`, `paths()`, and `formats()`
78
124
 
79
125
  Workflow references connect node inputs to workflow inputs or earlier node outputs. Under the hood, Tela represents those links as URI references such as `input://customer_question` or `step://extract_invoice?path=total&format=...`. Workflow Code hides the URI string and exposes typed helpers instead.
@@ -102,7 +148,7 @@ const extractInvoice = llm({
102
148
  },
103
149
  })
104
150
 
105
- const reviewInvoice = agent({
151
+ const reviewInvoice = llm({
106
152
  name: 'Review invoice extraction',
107
153
  input: {
108
154
  prompt: ({ ref, paths }) => [
@@ -296,58 +342,182 @@ const extractInvoice = llm({
296
342
  })
297
343
  ```
298
344
 
299
- ### `agent(options)`
345
+ ### `canvas(remoteRef, options)`
300
346
 
301
347
  ```ts
302
- type AgentOptions = {
348
+ type RemoteCanvasOptions<Ref extends WorkflowCodeRemoteExecutableRef, Environment extends RemoteEnvironment<Ref> | undefined = undefined> = {
303
349
  name: string
304
350
  key?: string
305
- input: {
306
- prompt: string | ((context: PromptFactoryContext) => string)
307
- model?: string
308
- maxRounds?: number
309
- tools?: AgentToolOptions
310
- }
311
- schema?: WorkflowCodeOutputSchema | null
312
- }
313
-
314
- function agent(options: AgentOptions): AgentNodeDeclaration
351
+ } & (Environment extends string
352
+ ? { environment: Environment, input: { variables: RemoteReferenceRecordInput<RemoteInputObject<Ref, Environment>> } }
353
+ : RemoteDefaultOptions<Ref>)
354
+
355
+ function canvas<Ref extends WorkflowCodeRemoteExecutableRef, Environment extends RemoteEnvironment<Ref> | undefined = undefined>(
356
+ ref: Ref,
357
+ options: RemoteCanvasOptions<Ref, Environment>,
358
+ ): CanvasNodeHandle<RemoteSelectedOutput<Ref, Environment>>
315
359
  ```
316
360
 
317
- Declares an agent node. Use `agent()` when the step may need iteration, tool calls, Tela tools, or broader reasoning than a single completion.
361
+ Declares an executable remote Canvas or Workflow node. The `remoteRef` must come from `remote().canvas()` or `remote().workflow()`. Generated metadata supplies known input variables, output fields, and environment choices when the catalog exposes them.
318
362
 
319
363
  | Option | Type | Required | Description |
320
364
  | --- | --- | --- | --- |
321
365
  | `name` | `string` | Yes | Display name and fallback node identity. Must be non-empty. |
322
366
  | `key` | `string` | No | Stable identity when `name` may change. |
323
- | `input.prompt` | `string \| (context) => string` | Yes | Agent instruction. Callback form enables `ref()` and `paths()`. Must render to non-empty string. |
324
- | `input.model` | `string` | No | Agent model id passed through to Workflow V3. |
325
- | `input.maxRounds` | `number` | No | Maximum reasoning/tool-use rounds. |
326
- | `input.tools` | `AgentToolOptions` | No | Built-in or platform tool options accepted by Workflow V3. |
327
- | `schema` | `WorkflowCodeOutputSchema \| null` | No | Structured output fields for the agent result. Use field names mapped to JSON-schema-like field definitions; omit for default behavior or set `null` when intentionally no schema should be emitted. |
367
+ | `environment` | Generated literal union | Catalog-dependent | Environment name narrowed by the generated ref, such as `'production' \| 'staging'`. A generated ref with multiple non-production targets requires `environment`; generated refs with production metadata, no target metadata, or one selectable target may omit it. |
368
+ | `input.variables` | `Record<string, unknown> \| (context) => Record<string, unknown>` | Yes | Variables passed to the remote executable. Callback form enables `ref()` and typed variable refs. |
328
369
 
329
- `schema` gives the agent an explicit result contract after reasoning/tool use and creates fields that downstream nodes can reference with `paths()`. Keep fields small and explicit: use `type`, `description`, `enum`, `properties`, `items`, and `required` when useful.
370
+ Generated declarations narrow `environment` to catalog literal names and conditionally make it required; it is not an arbitrary `string` escape hatch. The signature above uses the named `RemoteCanvasOptions` shape because the exact requiredness depends on the generated ref's target metadata rather than on a universal optional or required overload. Use `byId()` only for explicit ID binding, then rely on `sync` for authenticated environment validation when generated metadata is unavailable or stale.
371
+
372
+ After sync resolution, this becomes the existing Workflow V3 Canvas action with `canvasId`, optional `environmentName`, and resolved `variables`. Compile keeps the ref symbolic until orchestration supplies the active catalog and locks.
373
+
374
+ ### `splitter(options)`
330
375
 
331
376
  ```ts
332
- const reviewInvoice = agent({
333
- name: 'Review invoice extraction',
334
- key: 'review_invoice',
377
+ type SplitterOptions = {
378
+ name: string
379
+ key?: string
335
380
  input: {
336
- maxRounds: 6,
337
- prompt: ({ ref, paths }) => [
338
- 'Review extracted invoice data for missing or suspicious fields.',
339
- `Vendor: ${ref(extractInvoice, paths(extractInvoice).vendor).formats().format}`,
340
- `Total: ${ref(extractInvoice, paths(extractInvoice).total).formats().format}`,
341
- ].join('\n'),
381
+ file: WorkflowCodeExclusiveFileSource
382
+ chunkSize?: number
383
+ type?: 'pdf' | 'csv'
384
+ mode?: 'single-pages' | 'smart-files'
385
+ customPrompt?: string
386
+ customPromptMode?: 'always' | 'fallback'
387
+ }
388
+ }
389
+
390
+ function splitter(options: SplitterOptions): SplitterNodeHandle
391
+ ```
392
+
393
+ Declares the Workflow V3 `document-splitter` action. Its `input.file` is an exclusive reference field: it accepts a compatible workflow file input or previous-node output, one `vault.ref()`, or an array of Vault refs. It does not accept arbitrary strings or text references.
394
+
395
+ | Option | Type | Required | Default | Description |
396
+ | --- | --- | --- | --- | --- |
397
+ | `name` | `string` | Yes | — | Display name and fallback node identity. |
398
+ | `key` | `string` | No | `name` | Stable identity when the display name may change. |
399
+ | `input.file` | `WorkflowCodeExclusiveFileSource` | Yes | — | File/File-array workflow reference, `vault.ref()`, or array of Vault refs. |
400
+ | `input.chunkSize` | `number` | No | `1` | Pages per PDF chunk or rows per CSV chunk. |
401
+ | `input.type` | `'pdf' \| 'csv'` | No | `'pdf'` | Splitter document type. |
402
+ | `input.mode` | `'single-pages' \| 'smart-files'` | No | `'single-pages'` | Fixed chunking or smart document-boundary detection. |
403
+ | `input.customPrompt` | `string` | No | — | Optional smart-files instruction, up to 2,000 characters. |
404
+ | `input.customPromptMode` | `'always' \| 'fallback'` | No | `'always'` | Whether the custom smart-files prompt is always used or only as fallback. |
405
+
406
+ ```ts
407
+ const invoice = input.file({
408
+ name: 'invoice',
409
+ required: true,
410
+ })
411
+
412
+ const pages = splitter({
413
+ name: 'Split invoice',
414
+ input: {
415
+ file: ({ ref }) => ref(invoice),
416
+ chunkSize: 1,
417
+ type: 'pdf',
418
+ },
419
+ })
420
+
421
+ const splitFirstPageAgain = splitter({
422
+ name: 'Split first page again',
423
+ input: {
424
+ file: ({ ref, paths }) => ref(pages, paths(pages)[0].file),
342
425
  },
426
+ })
427
+ ```
428
+
429
+ Structured `llm()` outputs and published Agent outputs from `agent(remoteRef, options)` are valid sources only when the selected output or path has a file-compatible schema. A file schema declares string-valued schemas for `name` and at least one locator property (`fileUrl`, `vaultReference`, or `base64`). Any other declared transport string field (`mimeType` or another locator) must also be string-valued. Arrays are compatible when their item schema is file-compatible. The `x-tela-kind: 'file'` marker is metadata only and does not bypass structural validation. Schema presence or matching property names alone is not sufficient: scalar, generic-object, missing, malformed, or otherwise incompatible paths produce `compiler.ref.incompatible`.
430
+
431
+ ```ts
432
+ const generated = llm({
433
+ name: 'Generate document reference',
434
+ input: { prompt: 'Return the generated document reference.' },
343
435
  schema: {
344
- approved: { type: 'boolean' },
345
- notes: { type: 'array', items: { type: 'string' } },
436
+ document: {
437
+ type: 'object',
438
+ properties: {
439
+ name: { type: 'string' },
440
+ fileUrl: { type: 'string' },
441
+ },
442
+ },
443
+ },
444
+ })
445
+
446
+ const generatedPages = splitter({
447
+ name: 'Split generated document',
448
+ input: {
449
+ file: ({ ref, paths }) => ref(generated, paths(generated).document),
346
450
  },
347
451
  })
348
452
  ```
349
453
 
350
- Choose `agent()` over `llm()` when the workflow step needs investigation, retries, tools, or judgment across multiple pieces of context.
454
+ `code()` outputs can also feed `splitter.input.file`. Compile statically infers the original handler return without calling it. Transport-file objects, nested paths, file arrays, pass-through file refs, and `File`/`Blob` values are supported. Scalar, malformed, `any`, `unknown`, and mixed file/non-file returns produce `compiler.ref.incompatible`.
455
+
456
+ ```ts
457
+ const generatedByCode = code({
458
+ name: 'Generate document in code',
459
+ handler: () => new File(['document contents'], 'generated.pdf', {
460
+ type: 'application/pdf',
461
+ }),
462
+ })
463
+
464
+ const generatedCodePages = splitter({
465
+ name: 'Split code document',
466
+ input: {
467
+ file: ({ ref }) => ref(generatedByCode),
468
+ },
469
+ })
470
+ ```
471
+
472
+ The referenced runtime value still needs to describe a real file. Declaring `fileUrl` or `vaultReference` in an LLM schema does not upload or create a Vault file.
473
+
474
+ ### `vault.ref(reference)`
475
+
476
+ ```ts
477
+ const vault: {
478
+ ref: <Reference extends `vault://${string}`>(
479
+ reference: Reference,
480
+ ) => WorkflowCodeVaultRef<Reference>
481
+ }
482
+ ```
483
+
484
+ Creates an inert declaration for a file that already exists in Vault. The reference must contain a UUID v4 or SHA-256 file id. Calling `vault.ref()` does not read credentials, contact Vault, download the file, or mutate local state during source evaluation.
485
+
486
+ ```ts
487
+ const existingInvoice = vault.ref(
488
+ 'vault://550e8400-e29b-41d4-a716-446655440000',
489
+ )
490
+
491
+ const existingPages = splitter({
492
+ name: 'Split existing invoice',
493
+ input: { file: existingInvoice },
494
+ })
495
+ ```
496
+
497
+ During compile, a direct Vault ref used by `splitter.input.file` lowers to a transport-file object containing both `fileUrl` and `vaultReference`. Compile remains offline. Before remote workflow mutation, sync and publish validate access to every compiled Vault ref in the active Tela context.
498
+
499
+ ### `agent(remoteRef, options)`
500
+
501
+ ```ts
502
+ function agent<Ref extends WorkflowCodeRemoteAgentRef>(
503
+ ref: Ref,
504
+ options: {
505
+ name: string
506
+ key?: string
507
+ input: {
508
+ message: string | ((context: PromptFactoryContext) => string)
509
+ inputs: Record<string, unknown> | ((context: PromptFactoryContext) => Record<string, unknown>)
510
+ environmentVariables?: Record<string, string>
511
+ }
512
+ },
513
+ ): AgentNodeHandle<RemoteAgentOutput<Ref>>
514
+ ```
515
+
516
+ Declares a published Agent invocation. The `remoteRef` must come from `remote().agent()`. Generated metadata supplies known required inputs and output types when the catalog contains an authoritative published-Agent contract.
517
+
518
+ `input.message` is prompt-like, may use `ref()` callbacks, and must render to a non-empty string. `input.inputs` supplies the published Agent's named inputs and may contain workflow input or prior-node refs. Optional `environmentVariables` remain authored strings; they are not resolved through catalog metadata.
519
+
520
+ Lowering targets the existing Workflow V3 `agent-fcc` action fields `agentId`, `message`, `inputs`, and optional `environmentVariables` only. It does not emit output schema, revision, or catalog-hash fields in the node input.
351
521
 
352
522
  ### `code(options)`
353
523
 
@@ -1,6 +1,6 @@
1
1
  ## CLI
2
2
 
3
- The workflow command group documents implemented `init`, `compile`, `docs`, `sync`, and `publish` workflows. Current MVP behavior is local-first until you run explicit remote lifecycle commands such as `sync` or `publish`.
3
+ The workflow command group documents implemented `init`, `compile`, `docs`, `codegen`, `sync`, and `publish` workflows. Current MVP behavior is local-first until you run explicit remote lifecycle commands such as `sync` or `publish`.
4
4
 
5
5
  ### Command surface
6
6
 
@@ -9,6 +9,7 @@ The workflow command group documents implemented `init`, `compile`, `docs`, `syn
9
9
  | `init [--directory <path>] [--config <path>] [--workflow <key>...] [--yes] [--init-git\|--no-init-git] [--install-deps\|--no-install-deps] [--package-manager bun\|pnpm\|npm\|yarn] [--json]` | Implemented | No | Create local Workflow Code scaffold. |
10
10
  | `compile [target] [--config <path>] [--env <path>] [--json]` | Implemented | No | Compile selected source into Workflow V3 output. |
11
11
  | `docs [page] [--json]` | Implemented | No | Read the version-matched Workflow Code documentation bundled with the installed CLI. |
12
+ | `codegen [--json]` | Implemented | No | Refresh or reuse the active-context remote catalog and generate remote() TypeScript metadata. |
12
13
  | `sync [target] [--config <path>] [--env <path>] [--yes] [--json]` | Implemented | Yes | Synchronize local compiled workflow(s) with configured Tela prompt(s). |
13
14
  | `publish [target] [--environment <name>] [--create-environment-if-missing] [--config <path>] [--env <path>] [--yes] [--json]` | Implemented | Yes | Publish local-matching workflow version(s) to the selected workflow environment. |
14
15
 
@@ -21,6 +22,7 @@ tela workflow compile
21
22
  tela workflow compile invoice-processing
22
23
  tela workflow compile invoice-processing --env .env.staging --json
23
24
  tela workflow docs cli
25
+ tela workflow codegen --json
24
26
  tela workflow sync
25
27
  tela workflow sync invoice-processing --env .env.staging --json
26
28
  tela workflow publish
@@ -105,6 +107,27 @@ tela workflow docs cli
105
107
  tela workflow docs api-reference --json
106
108
  ```
107
109
 
110
+ ### codegen
111
+
112
+ `codegen [--json]`
113
+
114
+ **Description.** `tela workflow codegen` resolves the active Tela Local context and workspace, refreshes the authenticated remote catalog, and writes TypeScript metadata for inert `remote()` authoring. It writes the generated augmentation at `.tela/workflow-code/generated/workflow-code.generated.d.ts` and the complete context/workspace snapshot at `.tela/workflow-code/catalogs/<workspaceId>/remote-catalog.snapshot.json`. The catalog includes canvases, workflows, templates, published agents, and models; only canvases, workflows, published agents, and models are projected by `remote()`.
115
+
116
+ Codegen fetches a fresh snapshot when possible. If refresh fails, it may reuse only a complete cached snapshot for the same active context and workspace, reports warning diagnostics, and repairs or skips artifacts deterministically. If neither refresh nor a matching snapshot is available, it fails without inventing catalog bindings. Generated files are non-secret typechecking and orchestration metadata; include the generated declaration path in TypeScript's `include` configuration when needed.
117
+
118
+ `compile` remains offline and preserves symbolic remote refs. `sync` refreshes and validates catalog references and locks before resolved lowering and remote mutation.
119
+
120
+ | Prop | Type | Required | Description |
121
+ |---|---|---:|---|
122
+ | `--json` | Flag | No | Emit command, active context/workspace, metadata source/hash/timestamps, written paths, skipped paths, and diagnostics as JSON. |
123
+
124
+ **Examples.**
125
+
126
+ ```bash
127
+ tela workflow codegen
128
+ tela workflow codegen --json
129
+ ```
130
+
108
131
  ### sync
109
132
 
110
133
  **Description.** `tela workflow sync` compiles local source, resolves the active Tela Local context, selects the matching `projectId` and `promptId`, verifies remote content, and writes per-context lockfile state under `.tela/workflows/<workflowKey>/contexts/<context>/lock.json`.
@@ -8,19 +8,19 @@
8
8
  "slug": "overview",
9
9
  "title": "Documentation overview",
10
10
  "file": "overview.md",
11
- "sha256": "864146c6f6ef204590c4f444edb5109be08075343bd3115f1ba5bc29d70be177"
11
+ "sha256": "88c838262048260cee280cdd8d16e9987847bcf06b857ca6d2cf0b707c4b15fe"
12
12
  },
13
13
  {
14
14
  "slug": "api-reference",
15
15
  "title": "API Reference",
16
16
  "file": "api-reference.md",
17
- "sha256": "bc52ff31a4fcf5b8c21cf0ddf2fc3f2ba2dcbc69b6b55302f26768fb5348b7bb"
17
+ "sha256": "2306f6a21d23b4e3457262c3105e65e0292af5a59154aa15cf24188409db07f8"
18
18
  },
19
19
  {
20
20
  "slug": "cli",
21
21
  "title": "CLI",
22
22
  "file": "cli.md",
23
- "sha256": "321454c8359c0449261e625120e2af6960cc71460dcf9a0f929ffad58e8ab4bf"
23
+ "sha256": "759db330fd7b06859e55404f01feb0625a43bb579324fe011bc34cd92d517239"
24
24
  },
25
25
  {
26
26
  "slug": "config",
@@ -44,7 +44,7 @@
44
44
  "slug": "quick-start",
45
45
  "title": "Quick start",
46
46
  "file": "quick-start.md",
47
- "sha256": "78212b3f1fa52c116e6fd9f5331edefecf1079e1073aa32673f719b44d019ce8"
47
+ "sha256": "15f4b45bd6292c4dd3f3ff5fc58f46e5e83e55f3a5e4ed9fee0df37fd12b2305"
48
48
  }
49
49
  ]
50
50
  }
@@ -9,6 +9,6 @@ Workflow Code documentation is organized as a set of focused pages. Read the pag
9
9
  | [Quick start](/docs/quick-start) | You want the shortest path from `tela workflow init` to local compile and explicit sync. |
10
10
  | [Installation](/docs/installation) | You need to verify Tela Dock, the `tela` CLI, or the `@meistrari/workflow-code` package. |
11
11
  | [Config](/docs/config) | You are defining `workflow-code.config.ts`, dotenv files, target ids, or context-specific bindings. |
12
- | [CLI](/docs/cli) | You need implemented init/compile/sync/publish behavior, target selection rules, or JSON diagnostics. |
13
- | [API Reference](/docs/api-reference) | You are authoring `workflow()`, `build()`, `input`, `llm`, `agent`, `code`, and references. |
12
+ | [CLI](/docs/cli) | You need implemented init/compile/docs/codegen/sync/publish behavior, target selection rules, generated catalog refresh, or JSON diagnostics. |
13
+ | [API Reference](/docs/api-reference) | You are authoring `workflow()`, `build()`, `input`, `llm`, `agent`, `code`, references, remote catalogs, and executable remote refs. |
14
14
  | [Guides](/docs/guides) | You want repository layout, CI compile checks, and troubleshooting patterns. |
@@ -47,7 +47,7 @@ Keep the first config small: one target, one entrypoint, and environment-backed
47
47
  ### Author a workflow
48
48
 
49
49
  ```ts
50
- import { agent, build, code, input, llm, workflow } from '@meistrari/workflow-code'
50
+ import { agent, build, code, input, llm, remote, workflow } from '@meistrari/workflow-code'
51
51
 
52
52
  const topic = input.text({
53
53
  name: 'topic',
@@ -77,15 +77,17 @@ const countBullets = code({
77
77
  },
78
78
  })
79
79
 
80
- const review = agent({
80
+ const reviewer = remote().agent().byId('published-agent-id')
81
+
82
+ const review = agent(reviewer, {
81
83
  name: 'Review outline',
82
84
  input: {
83
- maxRounds: 8,
84
- prompt: ({ ref, paths }) => [
85
+ message: ({ ref, paths }) => [
85
86
  'Review this outline for a new Tela user.',
86
87
  `Bullets: ${ref(outline, paths(outline).bullets).formats().json}`,
87
88
  `Bullet count: ${ref(countBullets, paths(countBullets).count).formats().json}`,
88
89
  ].join('\n'),
90
+ inputs: {},
89
91
  },
90
92
  })
91
93