@felan-ai/ext-output-style 0.0.0 → 0.2.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 CHANGED
@@ -1,21 +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.
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 CHANGED
@@ -1,6 +1,6 @@
1
- @felan-ai/ext-output-style
2
-
3
- Copyright (c) 2026 Felan contributors
4
-
5
- This package is original Felan code licensed under the MIT License included in
6
- this package. It has no third-party runtime dependencies.
1
+ @felan-ai/ext-output-style
2
+
3
+ Copyright (c) 2026 Felan contributors
4
+
5
+ This package is original Felan code licensed under the MIT License included in
6
+ this package. It has no third-party runtime dependencies.
package/README.md CHANGED
@@ -1,29 +1,49 @@
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
- ```
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
+ Felan declares the style as `extensionConfig.outputStyle.style`. The local TUI,
17
+ CLI, `/settings`, and Agent Core consumers all resolve this setting before
18
+ activating the extension for root and child sessions.
19
+
20
+ ## Package boundary and requirements
21
+
22
+ The package owns the supported style names, their fixed instructions,
23
+ validation, and prompt-section formatting. A host owns style selection,
24
+ built-in enablement, and session lifecycle. The package requires a compatible
25
+ `@felan-ai/agent-core` peer and does not read settings, prompt files, or ambient
26
+ resources itself.
27
+
28
+ ## Development
29
+
30
+ Source: `packages/ext-output-style` in <https://github.com/felan-ai/felan>.
31
+
32
+ ```sh
33
+ corepack enable
34
+ pnpm install --frozen-lockfile
35
+ pnpm --filter @felan-ai/ext-output-style build
36
+ pnpm --filter @felan-ai/ext-output-style type-check
37
+ pnpm --filter @felan-ai/ext-output-style test
38
+ ```
39
+
40
+ ## Related documentation
41
+
42
+ - [Configuration](../../docs/user-guide/configuration.md#output-style)
43
+ - [Extension catalog](../../docs/reference/extension-catalog.md)
44
+ - [Architecture](../../docs/concepts/architecture.md)
45
+
46
+ ## Attribution
47
+
48
+ This package is original Felan project code. See [NOTICE](NOTICE) and
49
+ [LICENSE](LICENSE).
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- import type { FelanExtension } from '@felan-ai/agent-core';
1
+ import { type FelanExtension } from '@felan-ai/agent-core';
2
2
  export declare const OUTPUT_STYLES: readonly ["concise", "explanatory"];
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">;
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;
@@ -1 +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"}
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,qCAAsC,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,oBAAoB,EAAE,WAAuB,CAAC;AAC3D,eAAO,MAAM,mBAAmB;;EAU9B,CAAC;AAkBH,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
+ import { associateExtensionConfig, configField, defineExtensionConfig } from '@felan-ai/agent-core';
1
2
  export const OUTPUT_STYLES = ['concise', 'explanatory'];
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(['concise', 'explanatory'], {
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 = {
@@ -38,6 +50,7 @@ export function createOutputStyleExtension(value = DEFAULT_OUTPUT_STYLE) {
38
50
  });
39
51
  };
40
52
  }
41
- const outputStyleExtension = createOutputStyleExtension();
53
+ const outputStyleExtension = ((pi) => createOutputStyleExtension(pi.config?.style ?? DEFAULT_OUTPUT_STYLE)(pi));
54
+ associateExtensionConfig(outputStyleExtension, OUTPUT_STYLE_CONFIG);
42
55
  export default outputStyleExtension;
43
56
  //# 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":"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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;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,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.0.0",
3
+ "version": "0.2.0",
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.4.0"
28
+ "@felan-ai/agent-core": "^0.5.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@felan-ai/agent-core": "0.4.9"
31
+ "@felan-ai/agent-core": "0.5.0"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public",
@@ -39,4 +39,4 @@
39
39
  "type-check": "tsc -p tsconfig.json --noEmit",
40
40
  "test": "vitest run"
41
41
  }
42
- }
42
+ }