@younndai/lyt-runner 0.9.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.
- package/LICENSE +200 -0
- package/NOTICE +23 -0
- package/README.md +110 -0
- package/dist/expander/automator-to-agent.d.ts +4 -0
- package/dist/expander/automator-to-agent.d.ts.map +1 -0
- package/dist/expander/automator-to-agent.js +129 -0
- package/dist/expander/automator-to-agent.js.map +1 -0
- package/dist/expander/index.d.ts +17 -0
- package/dist/expander/index.d.ts.map +1 -0
- package/dist/expander/index.js +62 -0
- package/dist/expander/index.js.map +1 -0
- package/dist/expander/parse-record.d.ts +10 -0
- package/dist/expander/parse-record.d.ts.map +1 -0
- package/dist/expander/parse-record.js +162 -0
- package/dist/expander/parse-record.js.map +1 -0
- package/dist/expander/types.d.ts +39 -0
- package/dist/expander/types.d.ts.map +1 -0
- package/dist/expander/types.js +17 -0
- package/dist/expander/types.js.map +1 -0
- package/dist/hooks/frontmatter.d.ts +10 -0
- package/dist/hooks/frontmatter.d.ts.map +1 -0
- package/dist/hooks/frontmatter.js +90 -0
- package/dist/hooks/frontmatter.js.map +1 -0
- package/dist/hooks/stamp-on-write.d.ts +43 -0
- package/dist/hooks/stamp-on-write.d.ts.map +1 -0
- package/dist/hooks/stamp-on-write.js +289 -0
- package/dist/hooks/stamp-on-write.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/ops/index.d.ts +24 -0
- package/dist/ops/index.d.ts.map +1 -0
- package/dist/ops/index.js +56 -0
- package/dist/ops/index.js.map +1 -0
- package/dist/ops/leases.d.ts +28 -0
- package/dist/ops/leases.d.ts.map +1 -0
- package/dist/ops/leases.js +93 -0
- package/dist/ops/leases.js.map +1 -0
- package/dist/ops/llm.d.ts +28 -0
- package/dist/ops/llm.d.ts.map +1 -0
- package/dist/ops/llm.js +132 -0
- package/dist/ops/llm.js.map +1 -0
- package/dist/ops/mesh.d.ts +11 -0
- package/dist/ops/mesh.d.ts.map +1 -0
- package/dist/ops/mesh.js +35 -0
- package/dist/ops/mesh.js.map +1 -0
- package/dist/ops/vault.d.ts +26 -0
- package/dist/ops/vault.d.ts.map +1 -0
- package/dist/ops/vault.js +153 -0
- package/dist/ops/vault.js.map +1 -0
- package/dist/protocol/five-step.d.ts +22 -0
- package/dist/protocol/five-step.d.ts.map +1 -0
- package/dist/protocol/five-step.js +312 -0
- package/dist/protocol/five-step.js.map +1 -0
- package/dist/protocol/run-context.d.ts +35 -0
- package/dist/protocol/run-context.d.ts.map +1 -0
- package/dist/protocol/run-context.js +56 -0
- package/dist/protocol/run-context.js.map +1 -0
- package/dist/runtime.d.ts +18 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +28 -0
- package/dist/runtime.js.map +1 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may accept and charge a
|
|
167
|
+
fee for, or grant additional liability obligations and/or rights
|
|
168
|
+
consistent with this License. However, in accepting such obligations,
|
|
169
|
+
You may act only on Your own behalf and on Your sole responsibility,
|
|
170
|
+
not on behalf of any other Contributor, and only if You agree to
|
|
171
|
+
indemnify, defend, and hold each Contributor harmless for any
|
|
172
|
+
liability incurred by, or claims asserted against, such Contributor
|
|
173
|
+
by reason of your accepting any such warranty or additional liability.
|
|
174
|
+
|
|
175
|
+
END OF TERMS AND CONDITIONS
|
|
176
|
+
|
|
177
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
178
|
+
|
|
179
|
+
To apply the Apache License to your work, attach the following
|
|
180
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
181
|
+
replaced with your own identifying information. (Don't include
|
|
182
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
183
|
+
comment syntax for the file format. We also recommend that a
|
|
184
|
+
file or class name and description of purpose be included on the
|
|
185
|
+
same "printed page" as the copyright notice for easier
|
|
186
|
+
identification within third-party archives.
|
|
187
|
+
|
|
188
|
+
Copyright 2026 MARLINK TRADING SRL (YounndAI)
|
|
189
|
+
|
|
190
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
191
|
+
you may not use this file except in compliance with the License.
|
|
192
|
+
You may obtain a copy of the License at
|
|
193
|
+
|
|
194
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
195
|
+
|
|
196
|
+
Unless required by applicable law or agreed to in writing, software
|
|
197
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
198
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
199
|
+
See the License for the specific language governing permissions and
|
|
200
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@younndai/lyt-runner
|
|
2
|
+
Copyright 2026 MARLINK TRADING SRL (YounndAI)
|
|
3
|
+
|
|
4
|
+
This product includes software developed by MARLINK TRADING SRL (YounndAI)
|
|
5
|
+
(https://younndai.com).
|
|
6
|
+
|
|
7
|
+
Created by: Alexandru Mareș (https://allemaar.com)
|
|
8
|
+
|
|
9
|
+
Licensed under the Apache License, Version 2.0. See LICENSE.
|
|
10
|
+
|
|
11
|
+
----------------------------------------------------------------------
|
|
12
|
+
Trademark notice
|
|
13
|
+
----------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
YounndAI™ and LYT™ are trademarks of MARLINK TRADING SRL.
|
|
16
|
+
|
|
17
|
+
The Apache License, Version 2.0 does not grant permission to use the
|
|
18
|
+
trade names, trademarks, service marks, or product names of
|
|
19
|
+
MARLINK TRADING SRL, except as required for describing the origin of
|
|
20
|
+
this work and reproducing the content of this NOTICE file.
|
|
21
|
+
|
|
22
|
+
See TRADEMARK.md for the trademark usage policy.
|
|
23
|
+
For trademark usage permissions, contact: office@younndai.com
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/YounndAI/lyt/main/assets/lyt-icon-ondark.png" />
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/YounndAI/lyt/main/assets/lyt-icon-onlight.png" />
|
|
5
|
+
<img alt="Lyt" src="https://raw.githubusercontent.com/YounndAI/lyt/main/assets/lyt-icon-onlight.png" width="80" />
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>@younndai/lyt-runner</strong><br />
|
|
11
|
+
The YON automation runner — declarative automators and directives that operate your vaults, deterministically.<br />
|
|
12
|
+
<em>Part of the Lyt™ toolchain — federated markdown vaults you own, made legible to AI.</em>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://linkyourthink.com">Website</a> · <a href="https://github.com/YounndAI/lyt">Repository</a> · <a href="./LICENSE">Apache 2.0</a> · <a href="https://github.com/YounndAI/lyt/blob/main/TRADEMARK.md">Trademark Policy</a> · <a href="https://github.com/YounndAI/lyt/blob/main/CONTRIBUTING.md">Contributing</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
[](https://www.npmjs.com/package/@younndai/lyt-runner)
|
|
20
|
+
[](./LICENSE)
|
|
21
|
+
[](https://github.com/YounndAI/lyt#status)
|
|
22
|
+
|
|
23
|
+
> ⚠️ **Public alpha — under active testing.** Lyt works and we use it daily, but surfaces change between releases and docs are still growing. Install only via the `alpha` dist-tag. Your vaults are plain markdown in plain git repos — your data is never locked in, and Lyt never phones home.
|
|
24
|
+
|
|
25
|
+
## What is this?
|
|
26
|
+
|
|
27
|
+
`@younndai/lyt-runner` is the **automation runner** of [Lyt™](https://github.com/YounndAI/lyt) — the engine that executes declarative [YON](https://yon.younndai.com) automations over your markdown vaults. An **automator** is a YON document living inside a vault (`.lyt/automators/*.yon`) that declares *what should happen* — fill missing metadata, build lanes, run a sync flow — and this package turns that declaration into governed, deterministic execution.
|
|
28
|
+
|
|
29
|
+
It is a thin, focused layer on [`@younndai/yon-runner`](https://www.npmjs.com/package/@younndai/yon-runner): it loads the **yai.lyt expander**, which transforms `@AUTOMATOR` + `@DIRECTIVE` records into core YON (`@AGENT` + `@STEP` + ops) before execution, and registers the vault-aware operation set — `std:vault.*`, `std:mesh.*`, and `std:lease.*` ops — so automations can read, write, and sync vaults under the same permission semantics as every other Lyt surface. Because automations are YON documents in the vault, they are versioned with your knowledge, reviewable in any diff, and legible to AI agents — an agent can read, propose, or refine an automator the same way it reads a note.
|
|
30
|
+
|
|
31
|
+
You usually do not install this package directly — install [`@younndai/lyt`](https://www.npmjs.com/package/@younndai/lyt); the runner is wired in transitively.
|
|
32
|
+
|
|
33
|
+
## Install (standalone)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g @younndai/lyt-runner@alpha
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## How it fits
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
.lyt/automators/metadata-filler.yon # the declaration (lives in YOUR vault, in git)
|
|
43
|
+
│
|
|
44
|
+
▼
|
|
45
|
+
yai.lyt expander # @AUTOMATOR + @DIRECTIVE → core YON (@AGENT/@STEP/ops)
|
|
46
|
+
│
|
|
47
|
+
▼
|
|
48
|
+
@younndai/yon-runner # deterministic execution engine
|
|
49
|
+
│
|
|
50
|
+
▼
|
|
51
|
+
std:vault.* · std:mesh.* · std:lease.* ops # governed vault operations (+ std:llm.* via lyt-llm)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Every new vault ships with default automators (for example a metadata filler), and the run history is recorded per vault — auditable, replayable, no hidden side effects.
|
|
55
|
+
|
|
56
|
+
## Key features
|
|
57
|
+
|
|
58
|
+
- **Declarative, in-vault automation** — automators are YON files in your vault: versioned in git, reviewed in diffs, owned by you.
|
|
59
|
+
- **Deterministic execution** — declarations expand to explicit steps and ops; no opaque "AI did something" runs.
|
|
60
|
+
- **Governed operations** — vault/mesh writes from an automation pass the same writability gates as human and agent writes.
|
|
61
|
+
- **LLM steps when you want them** — pairs with [`@younndai/lyt-llm`](https://www.npmjs.com/package/@younndai/lyt-llm) to register `std:llm.*` ops with per-run cost budgets.
|
|
62
|
+
|
|
63
|
+
## Programmatic use
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { run } from "@younndai/lyt-runner";
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## The Lyt toolchain
|
|
70
|
+
|
|
71
|
+
| Package | Role |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| [`@younndai/lyt`](https://github.com/YounndAI/lyt/tree/main/packages/lyt) | The unified `lyt` CLI (meta package) |
|
|
74
|
+
| [`@younndai/lyt-vault`](https://github.com/YounndAI/lyt/tree/main/packages/lyt-vault) | The vault primitive |
|
|
75
|
+
| [`@younndai/lyt-mesh`](https://github.com/YounndAI/lyt/tree/main/packages/lyt-mesh) | The mesh layer — multi-vault operations |
|
|
76
|
+
| [`@younndai/lyt-skills`](https://github.com/YounndAI/lyt/tree/main/packages/lyt-skills) | Agent-harness skills (Claude Code, Codex, agents) |
|
|
77
|
+
| [`@younndai/lyt-mcp`](https://github.com/YounndAI/lyt/tree/main/packages/lyt-mcp) | The MCP server |
|
|
78
|
+
| [`@younndai/lyt-runner`](https://github.com/YounndAI/lyt/tree/main/packages/lyt-runner) | **This package** — the YON automation runner |
|
|
79
|
+
| [`@younndai/lyt-llm`](https://github.com/YounndAI/lyt/tree/main/packages/lyt-llm) | The LLM gateway |
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## About YounndAI
|
|
84
|
+
|
|
85
|
+
**YounndAI™ — You and AI, unified.** (pronounced *"yoon-dye"*)
|
|
86
|
+
|
|
87
|
+
A philosophy of intelligence: building with intention, so humans and machines
|
|
88
|
+
think together without losing what makes either whole.
|
|
89
|
+
|
|
90
|
+
## License & Attribution
|
|
91
|
+
|
|
92
|
+
Apache-2.0. © 2026 MARLINK TRADING SRL (YounndAI). See [`LICENSE`](./LICENSE) and [`NOTICE`](./NOTICE).
|
|
93
|
+
|
|
94
|
+
"LYT", "Lyt", and "YounndAI" are trademarks of MARLINK TRADING SRL — see [`TRADEMARK.md`](https://github.com/YounndAI/lyt/blob/main/TRADEMARK.md).
|
|
95
|
+
|
|
96
|
+
Created by [Alexandru Mareș](https://allemaar.com).
|
|
97
|
+
|
|
98
|
+
Website: [linkyourthink.com](https://linkyourthink.com)
|
|
99
|
+
|
|
100
|
+
<p align="center"><em>Structure before scale. Harmony above all.</em></p>
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
| | |
|
|
105
|
+
| ------------- | ------------------------------------------------------- |
|
|
106
|
+
| **Project** | [Lyt — Link Your Think](https://linkyourthink.com) |
|
|
107
|
+
| **Author** | [Alexandru Mareș](https://allemaar.com) |
|
|
108
|
+
| **Company** | [MARLINK TRADING SRL](https://younndai.com) · YounndAI™ |
|
|
109
|
+
| **License** | [Apache 2.0](./LICENSE) — © 2026 MARLINK TRADING SRL |
|
|
110
|
+
| **Trademark** | [YounndAI™ Trademark Guidelines](https://github.com/YounndAI/lyt/blob/main/TRADEMARK.md) |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automator-to-agent.d.ts","sourceRoot":"","sources":["../../src/expander/automator-to-agent.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkBlD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,eAAe,GAAG,SAAS,EAAE,CAqD/E"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 MARLINK TRADING SRL (YounndAI)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
// Builds an @AGENT YonRecord from a parsed AutomatorRecord. The output
|
|
17
|
+
// mirrors yai.lyt-domain L358-368 @AGENT shape:
|
|
18
|
+
//
|
|
19
|
+
// @AGENT rid=agent:lyt-memcycle | name="lyt-memcycle" | type=ai
|
|
20
|
+
// | caps=[std:data.*,std:fs.read,lyt:db.write]
|
|
21
|
+
// | streams=[stream:lyt-cmd,stream:lyt-events]
|
|
22
|
+
//
|
|
23
|
+
// Caps are derived from the automator's reads_scope ∪ writes_scope ∪
|
|
24
|
+
// external_calls — those declare what surfaces the automator must touch,
|
|
25
|
+
// which maps directly onto yon-runner's permission system (the caps list
|
|
26
|
+
// becomes the runner's allowlist patterns).
|
|
27
|
+
//
|
|
28
|
+
// The original @AUTOMATOR record's archetype/source/version/runtime/scope
|
|
29
|
+
// fields are preserved as adjacent @META records on the agent (yai-domain
|
|
30
|
+
// L222-271 @META pattern). This keeps the agent inspectable without losing
|
|
31
|
+
// information across the transform.
|
|
32
|
+
export function automatorToAgentRecords(automator) {
|
|
33
|
+
// Convention: @AUTOMATOR's rid is `automator:<name>`; @AGENT's rid is
|
|
34
|
+
// `agent:<name>`. The convention is captured in yai-domain L177 (@AUTOMATOR
|
|
35
|
+
// rid convention) and L358 (@AGENT rid convention from the example).
|
|
36
|
+
const agentRid = automator.rid.startsWith("automator:")
|
|
37
|
+
? `agent:${automator.rid.slice("automator:".length)}`
|
|
38
|
+
: `agent:${automator.name}`;
|
|
39
|
+
const caps = collectCaps(automator);
|
|
40
|
+
const agentFields = new Map();
|
|
41
|
+
agentFields.set("rid", agentRid);
|
|
42
|
+
agentFields.set("name", automator.name);
|
|
43
|
+
agentFields.set("type", automator.runtime === "deterministic" ? "deterministic" : "ai");
|
|
44
|
+
if (caps.length > 0) {
|
|
45
|
+
agentFields.set("caps", {
|
|
46
|
+
kind: "reference-tokens",
|
|
47
|
+
items: caps,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// Typed-fields mirror — typeHint preserved for round-trip per parser §3.1.7.
|
|
51
|
+
// Per parse-record.ts, we read fields via the simplified `fields` map; for
|
|
52
|
+
// emission we keep typedFields aligned so a future round-trip caller can
|
|
53
|
+
// reproduce the original surface.
|
|
54
|
+
const agentTypedFields = new Map();
|
|
55
|
+
for (const [key, value] of agentFields) {
|
|
56
|
+
agentTypedFields.set(key, { key, value });
|
|
57
|
+
}
|
|
58
|
+
const agent = {
|
|
59
|
+
tag: "AGENT",
|
|
60
|
+
fields: agentFields,
|
|
61
|
+
typedFields: agentTypedFields,
|
|
62
|
+
line: 0,
|
|
63
|
+
column: 0,
|
|
64
|
+
};
|
|
65
|
+
const metaRecords = [
|
|
66
|
+
metaRecord("automator_archetype", automator.archetype),
|
|
67
|
+
metaRecord("automator_source", automator.source),
|
|
68
|
+
metaRecord("automator_version", automator.version),
|
|
69
|
+
metaRecord("automator_runtime", automator.runtime),
|
|
70
|
+
metaRecord("automator_scope", automator.scope),
|
|
71
|
+
metaRecord("automator_transaction_mode", automator.transaction_mode),
|
|
72
|
+
metaRecord("description", automator.description),
|
|
73
|
+
];
|
|
74
|
+
if (automator.signed_by !== undefined) {
|
|
75
|
+
metaRecords.push(metaRecord("signed_by", automator.signed_by));
|
|
76
|
+
}
|
|
77
|
+
return [agent, ...metaRecords];
|
|
78
|
+
}
|
|
79
|
+
function metaRecord(key, value) {
|
|
80
|
+
const fields = new Map([
|
|
81
|
+
["key", key],
|
|
82
|
+
["value", value],
|
|
83
|
+
]);
|
|
84
|
+
const typedFields = new Map();
|
|
85
|
+
typedFields.set("key", { key: "key", value: key });
|
|
86
|
+
typedFields.set("value", { key: "value", value });
|
|
87
|
+
return {
|
|
88
|
+
tag: "META",
|
|
89
|
+
fields,
|
|
90
|
+
typedFields,
|
|
91
|
+
line: 0,
|
|
92
|
+
column: 0,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function collectCaps(automator) {
|
|
96
|
+
const caps = new Set();
|
|
97
|
+
// Permission-shape caps from reads/writes scope.
|
|
98
|
+
for (const s of automator.reads_scope ?? []) {
|
|
99
|
+
if (s === "vault") {
|
|
100
|
+
caps.add("std:fs.read");
|
|
101
|
+
caps.add("std:fs.list");
|
|
102
|
+
}
|
|
103
|
+
else if (s === "external:git") {
|
|
104
|
+
caps.add("std:exec");
|
|
105
|
+
}
|
|
106
|
+
else if (s.startsWith("child-vault") || s === "child-vaults") {
|
|
107
|
+
caps.add("lyt:mesh.pull");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
for (const s of automator.writes_scope ?? []) {
|
|
111
|
+
if (s === "vault") {
|
|
112
|
+
caps.add("std:fs.write");
|
|
113
|
+
caps.add("lyt:vault.write");
|
|
114
|
+
}
|
|
115
|
+
else if (s === "libsql" || s === "registry") {
|
|
116
|
+
caps.add("lyt:db.write");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// External-calls verbatim — these are pre-qualified op patterns.
|
|
120
|
+
for (const c of automator.external_calls ?? []) {
|
|
121
|
+
caps.add(c);
|
|
122
|
+
}
|
|
123
|
+
// LLM capability — if the automator declares any, advertise std:llm.* caps.
|
|
124
|
+
if (automator.llm_capability !== undefined && automator.llm_capability !== "none") {
|
|
125
|
+
caps.add("std:llm.generate");
|
|
126
|
+
}
|
|
127
|
+
return Array.from(caps).sort();
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=automator-to-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automator-to-agent.js","sourceRoot":"","sources":["../../src/expander/automator-to-agent.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { YonDocument } from "@younndai/yon-parser";
|
|
2
|
+
export { ExpanderError } from "./parse-record.js";
|
|
3
|
+
export { parseAutomator, parseDirective } from "./parse-record.js";
|
|
4
|
+
export { automatorToAgentRecords } from "./automator-to-agent.js";
|
|
5
|
+
export type { AutomatorRecord, DirectiveRecord, AutomatorArchetype, AutomatorRuntime, AutomatorScope, AutomatorSource, AutomatorTransactionMode, } from "./types.js";
|
|
6
|
+
export interface ExpandOptions {
|
|
7
|
+
emitSteps?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ExpandResult {
|
|
10
|
+
document: YonDocument;
|
|
11
|
+
automatorsExpanded: number;
|
|
12
|
+
directivesPreserved: number;
|
|
13
|
+
recordsIn: number;
|
|
14
|
+
recordsOut: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function lytExpand(doc: YonDocument, _opts?: ExpandOptions): ExpandResult;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expander/index.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,sBAAsB,CAAC;AAKnE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EACV,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,aAAa;IAI5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,WAAW,CAAC;IAItB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAUD,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,GAAE,aAAkB,GAAG,YAAY,CAiCnF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 MARLINK TRADING SRL (YounndAI)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { parseAutomator, parseDirective } from "./parse-record.js";
|
|
17
|
+
import { automatorToAgentRecords } from "./automator-to-agent.js";
|
|
18
|
+
export { ExpanderError } from "./parse-record.js";
|
|
19
|
+
export { parseAutomator, parseDirective } from "./parse-record.js";
|
|
20
|
+
export { automatorToAgentRecords } from "./automator-to-agent.js";
|
|
21
|
+
// Expand a parsed YON document: replace each @AUTOMATOR record with the
|
|
22
|
+
// @AGENT + @META projection (yai.lyt-domain L168-191 → yai-domain L352-368),
|
|
23
|
+
// preserve @DIRECTIVE records unchanged (Commit 4 may transform them to
|
|
24
|
+
// @TENET refs), pass every other tag through unchanged.
|
|
25
|
+
//
|
|
26
|
+
// The input document is not mutated — a new document object is returned with
|
|
27
|
+
// a fresh `records` array. `nodes` and `blocks` carry through unchanged
|
|
28
|
+
// (Commit 4 lands the node-stream awareness when @STEP emission requires it).
|
|
29
|
+
export function lytExpand(doc, _opts = {}) {
|
|
30
|
+
let automatorsExpanded = 0;
|
|
31
|
+
let directivesPreserved = 0;
|
|
32
|
+
const outRecords = [];
|
|
33
|
+
for (const record of doc.records) {
|
|
34
|
+
if (record.tag === "AUTOMATOR") {
|
|
35
|
+
const parsed = parseAutomator(record);
|
|
36
|
+
const emitted = automatorToAgentRecords(parsed);
|
|
37
|
+
outRecords.push(...emitted);
|
|
38
|
+
automatorsExpanded++;
|
|
39
|
+
}
|
|
40
|
+
else if (record.tag === "DIRECTIVE") {
|
|
41
|
+
// Validate but pass through. Commit 4 may convert to @TENET ref form.
|
|
42
|
+
parseDirective(record);
|
|
43
|
+
outRecords.push(record);
|
|
44
|
+
directivesPreserved++;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
outRecords.push(record);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const expanded = {
|
|
51
|
+
...doc,
|
|
52
|
+
records: outRecords,
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
document: expanded,
|
|
56
|
+
automatorsExpanded,
|
|
57
|
+
directivesPreserved,
|
|
58
|
+
recordsIn: doc.records.length,
|
|
59
|
+
recordsOut: outRecords.length,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expander/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AA6BlE,wEAAwE;AACxE,6EAA6E;AAC7E,wEAAwE;AACxE,wDAAwD;AACxD,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,8EAA8E;AAC9E,MAAM,UAAU,SAAS,CAAC,GAAgB,EAAE,QAAuB,EAAE;IACnE,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAC5B,MAAM,UAAU,GAAgB,EAAE,CAAC;IAEnC,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;QACjC,IAAI,MAAM,CAAC,GAAG,KAAK,WAAW,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;YACtC,MAAM,OAAO,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;YAChD,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;YAC5B,kBAAkB,EAAE,CAAC;QACvB,CAAC;aAAM,IAAI,MAAM,CAAC,GAAG,KAAK,WAAW,EAAE,CAAC;YACtC,sEAAsE;YACtE,cAAc,CAAC,MAAM,CAAC,CAAC;YACvB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxB,mBAAmB,EAAE,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAgB;QAC5B,GAAG,GAAG;QACN,OAAO,EAAE,UAAU;KACpB,CAAC;IAEF,OAAO;QACL,QAAQ,EAAE,QAAQ;QAClB,kBAAkB;QAClB,mBAAmB;QACnB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM;QAC7B,UAAU,EAAE,UAAU,CAAC,MAAM;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { YonRecord } from "@younndai/yon-parser";
|
|
2
|
+
import type { AutomatorRecord, DirectiveRecord } from "./types.js";
|
|
3
|
+
export declare class ExpanderError extends Error {
|
|
4
|
+
readonly tag: string;
|
|
5
|
+
readonly line: number;
|
|
6
|
+
constructor(message: string, tag: string, line: number);
|
|
7
|
+
}
|
|
8
|
+
export declare function parseAutomator(record: YonRecord): AutomatorRecord;
|
|
9
|
+
export declare function parseDirective(record: YonRecord): DirectiveRecord;
|
|
10
|
+
//# sourceMappingURL=parse-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-record.d.ts","sourceRoot":"","sources":["../../src/expander/parse-record.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EACV,eAAe,EAMf,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,aAAc,SAAQ,KAAK;aAGpB,GAAG,EAAE,MAAM;aACX,IAAI,EAAE,MAAM;gBAF5B,OAAO,EAAE,MAAM,EACC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM;CAK/B;AAgED,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CAuEjE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CAsBjE"}
|