@lovelybunch/core 1.0.75-alpha.2 → 1.0.75-alpha.4

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.
@@ -0,0 +1,17 @@
1
+ export declare const SCHEMA_REFERENCE_INSTRUCTION = "Consult the schema references in .nut/.schema (proposal.schema.md, project.schema.md, architecture.schema.md, agent.schema.md, knowledge.schema.md) so any updates you make follow the documented structure and include complete arrays for plan steps, dependencies, tags, labels, and comments.";
2
+ export declare const PROJECT_REFERENCE_INSTRUCTION = "Use .nut/context/project.md and .nut/context/architecture.md for reference.";
3
+ /**
4
+ * Get instructions for change proposal (cp-*) workflows
5
+ */
6
+ export declare function getChangeProposalInstructions(proposalId: string, agentPaths: string[], customInstruction?: string, includeDefaultInstructions?: boolean): string[];
7
+ /**
8
+ * Get instructions for reviewing / preparing a change proposal (cp-*) before implementation.
9
+ * Assesses readiness without starting any actual work.
10
+ */
11
+ export declare function getPrepareChangeProposalInstructions(proposalId: string, agentPaths: string[], customInstruction?: string): string[];
12
+ /**
13
+ * Get instructions for agent (ag-*) workflows
14
+ * Agent content and custom instructions drive the behavior
15
+ */
16
+ export declare function getAgentInstructions(agentPaths: string[], customInstruction?: string): string[];
17
+ //# sourceMappingURL=agent-instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-instructions.d.ts","sourceRoot":"","sources":["../src/agent-instructions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,sSAC4P,CAAC;AACtS,eAAO,MAAM,6BAA6B,gFACqC,CAAA;AAE/E;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAAE,EACpB,iBAAiB,CAAC,EAAE,MAAM,EAC1B,0BAA0B,GAAE,OAAc,GACzC,MAAM,EAAE,CA0EV;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAAE,EACpB,iBAAiB,CAAC,EAAE,MAAM,GACzB,MAAM,EAAE,CAqEV;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAAE,EACpB,iBAAiB,CAAC,EAAE,MAAM,GACzB,MAAM,EAAE,CAgBV"}
@@ -0,0 +1,160 @@
1
+ export const SCHEMA_REFERENCE_INSTRUCTION = 'Consult the schema references in .nut/.schema (proposal.schema.md, project.schema.md, architecture.schema.md, agent.schema.md, knowledge.schema.md) so any updates you make follow the documented structure and include complete arrays for plan steps, dependencies, tags, labels, and comments.';
2
+ export const PROJECT_REFERENCE_INSTRUCTION = 'Use .nut/context/project.md and .nut/context/architecture.md for reference.';
3
+ /**
4
+ * Get instructions for change proposal (cp-*) workflows
5
+ */
6
+ export function getChangeProposalInstructions(proposalId, agentPaths, customInstruction, includeDefaultInstructions = true) {
7
+ const sections = [];
8
+ // Add default instructions only if requested
9
+ if (includeDefaultInstructions) {
10
+ // Task section
11
+ sections.push([
12
+ `## Task`,
13
+ ``,
14
+ `- Review and begin working on the following task proposal:`,
15
+ ` .nut/proposals/${proposalId}.md`,
16
+ `- Retrieve your firstName, lastName, and email address from: .nut/config.json and use this identity to address yourself in any task updates, comments, git commits, etc.`,
17
+ ].join('\n'));
18
+ // Task Lifecycle section
19
+ sections.push([
20
+ `## Task Lifecycle`,
21
+ ``,
22
+ `- Before beginning any work: nut task update ${proposalId} --status active`,
23
+ `- Add appropriate steps with: nut task step ${proposalId} "Step description" --author "firstName lastName"`,
24
+ ``,
25
+ `- If you need human clarification or input: nut task update ${proposalId} --status blocked. The clarification can be communicated as follows: nut task comment ${proposalId} "Comments here" --author "firstName lastName". At this point please stop work.`,
26
+ ``,
27
+ `- When implementation is complete and ready for approval: nut task update ${proposalId} --status review`,
28
+ `- Only mark the task complete once approval criteria are satisfied: nut task update ${proposalId} --status done`,
29
+ ].join('\n'));
30
+ // Abilities section
31
+ sections.push([
32
+ `## Abilities`,
33
+ ``,
34
+ `- The following abilities are at your disposal and should be factored into the plan where appropriate (each command has its own --help):`,
35
+ ` - Work with knowledge documents (used for the output of any research-centric tasks):`,
36
+ ` - nut knowledge create "Quick Note" --content "# Quick Note\\n\\nSome content here"`,
37
+ ` - nut knowledge list`,
38
+ ` - nut knowledge get example-filename.md`,
39
+ ` - Creating media such as images, audio, or video:`,
40
+ ` - nut resource`,
41
+ ` - Using available skills (specialized, reusable, and portable modules). There is also an official registry you can pull from:`,
42
+ ` - nut skills list`,
43
+ ` - nut skills registry list`,
44
+ `- Similarly, the following are available: git, gh, node, python`,
45
+ ].join('\n'));
46
+ // Operational Rules section
47
+ sections.push([
48
+ `## Operational Rules`,
49
+ ``,
50
+ `- DO use the nut CLI to update task status as progress changes`,
51
+ ` (nut --help or nut task --help for details)`,
52
+ `- DO NOT edit files outside the scope of the approved proposal (unless instructed by the Additional Instructions below)`,
53
+ ].join('\n'));
54
+ }
55
+ // Agents section (conditional)
56
+ if (agentPaths.length > 0) {
57
+ sections.push([
58
+ `## Agents`,
59
+ ``,
60
+ `These agents are available to you if needed:`,
61
+ ...agentPaths.map(p => `- ${p}`),
62
+ ].join('\n'));
63
+ }
64
+ // Additional Instructions section (conditional)
65
+ if (customInstruction && customInstruction.trim()) {
66
+ sections.push([
67
+ `## Additional Instructions`,
68
+ ``,
69
+ `DO strictly adhere to these additional instructions:`,
70
+ customInstruction.trim(),
71
+ ].join('\n'));
72
+ }
73
+ return [sections.join('\n\n')];
74
+ }
75
+ /**
76
+ * Get instructions for reviewing / preparing a change proposal (cp-*) before implementation.
77
+ * Assesses readiness without starting any actual work.
78
+ */
79
+ export function getPrepareChangeProposalInstructions(proposalId, agentPaths, customInstruction) {
80
+ const sections = [];
81
+ // Task section
82
+ sections.push([
83
+ `## Task`,
84
+ ``,
85
+ `- Review and assess the following task (include provided comments from the user and act on these accordingly) to ensure you have enough information, context, and resources (skills, MCP tools, appropriate access, etc) to successfully complete it, although DO NOT start any work at this stage: .nut/proposals/${proposalId}.md`,
86
+ `- Generate a readiness score on a scale of 1-100 (where 1 is not ready at all and 100 is complete certainty on your ability to complete this task without ANY additional user interaction) and add this as a comment (details on how to do this below).`,
87
+ `- Be sure to suggest to the user (again via a comment) if it would make sense to decompose this into separate tasks, although DO NOT do this without user confirmation first.`,
88
+ `- Retrieve your firstName, lastName, and email address from: .nut/config.json and use this identity to address yourself in any task updates, comments, git commits, etc.`,
89
+ ].join('\n'));
90
+ // Task Lifecycle section
91
+ sections.push([
92
+ `## Task Lifecycle`,
93
+ ``,
94
+ `- Before beginning any work: nut task update ${proposalId} --status active`,
95
+ `- Add appropriate implementation steps with: nut task step ${proposalId} "Step description" --author "firstName lastName"`,
96
+ `- If you need human clarification or input: nut task update ${proposalId} --status blocked. The clarification can be communicated as follows: nut task comment ${proposalId} "Comments here" --author "firstName lastName". At this point please stop work.`,
97
+ ].join('\n'));
98
+ // Abilities section
99
+ sections.push([
100
+ `## Abilities`,
101
+ ``,
102
+ `- The following abilities are at your disposal and should be factored into the plan where appropriate (each command has its own --help):`,
103
+ ` - Work with knowledge documents (used for the output of any research-centric tasks):`,
104
+ ` - nut knowledge create "Quick Note" --content "# Quick Note\\n\\nSome content here"`,
105
+ ` - nut knowledge list`,
106
+ ` - nut knowledge get example-filename.md`,
107
+ ` - Creating media such as images, audio, or video:`,
108
+ ` - nut resource`,
109
+ ` - Using available skills (specialized, reusable, and portable modules). There is also an official registry you can pull from:`,
110
+ ` - nut skills list`,
111
+ ` - nut skills registry list`,
112
+ `- Similarly, the following are available: git, gh, node, python`,
113
+ ].join('\n'));
114
+ // Operational Rules section
115
+ sections.push([
116
+ `## Operational Rules`,
117
+ ``,
118
+ `- DO NOT use 'npx' when running the nut CLI`,
119
+ `- DO use the nut CLI to update task status as progress changes`,
120
+ ` (nut --help or nut task --help for details)`,
121
+ `- DO NOT edit files outside the scope of the approved proposal (unless instructed by the Additional Instructions below)`,
122
+ ].join('\n'));
123
+ // Skills section (conditional)
124
+ if (agentPaths.length > 0) {
125
+ sections.push([
126
+ `## Skills`,
127
+ ``,
128
+ `These skills are available to you if needed (if you are able to test access, etc without any writes please do so):`,
129
+ ...agentPaths.map(p => `- ${p}`),
130
+ ].join('\n'));
131
+ }
132
+ // Additional Instructions section (conditional)
133
+ if (customInstruction && customInstruction.trim()) {
134
+ sections.push([
135
+ `## Additional Instructions`,
136
+ ``,
137
+ `DO strictly adhere to these additional instructions:`,
138
+ customInstruction.trim(),
139
+ ].join('\n'));
140
+ }
141
+ return [sections.join('\n\n')];
142
+ }
143
+ /**
144
+ * Get instructions for agent (ag-*) workflows
145
+ * Agent content and custom instructions drive the behavior
146
+ */
147
+ export function getAgentInstructions(agentPaths, customInstruction) {
148
+ const parts = [];
149
+ parts.push(PROJECT_REFERENCE_INSTRUCTION);
150
+ // Add agent references if provided
151
+ if (agentPaths.length > 0) {
152
+ parts.push(`Please use these skills: ${agentPaths.join(', ')}`);
153
+ }
154
+ // Add custom instruction if provided
155
+ if (customInstruction && customInstruction.trim()) {
156
+ parts.push(`Additional instruction: ${customInstruction.trim()}`);
157
+ }
158
+ return parts;
159
+ }
160
+ //# sourceMappingURL=agent-instructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-instructions.js","sourceRoot":"","sources":["../src/agent-instructions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GACvC,mSAAmS,CAAC;AACtS,MAAM,CAAC,MAAM,6BAA6B,GACxC,6EAA6E,CAAA;AAE/E;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,UAAkB,EAClB,UAAoB,EACpB,iBAA0B,EAC1B,6BAAsC,IAAI;IAE1C,MAAM,QAAQ,GAAa,EAAE,CAAA;IAE7B,6CAA6C;IAC7C,IAAI,0BAA0B,EAAE,CAAC;QAC/B,eAAe;QACf,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS;YACT,EAAE;YACF,4DAA4D;YAC5D,oBAAoB,UAAU,KAAK;YACnC,0KAA0K;SAC3K,CAA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,CAAC,IAAI,CAAC;YACZ,WAAW;YACX,EAAE;YACF,oHAAoH;YACpH,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;SACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACf,CAAC;IAED,gDAAgD;IAChD,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC;QAClD,QAAQ,CAAC,IAAI,CAAC;YACZ,4BAA4B;YAC5B,EAAE;YACF,sDAAsD;YACtD,iBAAiB,CAAC,IAAI,EAAE;SACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACf,CAAC;IAED,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAChC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAoB,EACpB,iBAA0B;IAE1B,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAE1C,mCAAmC;IACnC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,4BAA4B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjE,CAAC;IAED,qCAAqC;IACrC,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,2BAA2B,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACnE,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,5 +6,6 @@ export * from './proposals.js';
6
6
  export * from './context.js';
7
7
  export * from './knowledge.js';
8
8
  export * from './events.js';
9
+ export * from './agent-instructions.js';
9
10
  export type * from '@lovelybunch/types';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,mBAAmB,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,mBAAmB,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -6,4 +6,5 @@ export * from './proposals.js';
6
6
  export * from './context.js';
7
7
  export * from './knowledge.js';
8
8
  export * from './events.js';
9
+ export * from './agent-instructions.js';
9
10
  //# 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":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/core",
3
- "version": "1.0.75-alpha.2",
3
+ "version": "1.0.75-alpha.4",
4
4
  "description": "Core Coconut functionality",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "test:ui": "vitest --ui"
39
39
  },
40
40
  "dependencies": {
41
- "@lovelybunch/types": "^1.0.75-alpha.2",
41
+ "@lovelybunch/types": "^1.0.75-alpha.4",
42
42
  "fuse.js": "^7.0.0",
43
43
  "gray-matter": "^4.0.3",
44
44
  "nanoid": "^5.0.6",