@felan-ai/ext-output-style 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE +6 -0
- package/README.md +29 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Felan contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @felan-ai/ext-output-style
|
|
2
|
+
|
|
3
|
+
Portable output-style instructions for Felan sessions.
|
|
4
|
+
|
|
5
|
+
The extension appends one clearly bounded `## Output Style` section to the
|
|
6
|
+
system prompt before each model run. It accepts only the built-in `concise` and
|
|
7
|
+
`explanatory` styles; arbitrary prompt text and file-backed styles are not
|
|
8
|
+
supported. `concise` is the default.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { createOutputStyleExtension } from '@felan-ai/ext-output-style';
|
|
12
|
+
|
|
13
|
+
const extension = createOutputStyleExtension('explanatory');
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The Felan TUI validates its global `outputStyle` setting and binds the selected
|
|
17
|
+
style to this extension for root and child sessions.
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
Source: `packages/ext-output-style` in <https://github.com/felan-ai/felan>.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
corepack enable
|
|
25
|
+
pnpm install --frozen-lockfile
|
|
26
|
+
pnpm --filter @felan-ai/ext-output-style build
|
|
27
|
+
pnpm --filter @felan-ai/ext-output-style type-check
|
|
28
|
+
pnpm --filter @felan-ai/ext-output-style test
|
|
29
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FelanExtension } from '@felan-ai/agent-core';
|
|
2
|
+
export declare const OUTPUT_STYLES: readonly ["concise", "explanatory"];
|
|
3
|
+
export type OutputStyle = typeof OUTPUT_STYLES[number];
|
|
4
|
+
export declare const DEFAULT_OUTPUT_STYLE: OutputStyle;
|
|
5
|
+
export declare function parseOutputStyle(value?: unknown): OutputStyle;
|
|
6
|
+
export declare function formatOutputStyleSection(style: OutputStyle): string;
|
|
7
|
+
export declare function createOutputStyleExtension(value?: unknown): FelanExtension;
|
|
8
|
+
declare const outputStyleExtension: FelanExtension;
|
|
9
|
+
export default outputStyleExtension;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,aAAa,qCAAsC,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,oBAAoB,EAAE,WAAuB,CAAC;AAkB3D,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,OAA8B,GAAG,WAAW,CAKnF;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAQnE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,GAAE,OAA8B,GAAG,cAAc,CAShG;AAED,QAAA,MAAM,oBAAoB,gBAA+B,CAAC;AAE1D,eAAe,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const OUTPUT_STYLES = ['concise', 'explanatory'];
|
|
2
|
+
export const DEFAULT_OUTPUT_STYLE = 'concise';
|
|
3
|
+
const OUTPUT_STYLE_START = '<output_style>';
|
|
4
|
+
const OUTPUT_STYLE_END = '</output_style>';
|
|
5
|
+
const STYLE_INSTRUCTIONS = {
|
|
6
|
+
concise: [
|
|
7
|
+
'Keep responses concise and direct. Lead with the outcome or next action.',
|
|
8
|
+
'Use headings and bullets only when they make the response easier to scan.',
|
|
9
|
+
'Do not omit necessary caveats, verification results, or blockers for brevity.',
|
|
10
|
+
],
|
|
11
|
+
explanatory: [
|
|
12
|
+
'Explain the reasoning and important tradeoffs behind recommendations and changes.',
|
|
13
|
+
'Provide enough context for the user to understand how the result works and how to verify it.',
|
|
14
|
+
'Keep explanations relevant to the request and avoid repeating the same point.',
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
export function parseOutputStyle(value = DEFAULT_OUTPUT_STYLE) {
|
|
18
|
+
if (typeof value === 'string' && OUTPUT_STYLES.includes(value)) {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
throw new Error(`outputStyle must be one of: ${OUTPUT_STYLES.join(', ')}`);
|
|
22
|
+
}
|
|
23
|
+
export function formatOutputStyleSection(style) {
|
|
24
|
+
return [
|
|
25
|
+
'## Output Style',
|
|
26
|
+
'',
|
|
27
|
+
OUTPUT_STYLE_START,
|
|
28
|
+
...STYLE_INSTRUCTIONS[style].map((instruction) => `- ${instruction}`),
|
|
29
|
+
OUTPUT_STYLE_END,
|
|
30
|
+
].join('\n');
|
|
31
|
+
}
|
|
32
|
+
export function createOutputStyleExtension(value = DEFAULT_OUTPUT_STYLE) {
|
|
33
|
+
const style = parseOutputStyle(value);
|
|
34
|
+
const section = formatOutputStyleSection(style);
|
|
35
|
+
return (pi) => {
|
|
36
|
+
pi.on('before_agent_start', (event) => {
|
|
37
|
+
return { systemPrompt: `${event.systemPrompt}\n\n${section}` };
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const outputStyleExtension = createOutputStyleExtension();
|
|
42
|
+
export default outputStyleExtension;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,aAAa,CAAU,CAAC;AAGjE,MAAM,CAAC,MAAM,oBAAoB,GAAgB,SAAS,CAAC;AAE3D,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAC5C,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C,MAAM,kBAAkB,GAAqD;IAC3E,OAAO,EAAE;QACP,0EAA0E;QAC1E,2EAA2E;QAC3E,+EAA+E;KAChF;IACD,WAAW,EAAE;QACX,mFAAmF;QACnF,8FAA8F;QAC9F,+EAA+E;KAChF;CACF,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAAC,QAAiB,oBAAoB;IACpE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAoB,CAAC,EAAE,CAAC;QAC9E,OAAO,KAAoB,CAAC;IAC9B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,+BAA+B,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAkB;IACzD,OAAO;QACL,iBAAiB;QACjB,EAAE;QACF,kBAAkB;QAClB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,KAAK,WAAW,EAAE,CAAC;QACrE,gBAAgB;KACjB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAAiB,oBAAoB;IAC9E,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAEhD,OAAO,CAAC,EAAE,EAAE,EAAE;QACZ,EAAE,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;YACpC,OAAO,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,OAAO,OAAO,EAAE,EAAE,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAC;AAE1D,eAAe,oBAAoB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@felan-ai/ext-output-style",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Portable output-style system prompt extension for Felan",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/felan-ai/felan.git",
|
|
10
|
+
"directory": "packages/ext-output-style"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=22.19.0"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"NOTICE",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@felan-ai/agent-core": "^0.4.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@felan-ai/agent-core": "0.4.9"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"provenance": true
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
39
|
+
"type-check": "tsc -p tsconfig.json --noEmit",
|
|
40
|
+
"test": "vitest run"
|
|
41
|
+
}
|
|
42
|
+
}
|