@zhin.js/prompt-section 0.0.1 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # @zhin.js/prompt-section
2
2
 
3
3
  Generation-owned Agent Prompt Section Feature。插件根目录的
4
- `agent/prompt-sections/**/*.ts` 默认导出 `defineAgentPromptSection(...)`,并作为
4
+ `prompt-sections/<name>/index.ts` 默认导出 `defineAgentPromptSection(...)`,并作为
5
5
  immutable capability slot 进入当前 generation。
6
6
 
7
7
  Prompt Section 只贡献模型上下文,不授予 Tool、文件、网络、审批或 Workroom 权限。
package/lib/provider.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { featureId } from '@zhin.js/plugin-runtime';
2
- import { defineFeatureProvider, typeScriptModules } from '@zhin.js/feature-kit';
2
+ import { capture, defineFeatureProvider, directoryModules } from '@zhin.js/feature-kit';
3
3
  import { parseAgentPromptSectionDefinition } from './definition.js';
4
4
  import { PromptSectionIndex } from './prompt-section-index.js';
5
5
  export const promptSectionFeatureId = featureId('zhin.agent-prompt-section');
@@ -8,10 +8,12 @@ const promptSectionFeature = defineFeatureProvider({
8
8
  id: promptSectionFeatureId,
9
9
  authoring: {
10
10
  setupMethod: 'addPromptSection',
11
- conventions: [typeScriptModules({
12
- id: 'agent-prompt-sections-ts',
13
- directory: 'agent/prompt-sections',
14
- recursive: true,
11
+ conventions: [directoryModules({
12
+ id: 'prompt-sections-directory-modules',
13
+ layouts: [{
14
+ segments: ['prompt-sections', capture('section')],
15
+ localName: ({ section = '' }) => section,
16
+ }],
15
17
  })],
16
18
  validate: parseAgentPromptSectionDefinition,
17
19
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/prompt-section",
3
- "version": "0.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Generation-owned Agent Prompt Section Feature for Zhin Plugin Runtime",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -17,8 +17,8 @@
17
17
  "src"
18
18
  ],
19
19
  "dependencies": {
20
- "@zhin.js/feature-kit": "1.0.13",
21
- "@zhin.js/plugin-runtime": "1.1.8"
20
+ "@zhin.js/feature-kit": "1.1.1",
21
+ "@zhin.js/plugin-runtime": "1.1.10"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^26.1.2",
package/src/provider.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { featureId } from '@zhin.js/plugin-runtime';
2
- import { defineFeatureProvider, typeScriptModules } from '@zhin.js/feature-kit';
2
+ import { capture, defineFeatureProvider, directoryModules } from '@zhin.js/feature-kit';
3
3
  import { parseAgentPromptSectionDefinition } from './definition.js';
4
4
  import { PromptSectionIndex } from './prompt-section-index.js';
5
5
 
@@ -10,10 +10,12 @@ const promptSectionFeature = defineFeatureProvider({
10
10
  id: promptSectionFeatureId,
11
11
  authoring: {
12
12
  setupMethod: 'addPromptSection',
13
- conventions: [typeScriptModules({
14
- id: 'agent-prompt-sections-ts',
15
- directory: 'agent/prompt-sections',
16
- recursive: true,
13
+ conventions: [directoryModules({
14
+ id: 'prompt-sections-directory-modules',
15
+ layouts: [{
16
+ segments: ['prompt-sections', capture('section')],
17
+ localName: ({ section = '' }) => section,
18
+ }],
17
19
  })],
18
20
  validate: parseAgentPromptSectionDefinition,
19
21
  },