@stigmer/plugin-package 3.16.0 → 3.17.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.
Files changed (86) hide show
  1. package/client/archive.d.ts +27 -0
  2. package/client/archive.d.ts.map +1 -0
  3. package/client/archive.js +38 -0
  4. package/client/archive.js.map +1 -0
  5. package/client/ignore/defaults.d.ts +2 -0
  6. package/client/ignore/defaults.d.ts.map +1 -0
  7. package/client/ignore/defaults.js +140 -0
  8. package/client/ignore/defaults.js.map +1 -0
  9. package/client/ignore/match.d.ts +3 -0
  10. package/client/ignore/match.d.ts.map +1 -0
  11. package/client/ignore/match.js +166 -0
  12. package/client/ignore/match.js.map +1 -0
  13. package/client/ignore/matcher.d.ts +50 -0
  14. package/client/ignore/matcher.d.ts.map +1 -0
  15. package/client/ignore/matcher.js +116 -0
  16. package/client/ignore/matcher.js.map +1 -0
  17. package/client/ignore/pattern.d.ts +13 -0
  18. package/client/ignore/pattern.d.ts.map +1 -0
  19. package/client/ignore/pattern.js +118 -0
  20. package/client/ignore/pattern.js.map +1 -0
  21. package/client/refs.d.ts +76 -0
  22. package/client/refs.d.ts.map +1 -0
  23. package/client/refs.js +123 -0
  24. package/client/refs.js.map +1 -0
  25. package/client/select.d.ts +74 -0
  26. package/client/select.d.ts.map +1 -0
  27. package/client/select.js +121 -0
  28. package/client/select.js.map +1 -0
  29. package/client/vocabulary.d.ts +13 -0
  30. package/client/vocabulary.d.ts.map +1 -0
  31. package/client/vocabulary.js +17 -0
  32. package/client/vocabulary.js.map +1 -0
  33. package/client.d.ts +34 -0
  34. package/client.d.ts.map +1 -0
  35. package/client.js +34 -0
  36. package/client.js.map +1 -0
  37. package/files.d.ts +6 -0
  38. package/files.d.ts.map +1 -1
  39. package/files.js +6 -0
  40. package/files.js.map +1 -1
  41. package/index.d.ts +11 -6
  42. package/index.d.ts.map +1 -1
  43. package/index.js +9 -5
  44. package/index.js.map +1 -1
  45. package/marketplace/messages.d.ts +20 -0
  46. package/marketplace/messages.d.ts.map +1 -0
  47. package/marketplace/messages.js +50 -0
  48. package/marketplace/messages.js.map +1 -0
  49. package/marketplace/outcome.d.ts +72 -0
  50. package/marketplace/outcome.d.ts.map +1 -0
  51. package/marketplace/outcome.js +29 -0
  52. package/marketplace/outcome.js.map +1 -0
  53. package/marketplace/read-marketplace.d.ts +34 -0
  54. package/marketplace/read-marketplace.d.ts.map +1 -0
  55. package/marketplace/read-marketplace.js +359 -0
  56. package/marketplace/read-marketplace.js.map +1 -0
  57. package/messages.d.ts +25 -9
  58. package/messages.d.ts.map +1 -1
  59. package/messages.js +24 -8
  60. package/messages.js.map +1 -1
  61. package/outcome.d.ts +13 -6
  62. package/outcome.d.ts.map +1 -1
  63. package/package.json +8 -2
  64. package/src/__test-utils__/read.ts +4 -4
  65. package/src/__tests__/client-ignore.test.ts +133 -0
  66. package/src/__tests__/client-refs.test.ts +101 -0
  67. package/src/__tests__/client-select-archive.test.ts +152 -0
  68. package/src/__tests__/fixtures/cursor-plugins/.cursor-plugin/marketplace.json +412 -0
  69. package/src/__tests__/fixtures/cursor-plugins/NOTICE +5 -0
  70. package/src/__tests__/marketplace.test.ts +373 -0
  71. package/src/client/archive.ts +44 -0
  72. package/src/client/ignore/defaults.ts +155 -0
  73. package/src/client/ignore/match.ts +158 -0
  74. package/src/client/ignore/matcher.ts +156 -0
  75. package/src/client/ignore/pattern.ts +131 -0
  76. package/src/client/refs.ts +170 -0
  77. package/src/client/select.ts +161 -0
  78. package/src/client/vocabulary.ts +19 -0
  79. package/src/client.ts +67 -0
  80. package/src/files.ts +6 -0
  81. package/src/index.ts +21 -5
  82. package/src/marketplace/messages.ts +62 -0
  83. package/src/marketplace/outcome.ts +95 -0
  84. package/src/marketplace/read-marketplace.ts +402 -0
  85. package/src/messages.ts +34 -21
  86. package/src/outcome.ts +14 -6
package/client.js ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `@stigmer/plugin-package/client`: what every client that installs a
3
+ * plugin does identically.
4
+ *
5
+ * The main entry reads a package; this entry is for the client that holds
6
+ * a tree and must turn it into the push the server expects. Two clients do
7
+ * that today, the CLI from a directory and the console from a marketplace
8
+ * host's file list, and a plugin installed from either must have one
9
+ * digest for one tree, be refused with one sentence for one mistake, and be
10
+ * described in one vocabulary. So the pieces live here, once:
11
+ *
12
+ * - the gitignore-compatible ignore engine and the security defaults
13
+ * (`ignore/`), pure over the text of the ignore files;
14
+ * - the selection rule (`select.ts`): which files a push carries, in the
15
+ * order the CLI's original walk produced them;
16
+ * - the archive and its digest (`archive.ts`): the deterministic zip and
17
+ * the SHA-256 the server records;
18
+ * - the grammars (`refs.ts`): an install ref and a GitHub marketplace
19
+ * source, with their refusal sentences;
20
+ * - the vocabulary (`vocabulary.ts`): the labels both surfaces print.
21
+ *
22
+ * Nothing here touches the filesystem, the network or any `node:*` module.
23
+ * A client's edge (a directory walk, a fetch) produces the candidates and
24
+ * the bytes; this entry decides what becomes of them.
25
+ */
26
+ export { DEFAULT_PATTERNS } from "./client/ignore/defaults.js";
27
+ export { matchName } from "./client/ignore/match.js";
28
+ export { Matcher, Reason, REASON_TEXT, SOURCE_CLI, SOURCE_DEFAULTS, SOURCE_GITIGNORE, SOURCE_STIGMERIGNORE, buildMatcher, } from "./client/ignore/matcher.js";
29
+ export { MatchResult, parsePattern } from "./client/ignore/pattern.js";
30
+ export { IGNORE_FILE_NAMES, compareWalkOrder, selectPluginFiles, } from "./client/select.js";
31
+ export { DETERMINISTIC_ZIP_MTIME, archivePlugin, digestArchive } from "./client/archive.js";
32
+ export { GITHUB_SOURCE_SHAPE, INSTALL_REF_SHAPE, OFFICIAL_MARKETPLACE_NAME, describeGitHubSource, formatInstallRef, isOwnerRepo, looksLikePath, parseGitHubSource, parseInstallRef, } from "./client/refs.js";
33
+ export { DIALECT_LABELS } from "./client/vocabulary.js";
34
+ //# sourceMappingURL=client.js.map
package/client.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAGL,OAAO,EACP,MAAM,EACN,WAAW,EACX,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAgB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAKL,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAKL,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
package/files.d.ts CHANGED
@@ -54,6 +54,12 @@ export declare const PLUGIN_DOCUMENT_LIMITS: {
54
54
  readonly subAgent: number;
55
55
  /** A document under `ai.stigmer/`: a resource YAML. */
56
56
  readonly overlay: number;
57
+ /**
58
+ * A marketplace file in any dialect. The largest public catalogue
59
+ * (`cursor/plugins`, 79 entries with descriptions) is under 32 KB; the cap
60
+ * leaves room for catalogues an order of magnitude larger.
61
+ */
62
+ readonly marketplace: number;
57
63
  };
58
64
  export type PluginDocumentClass = keyof typeof PLUGIN_DOCUMENT_LIMITS;
59
65
  /** An in-memory `PluginFiles` over path -> content; the testing builders' product. */
package/files.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"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EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,kDAAkD;AAClD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED,uEAAuE;AACvE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAGd,QAAQ,CAAC,KAAK,EAAE,WAAW;IAFvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;gBAEzC,KAAK,EAAE,WAAW;IAIvC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIhD,wGAAwG;IACxG,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE;IAM1C,qDAAqD;IACrD,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMjC,6EAA6E;IAC7E,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE;IAYhD,0DAA0D;IAC1D,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE;CAU3C"}
package/files.js CHANGED
@@ -41,6 +41,12 @@ export const PLUGIN_DOCUMENT_LIMITS = {
41
41
  subAgent: 1024 * 1024,
42
42
  /** A document under `ai.stigmer/`: a resource YAML. */
43
43
  overlay: 1024 * 1024,
44
+ /**
45
+ * A marketplace file in any dialect. The largest public catalogue
46
+ * (`cursor/plugins`, 79 entries with descriptions) is under 32 KB; the cap
47
+ * leaves room for catalogues an order of magnitude larger.
48
+ */
49
+ marketplace: 1024 * 1024,
44
50
  };
45
51
  const encoder = new TextEncoder();
46
52
  // `fatal: false` keeps the decoder from throwing on a malformed sequence: a
package/files.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA;;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face.
3
3
  *
4
- * `readPluginPackage` is the entry; everything else here is what a consumer
5
- * needs to supply its input (`PluginFiles`, the caps), route a directory
6
- * (`MANIFEST_LOCATIONS`, `hasPluginManifest`), or render the outcome (the
7
- * finding kinds and `isErrorKind`). The dialect readers and normalisers are
8
- * internal: a consumer never composes a partial read.
4
+ * `readPluginPackage` reads one plugin; `readMarketplace` reads a catalogue
5
+ * of them. Everything else here is what a consumer needs to supply its
6
+ * input (`PluginFiles`, the caps), route a directory (`MANIFEST_LOCATIONS`,
7
+ * `hasPluginManifest`, `MARKETPLACE_LOCATIONS`, `hasMarketplaceFile`), or
8
+ * render an outcome (the finding kinds and `isErrorKind`). The dialect
9
+ * readers and normalisers are internal: a consumer never composes a partial
10
+ * read.
9
11
  */
10
12
  export { hasPluginManifest, isValidPluginName } from "./detect.js";
11
13
  export { comparePaths, inMemoryPluginFiles, isContainedPath, PLUGIN_DOCUMENT_LIMITS, resolveDeclaredPath, type DeclaredPathOutcome, type PluginDocumentClass, type PluginFileEntry, type PluginFiles, } from "./files.js";
@@ -13,7 +15,10 @@ export { SKILL_NAME_PATTERN } from "./frontmatter.js";
13
15
  export { AGENT_PLUGINS_MANIFEST_SCHEMA, AGENT_PLUGINS_MCP_SCHEMA, errorMessage, isErrorKind, MANIFEST_LOCATIONS, warningMessage, } from "./messages.js";
14
16
  export { SUB_AGENT_INSTRUCTIONS_MIN, classifyModel } from "./normalise/sub-agents.js";
15
17
  export { PLACEHOLDER_PATTERN, VARIABLE_NAME_PATTERN } from "./placeholders.js";
16
- export type { FindingContext, PluginErrorKind, PluginFinding, PluginFindingKind, PluginReadOutcome, PluginWarningKind, } from "./outcome.js";
18
+ export type { Finding, FindingContext, PluginErrorKind, PluginFinding, PluginFindingKind, PluginReadOutcome, PluginWarningKind, } from "./outcome.js";
19
+ export { MARKETPLACE_LOCATIONS } from "./marketplace/messages.js";
20
+ export type { Marketplace, MarketplaceDialect, MarketplaceEntry, MarketplaceErrorKind, MarketplaceFinding, MarketplaceFindingKind, MarketplaceOwner, MarketplaceReadOutcome, MarketplaceWarningKind, } from "./marketplace/outcome.js";
21
+ export { hasMarketplaceFile, readMarketplace } from "./marketplace/read-marketplace.js";
17
22
  export { readPluginPackage } from "./read-plugin-package.js";
18
23
  export type { IgnoredComponent, IgnoredComponentKind, ModelAlias, ModelHint, OverlayDocument, OverlayNamedDocument, OverlayServerDocument, PluginAuthor, PluginDialect, PluginMcpServer, PluginPackage, PluginSkill, PluginSubAgent, PluginVariable, StigmerOverlay, } from "./types.js";
19
24
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,YAAY,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,YAAY,EACV,OAAO,EACP,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
package/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * `@stigmer/plugin-package`: the public surface.
3
3
  *
4
- * `readPluginPackage` is the entry; everything else here is what a consumer
5
- * needs to supply its input (`PluginFiles`, the caps), route a directory
6
- * (`MANIFEST_LOCATIONS`, `hasPluginManifest`), or render the outcome (the
7
- * finding kinds and `isErrorKind`). The dialect readers and normalisers are
8
- * internal: a consumer never composes a partial read.
4
+ * `readPluginPackage` reads one plugin; `readMarketplace` reads a catalogue
5
+ * of them. Everything else here is what a consumer needs to supply its
6
+ * input (`PluginFiles`, the caps), route a directory (`MANIFEST_LOCATIONS`,
7
+ * `hasPluginManifest`, `MARKETPLACE_LOCATIONS`, `hasMarketplaceFile`), or
8
+ * render an outcome (the finding kinds and `isErrorKind`). The dialect
9
+ * readers and normalisers are internal: a consumer never composes a partial
10
+ * read.
9
11
  */
10
12
  export { hasPluginManifest, isValidPluginName } from "./detect.js";
11
13
  export { comparePaths, inMemoryPluginFiles, isContainedPath, PLUGIN_DOCUMENT_LIMITS, resolveDeclaredPath, } from "./files.js";
@@ -13,5 +15,7 @@ export { SKILL_NAME_PATTERN } from "./frontmatter.js";
13
15
  export { AGENT_PLUGINS_MANIFEST_SCHEMA, AGENT_PLUGINS_MCP_SCHEMA, errorMessage, isErrorKind, MANIFEST_LOCATIONS, warningMessage, } from "./messages.js";
14
16
  export { SUB_AGENT_INSTRUCTIONS_MIN, classifyModel } from "./normalise/sub-agents.js";
15
17
  export { PLACEHOLDER_PATTERN, VARIABLE_NAME_PATTERN } from "./placeholders.js";
18
+ export { MARKETPLACE_LOCATIONS } from "./marketplace/messages.js";
19
+ export { hasMarketplaceFile, readMarketplace } from "./marketplace/read-marketplace.js";
16
20
  export { readPluginPackage } from "./read-plugin-package.js";
17
21
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,GAKpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAS/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,GAKpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAU/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAYlE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The one sentence for every marketplace finding kind, and the collector
3
+ * bound to them.
4
+ *
5
+ * The same rule as the plugin vocabulary: copy lives here and nowhere else,
6
+ * the CLI prints these sentences verbatim, and the `Record` types are
7
+ * exhaustive so a kind without a sentence does not compile. The four
8
+ * locations are named in the not-found sentence because that is the one an
9
+ * author meets first when a file sits in the wrong place (Claude Code's own
10
+ * issue tracker shows how often).
11
+ */
12
+ import { FindingCollector } from "../messages.js";
13
+ import type { MarketplaceDialect, MarketplaceErrorKind, MarketplaceWarningKind } from "./outcome.js";
14
+ /** The four marketplace file locations, in the precedence the reader applies. */
15
+ export declare const MARKETPLACE_LOCATIONS: Readonly<Record<MarketplaceDialect, string>>;
16
+ /** The marketplace reader's collector, bound to the marketplace vocabulary. */
17
+ export declare class MarketplaceFindings extends FindingCollector<MarketplaceErrorKind, MarketplaceWarningKind> {
18
+ constructor();
19
+ }
20
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/marketplace/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAM,gBAAgB,EAAoB,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAErG,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAK9E,CAAC;AAmCF,+EAA+E;AAC/E,qBAAa,mBAAoB,SAAQ,gBAAgB,CAAC,oBAAoB,EAAE,sBAAsB,CAAC;;CAItG"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The one sentence for every marketplace finding kind, and the collector
3
+ * bound to them.
4
+ *
5
+ * The same rule as the plugin vocabulary: copy lives here and nowhere else,
6
+ * the CLI prints these sentences verbatim, and the `Record` types are
7
+ * exhaustive so a kind without a sentence does not compile. The four
8
+ * locations are named in the not-found sentence because that is the one an
9
+ * author meets first when a file sits in the wrong place (Claude Code's own
10
+ * issue tracker shows how often).
11
+ */
12
+ import { at, FindingCollector, q } from "../messages.js";
13
+ /** The four marketplace file locations, in the precedence the reader applies. */
14
+ export const MARKETPLACE_LOCATIONS = {
15
+ stigmer: "marketplace.json",
16
+ claude: ".claude-plugin/marketplace.json",
17
+ cursor: ".cursor-plugin/marketplace.json",
18
+ codex: ".agents/plugins/marketplace.json",
19
+ };
20
+ const locationList = Object.values(MARKETPLACE_LOCATIONS)
21
+ .map((location) => q(location))
22
+ .join(", ");
23
+ const ERROR_MESSAGES = {
24
+ "marketplace-not-found": () => `no marketplace file found: expected one of ${locationList}`,
25
+ "marketplace-too-large": (c) => `${q(c.path)} is ${c.subject ?? ""} bytes, above the ${c.detail ?? ""} byte cap for a marketplace file`,
26
+ "marketplace-unreadable": (c) => `${q(c.path)} is not a readable marketplace file: ${c.detail ?? "parse error"}`,
27
+ "marketplace-field-type": (c) => `${q(c.path)} field ${q(c.subject)} must be ${c.detail ?? "of another type"}`,
28
+ "marketplace-name-missing": (c) => `${q(c.path)} has no 'name'; a marketplace needs one so its plugins can be addressed as '<marketplace>/<plugin>'`,
29
+ "marketplace-name-invalid": (c) => `${q(c.path)} name ${q(c.subject)} is invalid: 1 to 64 characters of a-z, 0-9, '-' and '.', starting and ending alphanumeric, no '--' or '..'`,
30
+ "marketplace-plugins-missing": (c) => `${q(c.path)} has no 'plugins' list`,
31
+ "entry-shape": (c) => `${q(c.path)} plugins[${c.subject ?? ""}] must be an object with 'name' and 'source'`,
32
+ "entry-name-missing": (c) => `${q(c.path)} plugins[${c.subject ?? ""}] has no 'name'`,
33
+ "entry-name-invalid": (c) => `${q(c.path)} plugin ${q(c.subject)} has an invalid name: 1 to 64 characters of a-z, 0-9, '-' and '.', starting and ending alphanumeric, no '--' or '..'`,
34
+ "entry-name-duplicate": (c) => `${q(c.path)} lists plugin ${q(c.subject)} more than once; 'install ${c.subject ?? ""}' would be ambiguous`,
35
+ "entry-source-missing": (c) => `${q(c.path)} plugin ${q(c.subject)} has no 'source'`,
36
+ "entry-source-escapes-root": (c) => `${q(c.path)} plugin ${q(c.subject)} has source ${q(c.detail)} outside the marketplace root; a source is a directory inside the marketplace`,
37
+ "default-unknown": (c) => `${q(c.path)} names ${q(c.subject)} as a default but lists no plugin of that name`,
38
+ };
39
+ const WARNING_MESSAGES = {
40
+ "entry-source-unsupported": (c) => `plugin ${q(c.subject)}${at(c.path)} has source ${q(c.detail)}, a form Stigmer does not fetch (only a directory inside the marketplace); not offered`,
41
+ "entry-directory-missing": (c) => `plugin ${q(c.subject)}${at(c.path)} names directory ${q(c.detail)}, which the marketplace does not contain; not offered`,
42
+ "entry-not-a-plugin": (c) => `plugin ${q(c.subject)}${at(c.path)} names directory ${q(c.detail)}, which holds no plugin manifest; not offered`,
43
+ };
44
+ /** The marketplace reader's collector, bound to the marketplace vocabulary. */
45
+ export class MarketplaceFindings extends FindingCollector {
46
+ constructor() {
47
+ super(ERROR_MESSAGES, WARNING_MESSAGES);
48
+ }
49
+ }
50
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/marketplace/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,EAAiB,MAAM,gBAAgB,CAAC;AAGxE,iFAAiF;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAi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C,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,wFAAwF;IACvJ,yBAAyB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC/B,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,uDAAuD;IAC3H,oBAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC1B,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,+CAA+C;CACpH,CAAC;AAEF,+EAA+E;AAC/E,MAAM,OAAO,mBAAoB,SAAQ,gBAA8D;IACrG;QACE,KAAK,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * What a marketplace is once read, and the closed vocabulary of findings a
3
+ * marketplace read can produce.
4
+ *
5
+ * A marketplace is a directory tree with a marketplace file that lists the
6
+ * plugins it offers, each as a name and a directory inside the tree. That is
7
+ * the convention Cursor (`.cursor-plugin/marketplace.json`), Claude Code
8
+ * (`.claude-plugin/marketplace.json`) and Codex (`.agents/plugins/
9
+ * marketplace.json`) already publish, and the agent-plugins.org
10
+ * specification leaves marketplaces client-owned, so there is no open
11
+ * format to defer to; Stigmer's own file sits at the tree root as
12
+ * `marketplace.json`, the position the open plugin manifest takes. The four
13
+ * dialects reduce to one shape here: a client that can read this shape can
14
+ * install from any of the four catalogues.
15
+ *
16
+ * Two error postures, stated as the plugin reader states them. A marketplace
17
+ * FILE that is broken (unreadable, unnamed, no plugin list, a source that
18
+ * escapes the tree, two entries with one name) refuses the marketplace: a
19
+ * catalogue that cannot be trusted as a whole is not offered at all. An
20
+ * ENTRY that cannot be installed (a source form this reader does not fetch,
21
+ * a directory the tree does not hold, a directory with no plugin manifest)
22
+ * is dropped with a warning: a user adding a public catalogue of eighty
23
+ * plugins should still see the seventy-nine that work, and a catalogue's
24
+ * own static suite asserts zero warnings so the publisher hears about the
25
+ * one. Every kind has exactly one sentence in `messages.ts` and exactly one
26
+ * adversarial fixture.
27
+ */
28
+ import type { Finding } from "../outcome.js";
29
+ /** The marketplace file dialects, in the precedence the reader applies. */
30
+ export type MarketplaceDialect = "stigmer" | "claude" | "cursor" | "codex";
31
+ export type MarketplaceErrorKind = "marketplace-not-found" | "marketplace-too-large" | "marketplace-unreadable" | "marketplace-field-type" | "marketplace-name-missing" | "marketplace-name-invalid" | "marketplace-plugins-missing" | "entry-shape" | "entry-name-missing" | "entry-name-invalid" | "entry-name-duplicate" | "entry-source-missing" | "entry-source-escapes-root" | "default-unknown";
32
+ export type MarketplaceWarningKind = "entry-source-unsupported" | "entry-directory-missing" | "entry-not-a-plugin";
33
+ export type MarketplaceFindingKind = MarketplaceErrorKind | MarketplaceWarningKind;
34
+ export type MarketplaceFinding = Finding<MarketplaceFindingKind>;
35
+ export interface MarketplaceOwner {
36
+ readonly name?: string;
37
+ readonly email?: string;
38
+ readonly url?: string;
39
+ }
40
+ /** One installable plugin the marketplace offers. */
41
+ export interface MarketplaceEntry {
42
+ /** The name a user installs it by; unique within the marketplace. */
43
+ readonly name: string;
44
+ /** The plugin's directory, marketplace-relative with no leading `./`; the empty string is the tree root. */
45
+ readonly dir: string;
46
+ /** The catalogue's own one-line description, when the file carries one. */
47
+ readonly description?: string;
48
+ }
49
+ export interface Marketplace {
50
+ /** The marketplace's identifier, the prefix in `install <marketplace>/<plugin>`. */
51
+ readonly name: string;
52
+ readonly description?: string;
53
+ readonly owner?: MarketplaceOwner;
54
+ /** The dialect whose file named the marketplace. */
55
+ readonly dialect: MarketplaceDialect;
56
+ /** The marketplace file that was read, tree-relative. */
57
+ readonly path: string;
58
+ /** Installable entries, in the file's order; entries the reader dropped are in the warnings. */
59
+ readonly plugins: readonly MarketplaceEntry[];
60
+ /** Entry names a client bootstraps with, in install order; empty when the file names none. */
61
+ readonly defaults: readonly string[];
62
+ }
63
+ export type MarketplaceReadOutcome = {
64
+ readonly ok: true;
65
+ readonly marketplace: Marketplace;
66
+ readonly warnings: readonly MarketplaceFinding[];
67
+ } | {
68
+ readonly ok: false;
69
+ readonly errors: readonly MarketplaceFinding[];
70
+ readonly warnings: readonly MarketplaceFinding[];
71
+ };
72
+ //# sourceMappingURL=outcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../src/marketplace/outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAE5B,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,GACxB,wBAAwB,GACxB,0BAA0B,GAC1B,0BAA0B,GAC1B,6BAA6B,GAE7B,aAAa,GACb,oBAAoB,GACpB,oBAAoB,GACpB,sBAAsB,GACtB,sBAAsB,GACtB,2BAA2B,GAE3B,iBAAiB,CAAC;AAEtB,MAAM,MAAM,sBAAsB,GAC9B,0BAA0B,GAC1B,yBAAyB,GACzB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAEnF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAClC,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,8FAA8F;IAC9F,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,GAC1G;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * What a marketplace is once read, and the closed vocabulary of findings a
3
+ * marketplace read can produce.
4
+ *
5
+ * A marketplace is a directory tree with a marketplace file that lists the
6
+ * plugins it offers, each as a name and a directory inside the tree. That is
7
+ * the convention Cursor (`.cursor-plugin/marketplace.json`), Claude Code
8
+ * (`.claude-plugin/marketplace.json`) and Codex (`.agents/plugins/
9
+ * marketplace.json`) already publish, and the agent-plugins.org
10
+ * specification leaves marketplaces client-owned, so there is no open
11
+ * format to defer to; Stigmer's own file sits at the tree root as
12
+ * `marketplace.json`, the position the open plugin manifest takes. The four
13
+ * dialects reduce to one shape here: a client that can read this shape can
14
+ * install from any of the four catalogues.
15
+ *
16
+ * Two error postures, stated as the plugin reader states them. A marketplace
17
+ * FILE that is broken (unreadable, unnamed, no plugin list, a source that
18
+ * escapes the tree, two entries with one name) refuses the marketplace: a
19
+ * catalogue that cannot be trusted as a whole is not offered at all. An
20
+ * ENTRY that cannot be installed (a source form this reader does not fetch,
21
+ * a directory the tree does not hold, a directory with no plugin manifest)
22
+ * is dropped with a warning: a user adding a public catalogue of eighty
23
+ * plugins should still see the seventy-nine that work, and a catalogue's
24
+ * own static suite asserts zero warnings so the publisher hears about the
25
+ * one. Every kind has exactly one sentence in `messages.ts` and exactly one
26
+ * adversarial fixture.
27
+ */
28
+ export {};
29
+ //# sourceMappingURL=outcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../src/marketplace/outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The marketplace entry: a `PluginFiles` over a marketplace tree in, a
3
+ * `MarketplaceReadOutcome` out.
4
+ *
5
+ * The read is a fixed sequence, like the plugin read: locate the marketplace
6
+ * file (first present in the dialect precedence, and only that one is read;
7
+ * a tree that carries two dialects' files describes one catalogue twice);
8
+ * parse it under the marketplace cap; read the dialect's shape into the one
9
+ * normalised shape; validate names and sources; drop the entries the tree
10
+ * cannot install, each with its own warning; resolve the defaults. Findings
11
+ * are collected and the read continues, so the outcome names every problem
12
+ * at once, and the marketplace is returned only when nothing refused.
13
+ *
14
+ * Sources. Every dialect names a plugin's directory relative to the
15
+ * marketplace root (Claude and Codex with a `./` prefix, Cursor without,
16
+ * Claude optionally under `metadata.pluginRoot`); the reader accepts both
17
+ * spellings and refuses a path that escapes the root. A source that is not
18
+ * such a directory (Claude's `github`, `url`, `npm` and `git-subdir` objects,
19
+ * Codex's non-`local` sources, Cursor's remote URLs) is a form this reader
20
+ * does not fetch: the entry is dropped with `entry-source-unsupported`, and
21
+ * nothing is invented in its place.
22
+ *
23
+ * This reader does not open the plugins it lists. A consumer that wants an
24
+ * entry's own description or version reads that directory with
25
+ * `readPluginPackage`; a consumer that wants to install it hands the same
26
+ * directory to the walker it already uses. Keeping the two reads apart is
27
+ * what lets a catalogue of eighty entries be listed without eighty reads.
28
+ */
29
+ import { type PluginFiles } from "../files.js";
30
+ import type { MarketplaceReadOutcome } from "./outcome.js";
31
+ /** True when the tree holds any of the four marketplace files; the CLI's routing test. */
32
+ export declare function hasMarketplaceFile(paths: Iterable<string>): boolean;
33
+ export declare function readMarketplace(files: PluginFiles): MarketplaceReadOutcome;
34
+ //# sourceMappingURL=read-marketplace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-marketplace.d.ts","sourceRoot":"","sources":["../../src/marketplace/read-marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAwE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAErH,OAAO,KAAK,EAAuE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAQhI,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAInE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,sBAAsB,CAiC1E"}