@felan-ai/ext-output-style 0.1.0 → 0.2.1
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 +26 -5
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,18 +3,28 @@
|
|
|
3
3
|
Portable output-style instructions for Felan sessions.
|
|
4
4
|
|
|
5
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
|
|
7
|
-
`explanatory` styles; arbitrary prompt text and file-backed
|
|
8
|
-
supported. `concise` is the default.
|
|
6
|
+
system prompt before each model run. It accepts only the built-in `concise`,
|
|
7
|
+
`explanatory`, and `caveman` styles; arbitrary prompt text and file-backed
|
|
8
|
+
styles are not supported. `concise` is the default.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
import { createOutputStyleExtension } from '@felan-ai/ext-output-style';
|
|
12
12
|
|
|
13
13
|
const extension = createOutputStyleExtension('explanatory');
|
|
14
|
+
const caveman = createOutputStyleExtension('caveman');
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
Felan declares the style as `extensionConfig.outputStyle.style`. The local TUI,
|
|
18
|
+
CLI, `/settings`, and Agent Core consumers all resolve this setting before
|
|
19
|
+
activating the extension for root and child sessions.
|
|
20
|
+
|
|
21
|
+
## Package boundary and requirements
|
|
22
|
+
|
|
23
|
+
The package owns the supported style names, their fixed instructions,
|
|
24
|
+
validation, and prompt-section formatting. A host owns style selection,
|
|
25
|
+
built-in enablement, and session lifecycle. The package requires a compatible
|
|
26
|
+
`@felan-ai/agent-core` peer and does not read settings, prompt files, or ambient
|
|
27
|
+
resources itself.
|
|
18
28
|
|
|
19
29
|
## Development
|
|
20
30
|
|
|
@@ -27,3 +37,14 @@ pnpm --filter @felan-ai/ext-output-style build
|
|
|
27
37
|
pnpm --filter @felan-ai/ext-output-style type-check
|
|
28
38
|
pnpm --filter @felan-ai/ext-output-style test
|
|
29
39
|
```
|
|
40
|
+
|
|
41
|
+
## Related documentation
|
|
42
|
+
|
|
43
|
+
- [Configuration](../../docs/user-guide/configuration.md#output-style)
|
|
44
|
+
- [Extension catalog](../../docs/reference/extension-catalog.md)
|
|
45
|
+
- [Architecture](../../docs/concepts/architecture.md)
|
|
46
|
+
|
|
47
|
+
## Attribution
|
|
48
|
+
|
|
49
|
+
This package is original Felan project code. See [NOTICE](NOTICE) and
|
|
50
|
+
[LICENSE](LICENSE).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const OUTPUT_STYLES: readonly ["concise", "explanatory"];
|
|
1
|
+
import { type FelanExtension } from '@felan-ai/agent-core';
|
|
2
|
+
export declare const OUTPUT_STYLES: readonly ["concise", "explanatory", "caveman"];
|
|
3
3
|
export type OutputStyle = typeof OUTPUT_STYLES[number];
|
|
4
4
|
export declare const DEFAULT_OUTPUT_STYLE: OutputStyle;
|
|
5
|
+
export declare const OUTPUT_STYLE_CONFIG: import("@felan-ai/agent-core").ExtensionConfigDefinition<{
|
|
6
|
+
readonly style: import("@felan-ai/agent-core").ExtensionConfigField<"concise" | "explanatory" | "caveman">;
|
|
7
|
+
}>;
|
|
5
8
|
export declare function parseOutputStyle(value?: unknown): OutputStyle;
|
|
6
9
|
export declare function formatOutputStyleSection(style: OutputStyle): string;
|
|
7
10
|
export declare function createOutputStyleExtension(value?: unknown): FelanExtension;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgE,KAAK,cAAc,EAA0B,MAAM,sBAAsB,CAAC;AAEjJ,eAAO,MAAM,aAAa,gDAAiD,CAAC;AAC5E,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,oBAAoB,EAAE,WAAuB,CAAC;AAC3D,eAAO,MAAM,mBAAmB;;EAU9B,CAAC;AAyBH,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,EAAE,cAEtB,CAAC;AAGP,eAAe,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { associateExtensionConfig, configField, defineExtensionConfig } from '@felan-ai/agent-core';
|
|
2
|
+
export const OUTPUT_STYLES = ['concise', 'explanatory', 'caveman'];
|
|
2
3
|
export const DEFAULT_OUTPUT_STYLE = 'concise';
|
|
4
|
+
export const OUTPUT_STYLE_CONFIG = defineExtensionConfig({
|
|
5
|
+
id: 'outputStyle',
|
|
6
|
+
title: 'Output style',
|
|
7
|
+
fields: {
|
|
8
|
+
style: configField.enum(OUTPUT_STYLES, {
|
|
9
|
+
default: DEFAULT_OUTPUT_STYLE,
|
|
10
|
+
description: 'Response detail and explanation style',
|
|
11
|
+
cliName: 'output-style',
|
|
12
|
+
}),
|
|
13
|
+
},
|
|
14
|
+
});
|
|
3
15
|
const OUTPUT_STYLE_START = '<output_style>';
|
|
4
16
|
const OUTPUT_STYLE_END = '</output_style>';
|
|
5
17
|
const STYLE_INSTRUCTIONS = {
|
|
@@ -13,6 +25,13 @@ const STYLE_INSTRUCTIONS = {
|
|
|
13
25
|
'Provide enough context for the user to understand how the result works and how to verify it.',
|
|
14
26
|
'Keep explanations relevant to the request and avoid repeating the same point.',
|
|
15
27
|
],
|
|
28
|
+
caveman: [
|
|
29
|
+
'Use the fewest words that preserve correctness. Prefer short fragments, compact bullets, and standard abbreviations.',
|
|
30
|
+
'Omit greetings, restatements, transitions, and filler.',
|
|
31
|
+
'Expand enough to be clear for errors, security warnings, destructive actions, blockers, and complex plans.',
|
|
32
|
+
'Keep code, commands, paths, identifiers, numbers, and error messages exact.',
|
|
33
|
+
'Never omit required caveats, verification results, or blockers for brevity.',
|
|
34
|
+
],
|
|
16
35
|
};
|
|
17
36
|
export function parseOutputStyle(value = DEFAULT_OUTPUT_STYLE) {
|
|
18
37
|
if (typeof value === 'string' && OUTPUT_STYLES.includes(value)) {
|
|
@@ -38,6 +57,7 @@ export function createOutputStyleExtension(value = DEFAULT_OUTPUT_STYLE) {
|
|
|
38
57
|
});
|
|
39
58
|
};
|
|
40
59
|
}
|
|
41
|
-
const outputStyleExtension = createOutputStyleExtension();
|
|
60
|
+
const outputStyleExtension = ((pi) => createOutputStyleExtension(pi.config?.style ?? DEFAULT_OUTPUT_STYLE)(pi));
|
|
61
|
+
associateExtensionConfig(outputStyleExtension, OUTPUT_STYLE_CONFIG);
|
|
42
62
|
export default outputStyleExtension;
|
|
43
63
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,qBAAqB,EAA+C,MAAM,sBAAsB,CAAC;AAEjJ,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,CAAU,CAAC;AAG5E,MAAM,CAAC,MAAM,oBAAoB,GAAgB,SAAS,CAAC;AAC3D,MAAM,CAAC,MAAM,mBA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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,GAAmB,CAAC,CAAC,EAAqB,EAAE,EAAE,CAAC,0BAA0B,CACjG,EAAE,CAAC,MAAM,EAAE,KAAK,IAAI,oBAAoB,CACzC,CAAC,EAAE,CAAC,CAAC,CAAC;AACP,wBAAwB,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;AAEpE,eAAe,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@felan-ai/ext-output-style",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Portable output-style system prompt extension for Felan",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@felan-ai/agent-core": "^0.
|
|
28
|
+
"@felan-ai/agent-core": "^0.5.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@felan-ai/agent-core": "0.
|
|
31
|
+
"@felan-ai/agent-core": "0.5.2"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public",
|