@hasna/skills 0.10.82 → 0.10.88
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 +133 -15
- package/bin/index.js +5691 -2868
- package/bin/mcp.js +1689 -810
- package/bin/migrate.js +1 -1
- package/bin/server.js +1 -1
- package/bin/worker.js +1 -1
- package/dist/cli/commands/agent-integration.d.ts +35 -0
- package/dist/cli/commands/context.d.ts +4 -0
- package/dist/cli/commands/runtime-launcher.d.ts +4 -9
- package/dist/index.js +3022 -1530
- package/dist/lib/agent-adapters.d.ts +5 -2
- package/dist/lib/agent-discovery.d.ts +22 -4
- package/dist/lib/agent-hermes.d.ts +7 -1
- package/dist/lib/agent-integration.d.ts +31 -2
- package/dist/lib/agent-opencode.d.ts +4 -0
- package/dist/lib/claude-hook-disable.d.ts +32 -0
- package/dist/lib/claude-settings-witness.d.ts +28 -0
- package/dist/lib/codex-settings-witness.d.ts +20 -0
- package/dist/lib/guarded-agent-config.d.ts +3 -0
- package/dist/lib/hook-diagnostics.d.ts +3 -1
- package/dist/lib/narrowed-witness-ledger.d.ts +24 -0
- package/dist/lib/native-discovery-roots.d.ts +8 -0
- package/dist/lib/native-drift-receipt.d.ts +55 -0
- package/dist/lib/opencode-hook-protocol.d.ts +5 -0
- package/dist/lib/profile-client.d.ts +1 -0
- package/dist/lib/selection-cache.d.ts +47 -2
- package/dist/lib/session-background-renewal.d.ts +118 -0
- package/dist/lib/session-reconciliation.d.ts +82 -2
- package/dist/lib/skill-context.d.ts +39 -1
- package/dist/lib/skill-relevance.d.ts +95 -0
- package/dist/runtime-prerequisites.js +570 -165
- package/dist/sdk/index.js +2627 -1396
- package/docs/plugin-admission.md +132 -3
- package/package.json +1 -1
package/bin/migrate.js
CHANGED
package/bin/server.js
CHANGED
|
@@ -24140,7 +24140,7 @@ restoreLaunchCwd();
|
|
|
24140
24140
|
// package.json
|
|
24141
24141
|
var package_default = {
|
|
24142
24142
|
name: "@hasna/skills",
|
|
24143
|
-
version: "0.10.
|
|
24143
|
+
version: "0.10.88",
|
|
24144
24144
|
description: "Skills library for AI coding agents",
|
|
24145
24145
|
type: "module",
|
|
24146
24146
|
bin: {
|
package/bin/worker.js
CHANGED
|
@@ -24143,7 +24143,7 @@ import { randomUUID as randomUUID6 } from "crypto";
|
|
|
24143
24143
|
// package.json
|
|
24144
24144
|
var package_default = {
|
|
24145
24145
|
name: "@hasna/skills",
|
|
24146
|
-
version: "0.10.
|
|
24146
|
+
version: "0.10.88",
|
|
24147
24147
|
description: "Skills library for AI coding agents",
|
|
24148
24148
|
type: "module",
|
|
24149
24149
|
bin: {
|
|
@@ -1,2 +1,37 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
|
+
import { type IntegrationAgent } from "../../lib/agent-integration.js";
|
|
3
|
+
/**
|
|
4
|
+
* Characters one managed hook's additionalContext carries at most (owner
|
|
5
|
+
* request 2026-10-30: one prompt received 10-60 KB of skill bodies). The cap
|
|
6
|
+
* covers the whole injected text: skill bodies get the cap less a fixed
|
|
7
|
+
* reserve for the loading policy, notices and `skills load` offers, and the
|
|
8
|
+
* assembled text is clamped to the cap. A body that does not fit is offered as
|
|
9
|
+
* its `skills load` command instead of being injected. Operators may lower it
|
|
10
|
+
* with SKILLS_HOOK_CONTEXT_MAX_CHARS in the agent's environment, never raise it:
|
|
11
|
+
* a larger value keeps the default. The native hook command line that
|
|
12
|
+
* `skills hook install` writes is unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MANAGED_HOOK_CONTEXT_MAX_CHARS = 12000;
|
|
15
|
+
/** Skill bodies one managed hook injects at most; SKILLS_HOOK_CONTEXT_MAX_SKILLS can only lower it. */
|
|
16
|
+
export declare const MANAGED_HOOK_CONTEXT_MAX_SKILLS = 2;
|
|
17
|
+
/** Part of the cap kept for the policy, notices and up to ten load offers. */
|
|
18
|
+
export declare const MANAGED_HOOK_CONTEXT_RESERVE_CHARS = 2500;
|
|
19
|
+
/** The effective hook limits: the defaults above, or a valid lower environment override. */
|
|
20
|
+
export declare function managedHookContextLimits(): {
|
|
21
|
+
maxChars: number;
|
|
22
|
+
maxSkills: number;
|
|
23
|
+
bodyChars: number;
|
|
24
|
+
};
|
|
25
|
+
/** Clamp assembled hook context to the cap at a line boundary, with a fixed note. */
|
|
26
|
+
export declare function capManagedHookContext(context: string, maxChars?: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Prepend a pending session pin migration notice to context the agent will
|
|
29
|
+
* read, then mark it delivered. Cursor shows hook context only at session
|
|
30
|
+
* start, and Sumi discards its prompt-admission output (its context call sends
|
|
31
|
+
* an empty prompt), so those calls leave the notice pending. OpenCode uses
|
|
32
|
+
* an explicit delivery phase, including for empty attachment-only admissions.
|
|
33
|
+
*/
|
|
34
|
+
export declare function withSessionPinMigrationNotice(agent: IntegrationAgent, event: string, input: unknown, result: {
|
|
35
|
+
context: string;
|
|
36
|
+
}): void;
|
|
2
37
|
export declare function registerAgentIntegration(parent: Command): void;
|
|
@@ -7,6 +7,8 @@ export interface ContextCommandOptions {
|
|
|
7
7
|
cached?: boolean;
|
|
8
8
|
autoReconcileSafe?: boolean;
|
|
9
9
|
autoMigrateSessionPin?: boolean;
|
|
10
|
+
backgroundRenewal?: boolean;
|
|
11
|
+
renewalBudgetMs?: string;
|
|
10
12
|
json?: boolean;
|
|
11
13
|
stdin?: boolean;
|
|
12
14
|
session?: string;
|
|
@@ -17,5 +19,7 @@ export interface ContextCommandOptions {
|
|
|
17
19
|
}
|
|
18
20
|
export declare function contextResolverOptions(options: ContextCommandOptions): SelectionResolverOptions;
|
|
19
21
|
export declare function registerContextCommands(parent: Command): void;
|
|
22
|
+
/** One fixed line naming only the code of a failed renewal ahead of expiry. */
|
|
23
|
+
export declare function renewAheadFailedNotice(code: string): string;
|
|
20
24
|
export declare function reportContextError(error: unknown, json?: boolean): void;
|
|
21
25
|
export declare function parseSkillContextInput(raw: string): SkillContextInput;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
export declare const PINNED_LAUNCHER_SCHEMA = "hasna-skills-pinned-launcher-
|
|
1
|
+
export declare const PINNED_LAUNCHER_SCHEMA = "hasna-skills-pinned-launcher-v3";
|
|
2
2
|
/** The variable the launcher uses to hand the caller's directory to the CLI. */
|
|
3
3
|
export declare const LAUNCH_CWD_VARIABLE = "HASNA_SKILLS_LAUNCH_CWD";
|
|
4
4
|
/** Bun runtime flags that remove every working-directory configuration source. */
|
|
5
5
|
export declare const PINNED_LAUNCHER_BUN_FLAGS: readonly ["--config=/dev/null", "--no-env-file", "--no-macros", "--no-install"];
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
* including `BUN_*`, `NODE_OPTIONS`, `DYLD_*`, `LD_*` and proxy settings, is
|
|
9
|
-
* dropped. The handling is total on purpose: a name is either listed here,
|
|
10
|
-
* matches a prefix below, and passes the server-owned profile policy.
|
|
11
|
-
*/
|
|
12
|
-
export declare const PINNED_LAUNCHER_ENV_NAMES: readonly ["HOME", "PATH", "TMPDIR", "TERM", "TERM_PROGRAM", "TERM_PROGRAM_VERSION", "COLORTERM", "LANG", "USER", "LOGNAME", "SHELL", "TZ", "NO_COLOR", "FORCE_COLOR", "CI", "COLUMNS", "LINES", "EDITOR", "VISUAL", "PAGER", "SSH_AUTH_SOCK", "TERMINAL_CWD", "CODEX_HOME", "HERMES_HOME", "HERMES_ENABLE_PROJECT_PLUGINS", "HOST", "PORT", "NODE_ENV", "AGENT_ID", "ECS_CONTAINER_METADATA_URI_V4"];
|
|
6
|
+
/** V3 also preserves Claude's explicit native configuration root. */
|
|
7
|
+
export declare const PINNED_LAUNCHER_ENV_NAMES: readonly ["HOME", "PATH", "TMPDIR", "TERM", "TERM_PROGRAM", "TERM_PROGRAM_VERSION", "COLORTERM", "LANG", "USER", "LOGNAME", "SHELL", "TZ", "NO_COLOR", "FORCE_COLOR", "CI", "COLUMNS", "LINES", "EDITOR", "VISUAL", "PAGER", "SSH_AUTH_SOCK", "TERMINAL_CWD", "CODEX_HOME", "HERMES_HOME", "HERMES_ENABLE_PROJECT_PLUGINS", "HOST", "PORT", "NODE_ENV", "AGENT_ID", "ECS_CONTAINER_METADATA_URI_V4", "CLAUDE_CONFIG_DIR"];
|
|
13
8
|
/** Environment name prefixes passed through, for the app's own documented overrides. */
|
|
14
9
|
export declare const PINNED_LAUNCHER_ENV_PREFIXES: readonly ["HASNA", "SKILLS", "SKILL", "MCP", "XDG", "LC", "AWS"];
|
|
15
10
|
/** The allowlisted subset of an environment, by the same rule the launcher applies. */
|
|
16
11
|
export declare function pinnedLauncherEnvironment(env: Record<string, string | undefined>, profile?: LauncherProfile): Record<string, string>;
|
|
17
12
|
export type LauncherShape = "symlink" | "pinned";
|
|
18
|
-
export type LauncherFormat = "v1" | "v2";
|
|
13
|
+
export type LauncherFormat = "v1" | "v2" | "v3";
|
|
19
14
|
export type LauncherProfile = "client" | "server";
|
|
20
15
|
export interface LauncherMetadata {
|
|
21
16
|
format?: LauncherFormat;
|