@s2script/sdk 0.27.1 → 0.29.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s2script/sdk",
3
- "version": "0.27.1",
3
+ "version": "0.29.0",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "description": "s2script SDK — the builtin capability types (imported as @s2script/sdk/entity, …) plus the `s2s` CLI for building Source 2 / CS2 plugins.",
6
6
  "type": "module",
@@ -21,6 +21,8 @@
21
21
  "devDependencies": {
22
22
  "@clack/prompts": "^1.7.0",
23
23
  "fflate": "^0.8.2",
24
+ "ignore": "^5.3.2",
25
+ "minimatch": "^10.2.6",
24
26
  "semver": "^7.8.5"
25
27
  },
26
28
  "publishConfig": {
package/phrases.d.ts CHANGED
@@ -23,7 +23,7 @@
23
23
  * unresolved key renders as the key itself, so it should still read as a sentence.
24
24
  *
25
25
  * ```json
26
- * { "Gagged Player": "{green}[SM]{default} Gagged {1} player." }
26
+ * { "Gagged Player": "{green}[S2S]{default} Gagged {1} player." }
27
27
  * ```
28
28
  *
29
29
  * A translator adds `translations/<code>/<your-plugin>.phrases.json` — no code change, no rebuild.
package/plugins.d.ts CHANGED
@@ -16,6 +16,10 @@ export interface PluginInfo {
16
16
  * - `"unloaded"` — on disk but manually unloaded via `unload` (not auto-reloaded until `load`/`reload`).
17
17
  */
18
18
  readonly state: "running" | "loading" | "waiting" | "failed" | "unloaded";
19
+ /** The folder under `plugins/` (e.g. `"disabled"`, `"fun"`) this plugin was loaded from by
20
+ * {@link Plugins.load} for this run only — it stays there on disk, so a restart leaves it off.
21
+ * null for a plugin loaded from `plugins/` itself. */
22
+ readonly folder: string | null;
19
23
  }
20
24
  /**
21
25
  * Enumerate and drive the plugin set at runtime (list / load / unload / reload).
@@ -32,6 +36,32 @@ export declare const Plugins: {
32
36
  unload(id: string): boolean;
33
37
  /** Reload a plugin (unload + load from disk, deferred). false if the id is unknown. */
34
38
  reload(id: string): boolean;
35
- /** Load a previously-unloaded plugin (deferred). false if it isn't currently unloaded. */
39
+ /**
40
+ * Load a plugin that isn't running (deferred): one unloaded earlier this run, by id — or, as
41
+ * `"<folder>/<plugin id>"` (e.g. `"fun/@edgegamers/jailbreak"`, `"disabled/@edge/rtv"`), one kept
42
+ * in any folder under `plugins/`, for THIS RUN ONLY. Only a folder prefix reaches into a folder;
43
+ * the id is mapped to its file for you; nothing outside `plugins/` is reachable. The file stays
44
+ * where it is (a restart leaves it off; for disabled/ plugins, `enable` makes it permanent).
45
+ * false if there is no such plugin. `unload` accepts the same `<folder>/<plugin id>` form.
46
+ */
36
47
  load(id: string): boolean;
48
+ /**
49
+ * Add registry plugins to the server's `addons/s2script/plugins.json` and install them with their
50
+ * dependencies (`sm plugins install`). A bare name records `^<latest>`; `name@range` records the
51
+ * range. `with` names optional members of the ONE bundle given. The files land in `plugins/`,
52
+ * where the loader picks them up — or, with `disabled`, in `plugins/disabled/`, where it never
53
+ * looks (kept current at startup, loaded once enabled). Resolves with report lines; rejects with
54
+ * the reason.
55
+ */
56
+ install(names: string[], opts?: { with?: string[]; disabled?: boolean }): Promise<string[]>;
57
+ /** Move the named plugins (all when omitted) to the newest version their plugins.json range allows. */
58
+ update(names?: string[]): Promise<string[]>;
59
+ /** Drop plugins from plugins.json; their files are removed (unless edited by hand) and unloaded. */
60
+ remove(names: string[]): Promise<string[]>;
61
+ /** One line per plugins.json dependency: current, wanted (newest in range) and latest version. */
62
+ outdated(): Promise<string[]>;
63
+ /** Move installed plugins out of plugins/disabled/ (they load) and record it in plugins.json. */
64
+ enable(names: string[]): Promise<string[]>;
65
+ /** Move installed plugins into plugins/disabled/ (they unload, and stay off across restarts). */
66
+ disable(names: string[]): Promise<string[]>;
37
67
  };
package/unsafe.d.ts CHANGED
@@ -5,9 +5,9 @@
5
5
  * UNSAFE by design. A declared call reaches a real engine function; a declared hook patches
6
6
  * that function's prologue. The framework validates every descriptor at load and degrades a
7
7
  * failure to `null`, but it cannot prove your signature or vtable index names the function you
8
- * meant. Calls require manifest `permissions: ["engine:calls"]`; hooks require the separate
9
- * `"engine:hooks"` permission. Both also need an operator allow-list entry
10
- * (see docs/superpowers/specs/2026-07-24-plugin-gamedata-design.md §6 and ARCHITECTURE.md §2.0.7).
8
+ * meant. `s2s build` records `engine:calls` / `engine:hooks` in the manifest from your gamedata so
9
+ * `s2s inspect` and the registry can show what the plugin reaches into; nothing to declare by hand
10
+ * (see docs/superpowers/specs/2026-07-24-plugin-gamedata-design.md and ARCHITECTURE.md §2.0.7).
11
11
  */
12
12
 
13
13
  /**