@alavida/agentpack 0.1.1 → 0.1.3
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 +16 -2
- package/bin/intent.js +20 -0
- package/package.json +11 -5
- package/skills/agentpack-cli/SKILL.md +16 -1
- package/skills/agentpack-cli/references/skill-lifecycle.md +21 -1
- package/skills/authoring-skillgraphs-from-knowledge/SKILL.md +148 -0
- package/skills/authoring-skillgraphs-from-knowledge/references/authored-metadata.md +6 -0
- package/skills/developing-and-testing-skills/SKILL.md +109 -0
- package/skills/developing-and-testing-skills/references/local-workbench.md +7 -0
- package/skills/getting-started-skillgraphs/SKILL.md +115 -0
- package/skills/getting-started-skillgraphs/references/command-routing.md +7 -0
- package/skills/identifying-skill-opportunities/SKILL.md +119 -0
- package/skills/identifying-skill-opportunities/references/capability-boundaries.md +6 -0
- package/skills/maintaining-skillgraph-freshness/SKILL.md +110 -0
- package/skills/repairing-broken-skill-or-plugin-state/SKILL.md +112 -0
- package/skills/repairing-broken-skill-or-plugin-state/references/diagnostic-flows.md +6 -0
- package/skills/shipping-production-plugins-and-packages/SKILL.md +123 -0
- package/skills/shipping-production-plugins-and-packages/references/plugin-delivery.md +6 -0
- package/src/application/plugins/build-plugin.js +5 -0
- package/src/application/plugins/inspect-plugin-bundle.js +5 -0
- package/src/application/plugins/validate-plugin-bundle.js +5 -0
- package/src/application/skills/build-skill-workbench-model.js +194 -0
- package/src/application/skills/inspect-skill.js +5 -0
- package/src/application/skills/list-stale-skills.js +9 -0
- package/src/application/skills/run-skill-workbench-action.js +23 -0
- package/src/application/skills/start-skill-dev-workbench.js +192 -0
- package/src/application/skills/validate-skills.js +5 -0
- package/src/cli.js +1 -1
- package/src/commands/plugin.js +7 -4
- package/src/commands/skills.js +14 -9
- package/src/dashboard/App.jsx +343 -0
- package/src/dashboard/components/Breadcrumbs.jsx +45 -0
- package/src/dashboard/components/ControlStrip.jsx +153 -0
- package/src/dashboard/components/InspectorPanel.jsx +203 -0
- package/src/dashboard/components/SkillGraph.jsx +567 -0
- package/src/dashboard/components/Tooltip.jsx +111 -0
- package/src/dashboard/dist/dashboard.js +26692 -0
- package/src/dashboard/index.html +81 -0
- package/src/dashboard/lib/api.js +19 -0
- package/src/dashboard/lib/router.js +15 -0
- package/src/dashboard/main.jsx +4 -0
- package/src/domain/plugins/load-plugin-definition.js +163 -0
- package/src/domain/plugins/plugin-diagnostic-error.js +18 -0
- package/src/domain/plugins/plugin-requirements.js +15 -0
- package/src/domain/skills/skill-graph.js +137 -0
- package/src/domain/skills/skill-model.js +187 -0
- package/src/domain/skills/skill-provenance.js +69 -0
- package/src/infrastructure/fs/build-state-repository.js +16 -0
- package/src/infrastructure/fs/install-state-repository.js +16 -0
- package/src/infrastructure/runtime/materialize-skills.js +117 -0
- package/src/infrastructure/runtime/open-browser.js +20 -0
- package/src/infrastructure/runtime/skill-dev-workbench-server.js +96 -0
- package/src/infrastructure/runtime/watch-skill-workbench.js +68 -0
- package/src/infrastructure/runtime/watch-tree.js +44 -0
- package/src/lib/plugins.js +46 -117
- package/src/lib/skills.js +141 -459
- package/src/utils/errors.js +33 -1
package/src/utils/errors.js
CHANGED
|
@@ -14,18 +14,31 @@ export const EXIT_CODES = {
|
|
|
14
14
|
* Carries a machine-readable code and mapped exit code.
|
|
15
15
|
*/
|
|
16
16
|
export class AgentpackError extends Error {
|
|
17
|
-
constructor(message, {
|
|
17
|
+
constructor(message, {
|
|
18
|
+
code,
|
|
19
|
+
exitCode = EXIT_CODES.GENERAL,
|
|
20
|
+
suggestion,
|
|
21
|
+
path,
|
|
22
|
+
nextSteps,
|
|
23
|
+
details,
|
|
24
|
+
} = {}) {
|
|
18
25
|
super(message);
|
|
19
26
|
this.name = 'AgentpackError';
|
|
20
27
|
this.code = code || 'general_error';
|
|
21
28
|
this.exitCode = exitCode;
|
|
22
29
|
this.suggestion = suggestion;
|
|
30
|
+
this.path = path;
|
|
31
|
+
this.nextSteps = nextSteps || [];
|
|
32
|
+
this.details = details || {};
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
toJSON() {
|
|
26
36
|
return {
|
|
27
37
|
error: this.code,
|
|
28
38
|
message: this.message,
|
|
39
|
+
...(this.path && { path: this.path }),
|
|
40
|
+
...(this.nextSteps.length > 0 && { nextSteps: this.nextSteps }),
|
|
41
|
+
...(Object.keys(this.details).length > 0 && { details: this.details }),
|
|
29
42
|
...(this.suggestion && { suggestion: this.suggestion }),
|
|
30
43
|
};
|
|
31
44
|
}
|
|
@@ -58,6 +71,25 @@ export class NotFoundError extends AgentpackError {
|
|
|
58
71
|
export function formatError(err) {
|
|
59
72
|
if (err instanceof AgentpackError) {
|
|
60
73
|
let msg = `Error: ${err.message}`;
|
|
74
|
+
if (err.path) {
|
|
75
|
+
msg += `\nPath: ${err.path}`;
|
|
76
|
+
}
|
|
77
|
+
if (err.nextSteps?.length) {
|
|
78
|
+
for (const step of err.nextSteps) {
|
|
79
|
+
const actionLabel = step.action === 'create_file'
|
|
80
|
+
? `Create ${step.path}`
|
|
81
|
+
: step.action === 'edit_file'
|
|
82
|
+
? `Edit ${step.path}`
|
|
83
|
+
: step.reason;
|
|
84
|
+
msg += `\nNext: ${actionLabel}`;
|
|
85
|
+
if (step.reason && step.reason !== actionLabel) {
|
|
86
|
+
msg += `\nWhy: ${step.reason}`;
|
|
87
|
+
}
|
|
88
|
+
if (step.example) {
|
|
89
|
+
msg += `\nExample:\n${JSON.stringify(step.example, null, 2)}`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
61
93
|
if (err.suggestion) {
|
|
62
94
|
msg += `\n\nSuggestion: ${err.suggestion}`;
|
|
63
95
|
}
|