@hncode/hncode-sdk 0.7.1 → 0.7.2
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 +5 -5
- package/package.json +1 -1
- package/targets.d.ts +2 -1
- package/targets.js +2 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @hncode/hncode-sdk
|
|
2
2
|
|
|
3
|
-
Types and runtime helpers for writing [
|
|
3
|
+
Types and runtime helpers for writing [HNCode](https://npmjs.com/package/@hncode/hncode) plugins.
|
|
4
4
|
|
|
5
|
-
A plugin runs **inside** the
|
|
6
|
-
hands you the `api` object. So a plugin never imports
|
|
5
|
+
A plugin runs **inside** the HNCode process: the host calls your `install(api)` and
|
|
6
|
+
hands you the `api` object. So a plugin never imports HNCode itself — but at author
|
|
7
7
|
time you want completion for `api.` and, for `api.patch`, the list of symbols you
|
|
8
8
|
may target. That is what this package provides.
|
|
9
9
|
|
|
@@ -58,10 +58,10 @@ const plugin: HncodePlugin = {
|
|
|
58
58
|
export default plugin;
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
## Patching
|
|
61
|
+
## Patching HNCode's own code
|
|
62
62
|
|
|
63
63
|
`api.patch(target, handler)` wraps an exported function or class method in
|
|
64
|
-
|
|
64
|
+
HNCode's `src/` without editing it (the equivalent of a Minecraft mixin).
|
|
65
65
|
|
|
66
66
|
```js
|
|
67
67
|
import { isPatchTarget } from '@hncode/hncode-sdk/targets';
|
package/package.json
CHANGED
package/targets.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// GENERATED by scripts/gen-targets.mjs — do not edit by hand.
|
|
2
|
-
//
|
|
2
|
+
// 857 patchable symbols across 78 files.
|
|
3
3
|
|
|
4
4
|
/** A symbol a plugin may pass to `api.patch(target, handler)`. */
|
|
5
5
|
export type PatchTarget =
|
|
@@ -390,6 +390,7 @@ export type PatchTarget =
|
|
|
390
390
|
| "prompt-presets.js#PROMPT_PRESETS"
|
|
391
391
|
| "prompt-presets.js#TASKS"
|
|
392
392
|
| "ptc.js#CALLABLE_TOOLS"
|
|
393
|
+
| "ptc.js#callableTools"
|
|
393
394
|
| "ptc.js#DEFAULT_LIMITS"
|
|
394
395
|
| "ptc.js#runProgrammatic"
|
|
395
396
|
| "registry-browser.js#handleRegistryBrowserKey"
|
package/targets.js
CHANGED
|
@@ -392,6 +392,7 @@ export const PATCH_TARGETS = [
|
|
|
392
392
|
"prompt-presets.js#PROMPT_PRESETS",
|
|
393
393
|
"prompt-presets.js#TASKS",
|
|
394
394
|
"ptc.js#CALLABLE_TOOLS",
|
|
395
|
+
"ptc.js#callableTools",
|
|
395
396
|
"ptc.js#DEFAULT_LIMITS",
|
|
396
397
|
"ptc.js#runProgrammatic",
|
|
397
398
|
"registry-browser.js#handleRegistryBrowserKey",
|
|
@@ -869,4 +870,4 @@ export const PATCH_TARGET_SET = new Set(PATCH_TARGETS);
|
|
|
869
870
|
/** True when `target` names a real, patchable symbol. */
|
|
870
871
|
export function isPatchTarget(target) { return PATCH_TARGET_SET.has(String(target)); }
|
|
871
872
|
|
|
872
|
-
export const GENERATED_FROM = "hncode src/ (78 files,
|
|
873
|
+
export const GENERATED_FROM = "hncode src/ (78 files, 857 symbols)";
|