@meistrari/tela-cli 1.0.0 → 1.1.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.
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
build,
|
|
15
15
|
canvas,
|
|
16
16
|
code,
|
|
17
|
+
crop,
|
|
17
18
|
input,
|
|
18
19
|
llm,
|
|
19
20
|
splitter,
|
|
@@ -32,6 +33,8 @@ import type { WorkflowCodeConfig } from '@meistrari/workflow-code'
|
|
|
32
33
|
| [`input.file()`](#inputfileoptions) | File input supplied by upload or Vault reference. |
|
|
33
34
|
| [`llm()`](#llmoptions) | Single model-call transformation with optional structured output. |
|
|
34
35
|
| [`splitter()`](#splitteroptions) | Splitting file inputs, compatible prior outputs, or existing Vault files. |
|
|
36
|
+
| [`crop()`](#cropoptions) | Cropping selected PDF pages from compatible files or existing Vault files. |
|
|
37
|
+
| [`vault.asset()`](#vaultassetpath-options) | Declaring a local file that `sync` uploads and locks in Vault. |
|
|
35
38
|
| [`vault.ref()`](#vaultrefreference) | Declaring an inert reference to an existing `vault://...` file. |
|
|
36
39
|
| [`remote()`](#remote) | Generated catalog paths and explicit ID refs for inert remote authoring. |
|
|
37
40
|
| [`canvas()`](#canvasremoteref-options) | Executable Canvas or Workflow refs from the remote catalog. |
|
|
@@ -390,7 +393,7 @@ type SplitterOptions = {
|
|
|
390
393
|
function splitter(options: SplitterOptions): SplitterNodeHandle
|
|
391
394
|
```
|
|
392
395
|
|
|
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
|
|
396
|
+
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 `vault.asset()`, or an array containing one of those Vault declaration kinds. It does not accept arbitrary strings or text references.
|
|
394
397
|
|
|
395
398
|
| Option | Type | Required | Default | Description |
|
|
396
399
|
| --- | --- | --- | --- | --- |
|
|
@@ -471,6 +474,82 @@ const generatedCodePages = splitter({
|
|
|
471
474
|
|
|
472
475
|
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
476
|
|
|
477
|
+
### `crop(options)`
|
|
478
|
+
|
|
479
|
+
```ts
|
|
480
|
+
type CropOptions = {
|
|
481
|
+
name: string
|
|
482
|
+
key?: string
|
|
483
|
+
input: {
|
|
484
|
+
file: WorkflowCodeExclusiveFileSource
|
|
485
|
+
indexes: readonly (number | string)[]
|
|
486
|
+
type?: 'pdf'
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
function crop(options: CropOptions): CropNodeHandle
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
Declares Workflow V3's existing `document-cropper` action. Its exclusive `input.file` supports the same compatible workflow input, prior-node output, `vault.ref()`, `vault.asset()`, and Vault-array forms as `splitter.input.file`.
|
|
494
|
+
|
|
495
|
+
| Option | Type | Required | Default | Description |
|
|
496
|
+
| --- | --- | --- | --- | --- |
|
|
497
|
+
| `name` | `string` | Yes | — | Display name and fallback node identity. |
|
|
498
|
+
| `key` | `string` | No | `name` | Stable identity when the display name may change. |
|
|
499
|
+
| `input.file` | `WorkflowCodeExclusiveFileSource` | Yes | — | File/File-array workflow reference, `vault.ref()`, `vault.asset()`, or an array of Vault declarations. |
|
|
500
|
+
| `input.indexes` | `readonly (number \| string)[]` | Yes | — | Integer page indexes or cropper-supported ranges such as `'3-5'`. |
|
|
501
|
+
| `input.type` | `'pdf'` | No | `'pdf'` | Cropper document type. |
|
|
502
|
+
|
|
503
|
+
```ts
|
|
504
|
+
const selectedPages = crop({
|
|
505
|
+
name: 'Crop selected invoice pages',
|
|
506
|
+
input: {
|
|
507
|
+
file: ({ ref }) => ref(invoice),
|
|
508
|
+
indexes: [1, '3-5'],
|
|
509
|
+
},
|
|
510
|
+
})
|
|
511
|
+
|
|
512
|
+
const cropAgain = crop({
|
|
513
|
+
name: 'Crop prior result',
|
|
514
|
+
input: {
|
|
515
|
+
file: ({ ref, paths }) => ref(selectedPages, paths(selectedPages)[0].file),
|
|
516
|
+
indexes: [2],
|
|
517
|
+
},
|
|
518
|
+
})
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
The result is a typed array whose items contain `indexes`, `originalFile`, and `file`. Compile validates file compatibility before lowering input and previous-node refs to Workflow V3 URIs; direct Vault refs lower to the cropper's transport-file shape. Source evaluation and offline compilation do not contact Vault or invoke prior nodes.
|
|
522
|
+
|
|
523
|
+
### `vault.asset(path, options?)`
|
|
524
|
+
|
|
525
|
+
```ts
|
|
526
|
+
const vault: {
|
|
527
|
+
asset: (
|
|
528
|
+
path: string,
|
|
529
|
+
options?: { name?: string, mimeType?: string },
|
|
530
|
+
) => WorkflowCodeVaultAsset
|
|
531
|
+
}
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
Creates an inert declaration for a local file that should be available to `splitter()` or `crop()`. Source evaluation and offline compile do not read the file, upload it, or require credentials. `sync` resolves the path relative to `workflow-code.config.ts`, rejects paths outside that project directory, hashes the content, and uploads it before the first workflow lifecycle mutation. A matching content hash in the active context lock reuses the existing Vault ref.
|
|
535
|
+
|
|
536
|
+
```ts
|
|
537
|
+
const localInvoice = vault.asset('./fixtures/invoice.pdf', {
|
|
538
|
+
name: 'invoice.pdf',
|
|
539
|
+
mimeType: 'application/pdf',
|
|
540
|
+
})
|
|
541
|
+
|
|
542
|
+
const selectedPages = crop({
|
|
543
|
+
name: 'Crop local invoice',
|
|
544
|
+
input: {
|
|
545
|
+
file: localInvoice,
|
|
546
|
+
indexes: [1, '3-5'],
|
|
547
|
+
},
|
|
548
|
+
})
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
`path`, `name`, and `mimeType` must be non-empty strings when present. Offline compile without a matching explicit asset snapshot reports `vault.asset.missing_lock`; it never falls back to reading the local file. If the file changes, the next `sync` uploads the new content and updates the lock.
|
|
552
|
+
|
|
474
553
|
### `vault.ref(reference)`
|
|
475
554
|
|
|
476
555
|
```ts
|
|
@@ -494,7 +573,7 @@ const existingPages = splitter({
|
|
|
494
573
|
})
|
|
495
574
|
```
|
|
496
575
|
|
|
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.
|
|
576
|
+
During compile, a direct Vault ref used by `splitter.input.file` or `crop.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
577
|
|
|
499
578
|
### `agent(remoteRef, options)`
|
|
500
579
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"slug": "api-reference",
|
|
15
15
|
"title": "API Reference",
|
|
16
16
|
"file": "api-reference.md",
|
|
17
|
-
"sha256": "
|
|
17
|
+
"sha256": "fc121fd8c0e83e4f39ecef45b50d4fc9b0bc64888bd10d0590b3ca168af0a42d"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"slug": "cli",
|