create-nola-lang 0.1.0-alpha.0 → 0.1.2
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 +201 -21
- package/dist/add.d.ts +18 -0
- package/dist/add.d.ts.map +1 -0
- package/dist/add.js +69 -0
- package/dist/add.js.map +1 -0
- package/dist/agents.d.ts +23 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +121 -0
- package/dist/agents.js.map +1 -0
- package/dist/chunk-QTJ64H2Y.js +629 -0
- package/dist/chunk-TRTQSARU.js +34 -0
- package/dist/examples.d.ts +17 -0
- package/dist/examples.d.ts.map +1 -0
- package/dist/examples.js +67 -0
- package/dist/examples.js.map +1 -0
- package/dist/flow.d.ts +64 -0
- package/dist/flow.d.ts.map +1 -0
- package/dist/flow.js +261 -0
- package/dist/flow.js.map +1 -0
- package/dist/github.d.ts +15 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +43 -0
- package/dist/github.js.map +1 -0
- package/dist/ide.d.ts +9 -0
- package/dist/ide.d.ts.map +1 -0
- package/dist/ide.js +57 -0
- package/dist/ide.js.map +1 -0
- package/dist/index.d.ts +17 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -47
- package/dist/index.js.map +1 -1
- package/dist/main.js +28 -15
- package/dist/main.js.map +1 -1
- package/dist/prompter-6BJFVFZL.js +1297 -0
- package/dist/prompter.d.ts +4 -0
- package/dist/prompter.d.ts.map +1 -0
- package/dist/prompter.js +34 -0
- package/dist/prompter.js.map +1 -0
- package/dist/registry.d.ts +16 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +16 -0
- package/dist/registry.js.map +1 -0
- package/dist/scaffold.d.ts +19 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +80 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/skill-install.d.ts +14 -0
- package/dist/skill-install.d.ts.map +1 -0
- package/dist/skill-install.js +47 -0
- package/dist/skill-install.js.map +1 -0
- package/package.json +10 -2
- package/templates/empty/nola.config.ts +12 -0
- package/templates/empty/src/main.ts +3 -0
- package/templates/{tsconfig.json → empty/tsconfig.json} +1 -1
- package/templates/starter/_gitignore +2 -0
- package/templates/{nola.replay.jsonl → starter/nola.replay.jsonl} +1 -1
- package/templates/starter/package.json +22 -0
- package/templates/{src → starter/src}/person.tsi +1 -1
- package/templates/starter/tsconfig.json +12 -0
- /package/templates/{_gitignore → empty/_gitignore} +0 -0
- /package/templates/{package.json → empty/package.json} +0 -0
- /package/templates/{README.md → starter/README.md} +0 -0
- /package/templates/{nola.config.ts → starter/nola.config.ts} +0 -0
- /package/templates/{src → starter/src}/main.ts +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and 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 choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Evgen Mykhailenko
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/add.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AddResult {
|
|
2
|
+
/** files written, e.g. ["nola.config.ts", "package.json"] */
|
|
3
|
+
wrote: string[];
|
|
4
|
+
/** deps added, as "name@range" */
|
|
5
|
+
added: string[];
|
|
6
|
+
/** human-readable notes about what was left untouched */
|
|
7
|
+
skipped: string[];
|
|
8
|
+
/** true when nothing needed doing */
|
|
9
|
+
alreadySetUp: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Retrofit an existing npm project: write nola.config.ts (unless present) and
|
|
13
|
+
* additively merge the required packages. Never rewrites existing entries.
|
|
14
|
+
*/
|
|
15
|
+
export declare function addNola(targetDir: string, opts?: {
|
|
16
|
+
version?: string;
|
|
17
|
+
}): Promise<AddResult>;
|
|
18
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../src/add.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,kCAAkC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qCAAqC;IACrC,YAAY,EAAE,OAAO,CAAC;CACvB;AAaD;;;GAGG;AACH,wBAAsB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAqDpG"}
|
package/dist/add.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { ownVersion } from "./scaffold.js";
|
|
5
|
+
/** The retrofit config is the empty template's — a retrofit has no replay ledger. */
|
|
6
|
+
const EMPTY_CONFIG_URL = new URL("../templates/empty/nola.config.ts", import.meta.url);
|
|
7
|
+
/** null range = "^<lockstep version>"; typescript is NOT lockstep, it keeps the template pin. */
|
|
8
|
+
const REQUIRED = [
|
|
9
|
+
["dependencies", "@nola-lang/runtime", null],
|
|
10
|
+
["dependencies", "@nola-lang/providers", null],
|
|
11
|
+
["devDependencies", "nola-lang", null],
|
|
12
|
+
["devDependencies", "typescript", "^5.6.0"],
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Retrofit an existing npm project: write nola.config.ts (unless present) and
|
|
16
|
+
* additively merge the required packages. Never rewrites existing entries.
|
|
17
|
+
*/
|
|
18
|
+
export async function addNola(targetDir, opts = {}) {
|
|
19
|
+
const absRoot = resolve(targetDir);
|
|
20
|
+
const manifestPath = join(absRoot, "package.json");
|
|
21
|
+
if (!existsSync(manifestPath)) {
|
|
22
|
+
throw new Error(`no package.json in ${absRoot} — run without --add to scaffold a new project`);
|
|
23
|
+
}
|
|
24
|
+
let pkg;
|
|
25
|
+
try {
|
|
26
|
+
pkg = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
throw new Error(`could not parse ${manifestPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
30
|
+
}
|
|
31
|
+
const wrote = [];
|
|
32
|
+
const added = [];
|
|
33
|
+
const skipped = [];
|
|
34
|
+
const lockstep = `^${opts.version ?? (await ownVersion())}`;
|
|
35
|
+
const existingRange = (name) => {
|
|
36
|
+
for (const section of ["dependencies", "devDependencies"]) {
|
|
37
|
+
const deps = pkg[section];
|
|
38
|
+
if (deps && name in deps)
|
|
39
|
+
return deps[name];
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
};
|
|
43
|
+
const configPath = join(absRoot, "nola.config.ts");
|
|
44
|
+
if (existsSync(configPath)) {
|
|
45
|
+
skipped.push("nola.config.ts already exists — left untouched");
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
await writeFile(configPath, await readFile(EMPTY_CONFIG_URL, "utf8"));
|
|
49
|
+
wrote.push("nola.config.ts");
|
|
50
|
+
}
|
|
51
|
+
for (const [section, name, fixedRange] of REQUIRED) {
|
|
52
|
+
const existing = existingRange(name);
|
|
53
|
+
if (existing !== undefined) {
|
|
54
|
+
skipped.push(`${name} already present (${existing}) — left untouched`);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const range = fixedRange ?? lockstep;
|
|
58
|
+
const deps = pkg[section] ?? {};
|
|
59
|
+
pkg[section] = deps;
|
|
60
|
+
deps[name] = range;
|
|
61
|
+
added.push(`${name}@${range}`);
|
|
62
|
+
}
|
|
63
|
+
if (added.length > 0) {
|
|
64
|
+
await writeFile(manifestPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
65
|
+
wrote.push("package.json");
|
|
66
|
+
}
|
|
67
|
+
return { wrote, added, skipped, alreadySetUp: wrote.length === 0 && added.length === 0 };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=add.js.map
|
package/dist/add.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../src/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAa3C,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEvF,iGAAiG;AACjG,MAAM,QAAQ,GAA2E;IACvF,CAAC,cAAc,EAAE,oBAAoB,EAAE,IAAI,CAAC;IAC5C,CAAC,cAAc,EAAE,sBAAsB,EAAE,IAAI,CAAC;IAC9C,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,CAAC;IACtC,CAAC,iBAAiB,EAAE,YAAY,EAAE,QAAQ,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC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,EAAE,CAAC;AAC3F,CAAC"}
|
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type AgentId = "claude" | "cursor" | "copilot" | "agents-md";
|
|
2
|
+
export declare const AGENT_IDS: readonly AgentId[];
|
|
3
|
+
/** Shared option list for every "Set up coding agents?" multiselect. */
|
|
4
|
+
export declare const AGENT_OPTIONS: {
|
|
5
|
+
value: AgentId;
|
|
6
|
+
label: string;
|
|
7
|
+
hint: string;
|
|
8
|
+
}[];
|
|
9
|
+
/** Agents whose tooling is already present in the project. */
|
|
10
|
+
export declare function detectAgents(targetDir: string): AgentId[];
|
|
11
|
+
/** The interactive preselection: detected agents + the cross-agent baseline. */
|
|
12
|
+
export declare function defaultAgents(targetDir: string): AgentId[];
|
|
13
|
+
/** "all" | "none" | comma list of ids; unknown ids throw listing valid values. */
|
|
14
|
+
export declare function parseAgentsFlag(value: string): AgentId[];
|
|
15
|
+
export interface AgentSetupResult {
|
|
16
|
+
/** project-relative posix paths written */
|
|
17
|
+
wrote: string[];
|
|
18
|
+
/** human-readable notes about files left untouched */
|
|
19
|
+
skipped: string[];
|
|
20
|
+
}
|
|
21
|
+
/** Write the selected adapters; never rewrites an existing file. */
|
|
22
|
+
export declare function writeAgentSkills(targetDir: string, agents: AgentId[]): Promise<AgentSetupResult>;
|
|
23
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpE,eAAO,MAAM,SAAS,EAAE,SAAS,OAAO,EAAiD,CAAC;AAE1F,wEAAwE;AACxE,eAAO,MAAM,aAAa,EAAE;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAK1E,CAAC;AAkEF,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAOzD;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAE1D;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAUxD;AAED,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,oEAAoE;AACpE,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsBtG"}
|
package/dist/agents.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
export const AGENT_IDS = ["claude", "cursor", "copilot", "agents-md"];
|
|
5
|
+
/** Shared option list for every "Set up coding agents?" multiselect. */
|
|
6
|
+
export const AGENT_OPTIONS = [
|
|
7
|
+
{ value: "agents-md", label: "AGENTS.md", hint: "cross-agent pointer file (Codex, Gemini CLI, …)" },
|
|
8
|
+
{ value: "claude", label: "Claude Code", hint: ".claude/skills/nola/SKILL.md" },
|
|
9
|
+
{ value: "cursor", label: "Cursor", hint: ".cursor/rules/nola.mdc" },
|
|
10
|
+
{ value: "copilot", label: "GitHub Copilot", hint: ".github/instructions/nola.instructions.md" },
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Adapters are POINTERS into the installed package, never copies — the
|
|
14
|
+
* content an agent reads then always version-matches the installed compiler
|
|
15
|
+
* (spec 2026-08-14-agent-skill-distribution-design.md §1).
|
|
16
|
+
*/
|
|
17
|
+
const POINTER_BODY = `Read \`node_modules/nola-lang/skills/nola/SKILL.md\` and the files under
|
|
18
|
+
\`node_modules/nola-lang/skills/nola/references/\` before writing or editing
|
|
19
|
+
\`.tsi\` files. If that path is missing, run \`npm install\` first.
|
|
20
|
+
`;
|
|
21
|
+
/**
|
|
22
|
+
* Clause-free variant of POINTER_BODY: just the paths + the npm-install
|
|
23
|
+
* fallback. For adapters whose own lead-in sentence already states the
|
|
24
|
+
* "before writing or editing .tsi files" clause, so it isn't said twice.
|
|
25
|
+
*/
|
|
26
|
+
const POINTER_PATHS = `\`node_modules/nola-lang/skills/nola/SKILL.md\` and the files under
|
|
27
|
+
\`node_modules/nola-lang/skills/nola/references/\`. If that path is missing, run
|
|
28
|
+
\`npm install\` first.
|
|
29
|
+
`;
|
|
30
|
+
const CLAUDE_SKILL = `---
|
|
31
|
+
name: nola
|
|
32
|
+
description: Writing Nola .tsi files — a TypeScript superset with infer
|
|
33
|
+
functions and ask extractors. Use when creating or editing .tsi files or
|
|
34
|
+
nola.config.ts.
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
This project uses Nola. Before writing or editing \`.tsi\` files, read the
|
|
38
|
+
version-matched skill content installed with the language:
|
|
39
|
+
${POINTER_PATHS}`;
|
|
40
|
+
const AGENTS_SECTION = `## Nola
|
|
41
|
+
|
|
42
|
+
This project uses Nola (\`.tsi\` files — a TypeScript superset; not valid
|
|
43
|
+
TS). Before writing or editing \`.tsi\` files or \`nola.config.ts\`, read the
|
|
44
|
+
version-matched skill content installed with the language:
|
|
45
|
+
|
|
46
|
+
${POINTER_PATHS}`;
|
|
47
|
+
const AGENTS_MD = `# AGENTS.md
|
|
48
|
+
|
|
49
|
+
${AGENTS_SECTION}`;
|
|
50
|
+
const CURSOR_RULE = `---
|
|
51
|
+
description: Nola (.tsi) language rules
|
|
52
|
+
globs: ["**/*.tsi", "nola.config.ts"]
|
|
53
|
+
alwaysApply: false
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
${POINTER_BODY}`;
|
|
57
|
+
const COPILOT_INSTRUCTIONS = `---
|
|
58
|
+
applyTo: "**/*.tsi"
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
${POINTER_BODY}`;
|
|
62
|
+
const ADAPTERS = {
|
|
63
|
+
claude: { path: ".claude/skills/nola/SKILL.md", content: CLAUDE_SKILL },
|
|
64
|
+
cursor: { path: ".cursor/rules/nola.mdc", content: CURSOR_RULE },
|
|
65
|
+
copilot: { path: ".github/instructions/nola.instructions.md", content: COPILOT_INSTRUCTIONS },
|
|
66
|
+
"agents-md": { path: "AGENTS.md", content: AGENTS_MD },
|
|
67
|
+
};
|
|
68
|
+
/** Agents whose tooling is already present in the project. */
|
|
69
|
+
export function detectAgents(targetDir) {
|
|
70
|
+
const root = resolve(targetDir);
|
|
71
|
+
const found = [];
|
|
72
|
+
if (existsSync(join(root, ".claude")) || existsSync(join(root, "CLAUDE.md")))
|
|
73
|
+
found.push("claude");
|
|
74
|
+
if (existsSync(join(root, ".cursor")))
|
|
75
|
+
found.push("cursor");
|
|
76
|
+
if (existsSync(join(root, ".github")))
|
|
77
|
+
found.push("copilot");
|
|
78
|
+
return found;
|
|
79
|
+
}
|
|
80
|
+
/** The interactive preselection: detected agents + the cross-agent baseline. */
|
|
81
|
+
export function defaultAgents(targetDir) {
|
|
82
|
+
return [...detectAgents(targetDir), "agents-md"];
|
|
83
|
+
}
|
|
84
|
+
/** "all" | "none" | comma list of ids; unknown ids throw listing valid values. */
|
|
85
|
+
export function parseAgentsFlag(value) {
|
|
86
|
+
if (value === "all")
|
|
87
|
+
return [...AGENT_IDS];
|
|
88
|
+
if (value === "none")
|
|
89
|
+
return [];
|
|
90
|
+
const ids = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
91
|
+
for (const id of ids) {
|
|
92
|
+
if (!AGENT_IDS.includes(id)) {
|
|
93
|
+
throw new Error(`invalid --agents "${value}" (valid: ${AGENT_IDS.join(", ")} — or all, none)`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return [...new Set(ids)];
|
|
97
|
+
}
|
|
98
|
+
/** Write the selected adapters; never rewrites an existing file. */
|
|
99
|
+
export async function writeAgentSkills(targetDir, agents) {
|
|
100
|
+
const root = resolve(targetDir);
|
|
101
|
+
const wrote = [];
|
|
102
|
+
const skipped = [];
|
|
103
|
+
for (const id of AGENT_IDS) {
|
|
104
|
+
if (!agents.includes(id))
|
|
105
|
+
continue;
|
|
106
|
+
const { path, content } = ADAPTERS[id];
|
|
107
|
+
const abs = join(root, ...path.split("/"));
|
|
108
|
+
if (existsSync(abs)) {
|
|
109
|
+
// AGENTS.md commonly pre-exists; hand the section over for manual paste.
|
|
110
|
+
skipped.push(id === "agents-md"
|
|
111
|
+
? `AGENTS.md already exists — left untouched. Add this section manually:\n\n${AGENTS_SECTION}`
|
|
112
|
+
: `${path} already exists — left untouched`);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
await mkdir(dirname(abs), { recursive: true });
|
|
116
|
+
await writeFile(abs, content);
|
|
117
|
+
wrote.push(path);
|
|
118
|
+
}
|
|
119
|
+
return { wrote, skipped };
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAInD,MAAM,CAAC,MAAM,SAAS,GAAuB,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAE1F,wEAAwE;AACxE,MAAM,CAAC,MAAM,aAAa,GAAsD;IAC9E,EAAE,KAAK,EAAE,WAAW,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