instrux 0.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.
- package/README.md +279 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +186 -0
- package/dist/cli.js.map +1 -0
- package/dist/compiler.d.ts +35 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +218 -0
- package/dist/compiler.js.map +1 -0
- package/dist/engine.d.ts +39 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +229 -0
- package/dist/engine.js.map +1 -0
- package/dist/frontmatter.d.ts +26 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +122 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +34 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +254 -0
- package/dist/init.js.map +1 -0
- package/dist/types.d.ts +104 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWH,4CA8CC;AAKD,0CAOC;AAMD,4CAKC;AAMD,oDAIC;AAxFD,6CAA+B;AAC/B,2CAA6B;AAC7B,8DAAiC;AACjC,0DAA2B;AAG3B;;GAEG;AACI,KAAK,UAAU,gBAAgB,CACpC,OAAe,EACf,cAAwB;IAExB,oCAAoC;IACpC,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAE,EAAC,cAAc,EAAE;QACvC,GAAG,EAAE,OAAO;QACZ,SAAS,EAAE,IAAI;QACf,GAAG,EAAE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AAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,KAAmB;IACjD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC;QAClC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC;QAClC,IAAI,EAAE,KAAK,EAAE;YAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC9B,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAC9B,WAAgC;IAEhC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,WAAW,CAAC;IACzC,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,IAAyB;IAC5D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,OAAO,qBAAM,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;AACvD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* instrux — public API
|
|
3
|
+
*
|
|
4
|
+
* Exports the engine, compiler, and types for programmatic use.
|
|
5
|
+
*/
|
|
6
|
+
export { InstruxEngine } from './engine';
|
|
7
|
+
export { InstruxCompiler } from './compiler';
|
|
8
|
+
export type { CompileResult } from './compiler';
|
|
9
|
+
export { initAgent, initTemplateAgent } from './init';
|
|
10
|
+
export { buildSourceIndex, sortSourceFiles, stripInstruxMeta, serializeFrontmatter } from './frontmatter';
|
|
11
|
+
export type { AgentConfig, InstruxFile, MergeSettings, ValidationResult, BuildResult, FrontmatterOutput, InstruxMeta, SourceFile, SourceIndex, } from './types';
|
|
12
|
+
export { DEFAULT_MERGE_SETTINGS } from './types';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1G,YAAY,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* instrux — public API
|
|
4
|
+
*
|
|
5
|
+
* Exports the engine, compiler, and types for programmatic use.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.DEFAULT_MERGE_SETTINGS = exports.serializeFrontmatter = exports.stripInstruxMeta = exports.sortSourceFiles = exports.buildSourceIndex = exports.initTemplateAgent = exports.initAgent = exports.InstruxCompiler = exports.InstruxEngine = void 0;
|
|
9
|
+
var engine_1 = require("./engine");
|
|
10
|
+
Object.defineProperty(exports, "InstruxEngine", { enumerable: true, get: function () { return engine_1.InstruxEngine; } });
|
|
11
|
+
var compiler_1 = require("./compiler");
|
|
12
|
+
Object.defineProperty(exports, "InstruxCompiler", { enumerable: true, get: function () { return compiler_1.InstruxCompiler; } });
|
|
13
|
+
var init_1 = require("./init");
|
|
14
|
+
Object.defineProperty(exports, "initAgent", { enumerable: true, get: function () { return init_1.initAgent; } });
|
|
15
|
+
Object.defineProperty(exports, "initTemplateAgent", { enumerable: true, get: function () { return init_1.initTemplateAgent; } });
|
|
16
|
+
var frontmatter_1 = require("./frontmatter");
|
|
17
|
+
Object.defineProperty(exports, "buildSourceIndex", { enumerable: true, get: function () { return frontmatter_1.buildSourceIndex; } });
|
|
18
|
+
Object.defineProperty(exports, "sortSourceFiles", { enumerable: true, get: function () { return frontmatter_1.sortSourceFiles; } });
|
|
19
|
+
Object.defineProperty(exports, "stripInstruxMeta", { enumerable: true, get: function () { return frontmatter_1.stripInstruxMeta; } });
|
|
20
|
+
Object.defineProperty(exports, "serializeFrontmatter", { enumerable: true, get: function () { return frontmatter_1.serializeFrontmatter; } });
|
|
21
|
+
var types_1 = require("./types");
|
|
22
|
+
Object.defineProperty(exports, "DEFAULT_MERGE_SETTINGS", { enumerable: true, get: function () { return types_1.DEFAULT_MERGE_SETTINGS; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,mCAAyC;AAAhC,uGAAA,aAAa,OAAA;AACtB,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AAExB,+BAAsD;AAA7C,iGAAA,SAAS,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AACrC,6CAA0G;AAAjG,+GAAA,gBAAgB,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAYlF,iCAAiD;AAAxC,+GAAA,sBAAsB,OAAA"}
|
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* instrux init — scaffold a new agent project or add an agent to an existing one.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create the directory structure and starter files for a new agent.
|
|
6
|
+
*
|
|
7
|
+
* Resulting layout (relative to `rootDir`):
|
|
8
|
+
*
|
|
9
|
+
* agents/
|
|
10
|
+
* base/
|
|
11
|
+
* instructions.md ← shared base instructions
|
|
12
|
+
* <agentName>/
|
|
13
|
+
* agent.json ← agent configuration
|
|
14
|
+
* specialization.md ← agent-specific content
|
|
15
|
+
* out/ ← default output directory
|
|
16
|
+
*/
|
|
17
|
+
export declare function initAgent(rootDir: string, agentName: string): Promise<string[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Scaffold a template-based agent with frontmatter tagging and Handlebars.
|
|
20
|
+
*
|
|
21
|
+
* Resulting layout:
|
|
22
|
+
*
|
|
23
|
+
* agents/
|
|
24
|
+
* base/
|
|
25
|
+
* identity.md ← tagged: [identity]
|
|
26
|
+
* safety.md ← tagged: [safety]
|
|
27
|
+
* <agentName>/
|
|
28
|
+
* agent.json ← config with entry + sources
|
|
29
|
+
* template.md ← Handlebars entry template
|
|
30
|
+
* domain.md ← tagged: [domain]
|
|
31
|
+
* out/
|
|
32
|
+
*/
|
|
33
|
+
export declare function initTemplateAgent(rootDir: string, agentName: string): Promise<string[]>;
|
|
34
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;;;;;;;;;;;GAYG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,EAAE,CAAC,CAqEnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,EAAE,CAAC,CAwJnB"}
|
package/dist/init.js
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* instrux init — scaffold a new agent project or add an agent to an existing one.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.initAgent = initAgent;
|
|
40
|
+
exports.initTemplateAgent = initTemplateAgent;
|
|
41
|
+
const fs = __importStar(require("fs-extra"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const types_1 = require("./types");
|
|
44
|
+
/**
|
|
45
|
+
* Create the directory structure and starter files for a new agent.
|
|
46
|
+
*
|
|
47
|
+
* Resulting layout (relative to `rootDir`):
|
|
48
|
+
*
|
|
49
|
+
* agents/
|
|
50
|
+
* base/
|
|
51
|
+
* instructions.md ← shared base instructions
|
|
52
|
+
* <agentName>/
|
|
53
|
+
* agent.json ← agent configuration
|
|
54
|
+
* specialization.md ← agent-specific content
|
|
55
|
+
* out/ ← default output directory
|
|
56
|
+
*/
|
|
57
|
+
async function initAgent(rootDir, agentName) {
|
|
58
|
+
const created = [];
|
|
59
|
+
const agentDir = path.join(rootDir, 'agents', agentName);
|
|
60
|
+
const baseDir = path.join(rootDir, 'agents', 'base');
|
|
61
|
+
const outDir = path.join(rootDir, 'out');
|
|
62
|
+
// ── agents/base/instructions.md ───────────────────────
|
|
63
|
+
const baseInstructions = path.join(baseDir, 'instructions.md');
|
|
64
|
+
if (!(await fs.pathExists(baseInstructions))) {
|
|
65
|
+
await fs.ensureDir(baseDir);
|
|
66
|
+
await fs.writeFile(baseInstructions, `# Base Instructions\n\nShared instructions that apply to all agents.\nAdd common behavioral guidelines, tone, and constraints here.\n`, 'utf-8');
|
|
67
|
+
created.push(path.relative(rootDir, baseInstructions));
|
|
68
|
+
}
|
|
69
|
+
// ── agents/<name>/agent.json ──────────────────────────
|
|
70
|
+
if (await fs.pathExists(agentDir)) {
|
|
71
|
+
throw new Error(`Agent "${agentName}" already exists at ${path.relative(rootDir, agentDir)}`);
|
|
72
|
+
}
|
|
73
|
+
await fs.ensureDir(agentDir);
|
|
74
|
+
const config = {
|
|
75
|
+
name: agentName,
|
|
76
|
+
description: `Instructions for the ${agentName} agent`,
|
|
77
|
+
outputDirectory: 'out',
|
|
78
|
+
outputFilePattern: `${agentName.toLowerCase()}_instructions.md`,
|
|
79
|
+
files: [
|
|
80
|
+
{
|
|
81
|
+
path: 'agents/base/instructions.md',
|
|
82
|
+
description: 'Shared base instructions',
|
|
83
|
+
required: true,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
path: `agents/${agentName}/specialization.md`,
|
|
87
|
+
description: `${agentName}-specific knowledge and instructions`,
|
|
88
|
+
required: true,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
mergeSettings: { ...types_1.DEFAULT_MERGE_SETTINGS },
|
|
92
|
+
};
|
|
93
|
+
const configPath = path.join(agentDir, 'agent.json');
|
|
94
|
+
await fs.writeFile(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
95
|
+
created.push(path.relative(rootDir, configPath));
|
|
96
|
+
// ── agents/<name>/specialization.md ───────────────────
|
|
97
|
+
const specPath = path.join(agentDir, 'specialization.md');
|
|
98
|
+
await fs.writeFile(specPath, `# ${agentName} — Specialization\n\n` +
|
|
99
|
+
`## Capabilities\n\n` +
|
|
100
|
+
`- Describe this agent's unique capabilities here\n\n` +
|
|
101
|
+
`## Domain Knowledge\n\n` +
|
|
102
|
+
`Add domain-specific reference material, terminology, or protocols.\n`, 'utf-8');
|
|
103
|
+
created.push(path.relative(rootDir, specPath));
|
|
104
|
+
// ── out/ directory ────────────────────────────────────
|
|
105
|
+
if (!(await fs.pathExists(outDir))) {
|
|
106
|
+
await fs.ensureDir(outDir);
|
|
107
|
+
created.push('out/');
|
|
108
|
+
}
|
|
109
|
+
return created;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Scaffold a template-based agent with frontmatter tagging and Handlebars.
|
|
113
|
+
*
|
|
114
|
+
* Resulting layout:
|
|
115
|
+
*
|
|
116
|
+
* agents/
|
|
117
|
+
* base/
|
|
118
|
+
* identity.md ← tagged: [identity]
|
|
119
|
+
* safety.md ← tagged: [safety]
|
|
120
|
+
* <agentName>/
|
|
121
|
+
* agent.json ← config with entry + sources
|
|
122
|
+
* template.md ← Handlebars entry template
|
|
123
|
+
* domain.md ← tagged: [domain]
|
|
124
|
+
* out/
|
|
125
|
+
*/
|
|
126
|
+
async function initTemplateAgent(rootDir, agentName) {
|
|
127
|
+
const created = [];
|
|
128
|
+
const agentDir = path.join(rootDir, 'agents', agentName);
|
|
129
|
+
const baseDir = path.join(rootDir, 'agents', 'base');
|
|
130
|
+
const outDir = path.join(rootDir, 'out');
|
|
131
|
+
// ── agents/base/identity.md ───────────────────────────
|
|
132
|
+
const identityPath = path.join(baseDir, 'identity.md');
|
|
133
|
+
if (!(await fs.pathExists(identityPath))) {
|
|
134
|
+
await fs.ensureDir(baseDir);
|
|
135
|
+
await fs.writeFile(identityPath, [
|
|
136
|
+
'---',
|
|
137
|
+
'title: Core Identity',
|
|
138
|
+
'instrux:',
|
|
139
|
+
' tags: [identity]',
|
|
140
|
+
' order: 1',
|
|
141
|
+
'---',
|
|
142
|
+
'',
|
|
143
|
+
'# Core Identity',
|
|
144
|
+
'',
|
|
145
|
+
'You are a helpful AI assistant.',
|
|
146
|
+
'Define your core behavioral guidelines here.',
|
|
147
|
+
'',
|
|
148
|
+
].join('\n'), 'utf-8');
|
|
149
|
+
created.push(path.relative(rootDir, identityPath));
|
|
150
|
+
}
|
|
151
|
+
// ── agents/base/safety.md ─────────────────────────────
|
|
152
|
+
const safetyPath = path.join(baseDir, 'safety.md');
|
|
153
|
+
if (!(await fs.pathExists(safetyPath))) {
|
|
154
|
+
await fs.writeFile(safetyPath, [
|
|
155
|
+
'---',
|
|
156
|
+
'title: Safety Guidelines',
|
|
157
|
+
'instrux:',
|
|
158
|
+
' tags: [safety]',
|
|
159
|
+
' order: 2',
|
|
160
|
+
'---',
|
|
161
|
+
'',
|
|
162
|
+
'# Safety Guidelines',
|
|
163
|
+
'',
|
|
164
|
+
'- Always provide accurate information',
|
|
165
|
+
'- Decline harmful requests',
|
|
166
|
+
'- Protect user privacy',
|
|
167
|
+
'',
|
|
168
|
+
].join('\n'), 'utf-8');
|
|
169
|
+
created.push(path.relative(rootDir, safetyPath));
|
|
170
|
+
}
|
|
171
|
+
// ── agents/<name>/ ────────────────────────────────────
|
|
172
|
+
if (await fs.pathExists(agentDir)) {
|
|
173
|
+
throw new Error(`Agent "${agentName}" already exists at ${path.relative(rootDir, agentDir)}`);
|
|
174
|
+
}
|
|
175
|
+
await fs.ensureDir(agentDir);
|
|
176
|
+
// ── agent.json (template mode) ────────────────────────
|
|
177
|
+
const config = {
|
|
178
|
+
name: agentName,
|
|
179
|
+
description: `Compiled instructions for the ${agentName} agent`,
|
|
180
|
+
outputDirectory: 'out',
|
|
181
|
+
outputFilePattern: `${agentName.toLowerCase()}_instructions.md`,
|
|
182
|
+
entry: `agents/${agentName}/template.md`,
|
|
183
|
+
sources: [
|
|
184
|
+
'agents/base/**/*.md',
|
|
185
|
+
`agents/${agentName}/**/*.md`,
|
|
186
|
+
],
|
|
187
|
+
frontmatter: { output: 'strip' },
|
|
188
|
+
mergeSettings: { ...types_1.DEFAULT_MERGE_SETTINGS },
|
|
189
|
+
};
|
|
190
|
+
const configPath = path.join(agentDir, 'agent.json');
|
|
191
|
+
await fs.writeFile(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
192
|
+
created.push(path.relative(rootDir, configPath));
|
|
193
|
+
// ── template.md (Handlebars entry point) ──────────────
|
|
194
|
+
const templatePath = path.join(agentDir, 'template.md');
|
|
195
|
+
await fs.writeFile(templatePath, [
|
|
196
|
+
'---',
|
|
197
|
+
`title: ${agentName} System Prompt`,
|
|
198
|
+
'instrux:',
|
|
199
|
+
' tags: [template]',
|
|
200
|
+
'---',
|
|
201
|
+
'',
|
|
202
|
+
'{{!-- Core sections pulled in by tag --}}',
|
|
203
|
+
'',
|
|
204
|
+
'{{{tag "identity"}}}',
|
|
205
|
+
'',
|
|
206
|
+
'---',
|
|
207
|
+
'',
|
|
208
|
+
'{{{tag "safety"}}}',
|
|
209
|
+
'',
|
|
210
|
+
'---',
|
|
211
|
+
'',
|
|
212
|
+
'{{{tag "domain"}}}',
|
|
213
|
+
'',
|
|
214
|
+
'{{!-- You can also iterate over tagged files:',
|
|
215
|
+
'',
|
|
216
|
+
'{{#each (tagged "knowledge")}}',
|
|
217
|
+
'### {{this.title}}',
|
|
218
|
+
'{{{this.body}}}',
|
|
219
|
+
'{{/each}}',
|
|
220
|
+
'',
|
|
221
|
+
'--}}',
|
|
222
|
+
'',
|
|
223
|
+
].join('\n'), 'utf-8');
|
|
224
|
+
created.push(path.relative(rootDir, templatePath));
|
|
225
|
+
// ── domain.md (agent-specific content) ────────────────
|
|
226
|
+
const domainPath = path.join(agentDir, 'domain.md');
|
|
227
|
+
await fs.writeFile(domainPath, [
|
|
228
|
+
'---',
|
|
229
|
+
`title: ${agentName} Domain Knowledge`,
|
|
230
|
+
'instrux:',
|
|
231
|
+
' tags: [domain]',
|
|
232
|
+
' order: 1',
|
|
233
|
+
'---',
|
|
234
|
+
'',
|
|
235
|
+
`# ${agentName} — Domain Knowledge`,
|
|
236
|
+
'',
|
|
237
|
+
'## Capabilities',
|
|
238
|
+
'',
|
|
239
|
+
'- Describe this agent\'s unique capabilities here',
|
|
240
|
+
'',
|
|
241
|
+
'## Reference Material',
|
|
242
|
+
'',
|
|
243
|
+
'Add domain-specific terminology, protocols, or schemas.',
|
|
244
|
+
'',
|
|
245
|
+
].join('\n'), 'utf-8');
|
|
246
|
+
created.push(path.relative(rootDir, domainPath));
|
|
247
|
+
// ── out/ directory ────────────────────────────────────
|
|
248
|
+
if (!(await fs.pathExists(outDir))) {
|
|
249
|
+
await fs.ensureDir(outDir);
|
|
250
|
+
created.push('out/');
|
|
251
|
+
}
|
|
252
|
+
return created;
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=init.js.map
|
package/dist/init.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBH,8BAwEC;AAiBD,8CA2JC;AArQD,6CAA+B;AAC/B,2CAA6B;AAC7B,mCAA8D;AAE9D;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,SAAS,CAC7B,OAAe,EACf,SAAiB;IAEjB,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAEzC,yDAAyD;IACzD,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC/D,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC;QAC7C,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5B,MAAM,EAAE,CAAC,SAAS,CAChB,gBAAgB,EAChB,uIAAuI,EACvI,OAAO,CACR,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,yDAAyD;IACzD,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,UAAU,SAAS,uBA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AAE;QACF,mDAAmD;QACnD,EAAE;QACF,uBAAuB;QACvB,EAAE;QACF,yDAAyD;QACzD,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ,OAAO,CACR,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAEjD,yDAAyD;IACzD,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACnC,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* instrux - Configuration and type definitions
|
|
3
|
+
*/
|
|
4
|
+
export interface InstruxFile {
|
|
5
|
+
/** Relative path to the instruction file */
|
|
6
|
+
path: string;
|
|
7
|
+
/** Human-readable description of this file's purpose */
|
|
8
|
+
description: string;
|
|
9
|
+
/** Whether this file must exist for a build to succeed */
|
|
10
|
+
required: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface MergeSettings {
|
|
13
|
+
/** Add visual separators between merged files */
|
|
14
|
+
addSeparators: boolean;
|
|
15
|
+
/** Separator string (e.g., "---") */
|
|
16
|
+
separatorStyle: string;
|
|
17
|
+
/** Include HTML comments showing source file info */
|
|
18
|
+
includeFileHeaders: boolean;
|
|
19
|
+
/** Preserve original whitespace and formatting */
|
|
20
|
+
preserveFormatting: boolean;
|
|
21
|
+
/** Append a content hash to the output filename */
|
|
22
|
+
generateHash: boolean;
|
|
23
|
+
/** Append a timestamp to the output filename */
|
|
24
|
+
useTimestamp: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface AgentConfig {
|
|
27
|
+
/** Display name of the agent */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Description of the agent's purpose */
|
|
30
|
+
description: string;
|
|
31
|
+
/** Output directory for the merged file (relative to project root) */
|
|
32
|
+
outputDirectory: string;
|
|
33
|
+
/** Output filename pattern — supports {timestamp} placeholder */
|
|
34
|
+
outputFilePattern: string;
|
|
35
|
+
/** Ordered list of instruction files to merge (simple mode) */
|
|
36
|
+
files?: InstruxFile[];
|
|
37
|
+
/**
|
|
38
|
+
* Entry template file that drives compilation.
|
|
39
|
+
* When set, instrux uses Handlebars + frontmatter tags instead of simple merge.
|
|
40
|
+
*/
|
|
41
|
+
entry?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Glob patterns for source files to scan for frontmatter tags.
|
|
44
|
+
* Example: ["agents/base/*.md", "agents/MyAgent/*.md"]
|
|
45
|
+
*/
|
|
46
|
+
sources?: string[];
|
|
47
|
+
/** Controls how frontmatter is handled in the compiled output */
|
|
48
|
+
frontmatter?: FrontmatterOutput;
|
|
49
|
+
/** Controls how files are merged together */
|
|
50
|
+
mergeSettings: MergeSettings;
|
|
51
|
+
}
|
|
52
|
+
export interface ValidationResult {
|
|
53
|
+
valid: boolean;
|
|
54
|
+
missing: string[];
|
|
55
|
+
warnings: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface BuildResult {
|
|
58
|
+
outputPath: string;
|
|
59
|
+
contentLength: number;
|
|
60
|
+
contentHash: string;
|
|
61
|
+
filesIncluded: number;
|
|
62
|
+
filesSkipped: number;
|
|
63
|
+
}
|
|
64
|
+
export interface FrontmatterOutput {
|
|
65
|
+
/**
|
|
66
|
+
* How to handle frontmatter in the final output:
|
|
67
|
+
* - "strip": Remove all frontmatter (default)
|
|
68
|
+
* - "preserve": Keep non-instrux frontmatter from the entry file
|
|
69
|
+
*/
|
|
70
|
+
output: 'strip' | 'preserve';
|
|
71
|
+
}
|
|
72
|
+
/** instrux-specific metadata nested under `instrux:` in frontmatter */
|
|
73
|
+
export interface InstruxMeta {
|
|
74
|
+
/** Tags used to reference this file from templates */
|
|
75
|
+
tags?: string[];
|
|
76
|
+
/** Sort order when multiple files share a tag (lower = first) */
|
|
77
|
+
order?: number;
|
|
78
|
+
/** Description (used in {{#each (tagged ...)}} iteration) */
|
|
79
|
+
description?: string;
|
|
80
|
+
[key: string]: any;
|
|
81
|
+
}
|
|
82
|
+
/** A parsed source file with separated frontmatter and content */
|
|
83
|
+
export interface SourceFile {
|
|
84
|
+
/** Relative path from project root (forward slashes) */
|
|
85
|
+
path: string;
|
|
86
|
+
/** Full parsed YAML frontmatter */
|
|
87
|
+
frontmatter: Record<string, any>;
|
|
88
|
+
/** instrux-specific metadata extracted from frontmatter.instrux */
|
|
89
|
+
instrux: InstruxMeta;
|
|
90
|
+
/** Markdown body content (without frontmatter) */
|
|
91
|
+
content: string;
|
|
92
|
+
}
|
|
93
|
+
/** Tag-indexed collection of source files */
|
|
94
|
+
export interface SourceIndex {
|
|
95
|
+
/** All scanned source files */
|
|
96
|
+
files: SourceFile[];
|
|
97
|
+
/** tag → SourceFile[] lookup */
|
|
98
|
+
tags: Map<string, SourceFile[]>;
|
|
99
|
+
/** normalised path → SourceFile lookup */
|
|
100
|
+
paths: Map<string, SourceFile>;
|
|
101
|
+
}
|
|
102
|
+
/** Default merge settings used by `instrux init` */
|
|
103
|
+
export declare const DEFAULT_MERGE_SETTINGS: MergeSettings;
|
|
104
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,aAAa,EAAE,OAAO,CAAC;IACvB,qCAAqC;IACrC,cAAc,EAA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ACf,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,kEAAkE;AAClE,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,mEAAmE;IACnE,OAAO,EAAE,WAAW,CAAC;IACrB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,6CAA6C;AAC7C,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,gCAAgC;IAChC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAChC,0CAA0C;IAC1C,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAChC;AAID,oDAAoD;AACpD,eAAO,MAAM,sBAAsB,EAAE,aAOpC,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* instrux - Configuration and type definitions
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DEFAULT_MERGE_SETTINGS = void 0;
|
|
7
|
+
// ── Defaults ─────────────────────────────────────────────
|
|
8
|
+
/** Default merge settings used by `instrux init` */
|
|
9
|
+
exports.DEFAULT_MERGE_SETTINGS = {
|
|
10
|
+
addSeparators: true,
|
|
11
|
+
separatorStyle: '---',
|
|
12
|
+
includeFileHeaders: false,
|
|
13
|
+
preserveFormatting: true,
|
|
14
|
+
generateHash: false,
|
|
15
|
+
useTimestamp: false,
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAwHH,4DAA4D;AAE5D,oDAAoD;AACvC,QAAA,sBAAsB,GAAkB;IACnD,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,KAAK;IACrB,kBAAkB,EAAE,KAAK;IACzB,kBAAkB,EAAE,IAAI;IACxB,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,KAAK;CACpB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "instrux",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A CLI tool for composing modular AI agent instruction files into complete system prompts",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/tsharp/instrux.git"
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/tsharp/instrux/issues"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/tsharp/instrux#readme",
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"bin": {
|
|
15
|
+
"instrux": "./dist/cli.js"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"dev": "ts-node src/cli.ts",
|
|
20
|
+
"watch": "tsc --watch",
|
|
21
|
+
"prepublishOnly": "npm run build",
|
|
22
|
+
"test": "echo \"No tests yet\" && exit 0",
|
|
23
|
+
"publish:script": "pwsh -File publish.ps1"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"ai",
|
|
27
|
+
"agent",
|
|
28
|
+
"instructions",
|
|
29
|
+
"system-prompt",
|
|
30
|
+
"prompt-engineering",
|
|
31
|
+
"llm",
|
|
32
|
+
"merge",
|
|
33
|
+
"compose",
|
|
34
|
+
"cli"
|
|
35
|
+
],
|
|
36
|
+
"author": "",
|
|
37
|
+
"license": "(MIT OR Apache-2.0)",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"templates",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/fs-extra": "^11.0.0",
|
|
48
|
+
"@types/node": "^20.0.0",
|
|
49
|
+
"typescript": "^5.0.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"commander": "^12.0.0",
|
|
53
|
+
"fast-glob": "^3.3.0",
|
|
54
|
+
"fs-extra": "^11.0.0",
|
|
55
|
+
"gray-matter": "^4.0.3",
|
|
56
|
+
"handlebars": "^4.7.8"
|
|
57
|
+
}
|
|
58
|
+
}
|