@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.
Files changed (57) hide show
  1. package/README.md +16 -2
  2. package/bin/intent.js +20 -0
  3. package/package.json +11 -5
  4. package/skills/agentpack-cli/SKILL.md +16 -1
  5. package/skills/agentpack-cli/references/skill-lifecycle.md +21 -1
  6. package/skills/authoring-skillgraphs-from-knowledge/SKILL.md +148 -0
  7. package/skills/authoring-skillgraphs-from-knowledge/references/authored-metadata.md +6 -0
  8. package/skills/developing-and-testing-skills/SKILL.md +109 -0
  9. package/skills/developing-and-testing-skills/references/local-workbench.md +7 -0
  10. package/skills/getting-started-skillgraphs/SKILL.md +115 -0
  11. package/skills/getting-started-skillgraphs/references/command-routing.md +7 -0
  12. package/skills/identifying-skill-opportunities/SKILL.md +119 -0
  13. package/skills/identifying-skill-opportunities/references/capability-boundaries.md +6 -0
  14. package/skills/maintaining-skillgraph-freshness/SKILL.md +110 -0
  15. package/skills/repairing-broken-skill-or-plugin-state/SKILL.md +112 -0
  16. package/skills/repairing-broken-skill-or-plugin-state/references/diagnostic-flows.md +6 -0
  17. package/skills/shipping-production-plugins-and-packages/SKILL.md +123 -0
  18. package/skills/shipping-production-plugins-and-packages/references/plugin-delivery.md +6 -0
  19. package/src/application/plugins/build-plugin.js +5 -0
  20. package/src/application/plugins/inspect-plugin-bundle.js +5 -0
  21. package/src/application/plugins/validate-plugin-bundle.js +5 -0
  22. package/src/application/skills/build-skill-workbench-model.js +194 -0
  23. package/src/application/skills/inspect-skill.js +5 -0
  24. package/src/application/skills/list-stale-skills.js +9 -0
  25. package/src/application/skills/run-skill-workbench-action.js +23 -0
  26. package/src/application/skills/start-skill-dev-workbench.js +192 -0
  27. package/src/application/skills/validate-skills.js +5 -0
  28. package/src/cli.js +1 -1
  29. package/src/commands/plugin.js +7 -4
  30. package/src/commands/skills.js +14 -9
  31. package/src/dashboard/App.jsx +343 -0
  32. package/src/dashboard/components/Breadcrumbs.jsx +45 -0
  33. package/src/dashboard/components/ControlStrip.jsx +153 -0
  34. package/src/dashboard/components/InspectorPanel.jsx +203 -0
  35. package/src/dashboard/components/SkillGraph.jsx +567 -0
  36. package/src/dashboard/components/Tooltip.jsx +111 -0
  37. package/src/dashboard/dist/dashboard.js +26692 -0
  38. package/src/dashboard/index.html +81 -0
  39. package/src/dashboard/lib/api.js +19 -0
  40. package/src/dashboard/lib/router.js +15 -0
  41. package/src/dashboard/main.jsx +4 -0
  42. package/src/domain/plugins/load-plugin-definition.js +163 -0
  43. package/src/domain/plugins/plugin-diagnostic-error.js +18 -0
  44. package/src/domain/plugins/plugin-requirements.js +15 -0
  45. package/src/domain/skills/skill-graph.js +137 -0
  46. package/src/domain/skills/skill-model.js +187 -0
  47. package/src/domain/skills/skill-provenance.js +69 -0
  48. package/src/infrastructure/fs/build-state-repository.js +16 -0
  49. package/src/infrastructure/fs/install-state-repository.js +16 -0
  50. package/src/infrastructure/runtime/materialize-skills.js +117 -0
  51. package/src/infrastructure/runtime/open-browser.js +20 -0
  52. package/src/infrastructure/runtime/skill-dev-workbench-server.js +96 -0
  53. package/src/infrastructure/runtime/watch-skill-workbench.js +68 -0
  54. package/src/infrastructure/runtime/watch-tree.js +44 -0
  55. package/src/lib/plugins.js +46 -117
  56. package/src/lib/skills.js +141 -459
  57. package/src/utils/errors.js +33 -1
@@ -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, { code, exitCode = EXIT_CODES.GENERAL, suggestion } = {}) {
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
  }