@ory/continue 0.10.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/README.md +120 -0
- package/dist/cli/assets.d.ts +23 -0
- package/dist/cli/assets.js +92 -0
- package/dist/cli/main.d.ts +16 -0
- package/dist/cli/main.js +182 -0
- package/dist/cli/setup.d.ts +18 -0
- package/dist/cli/setup.js +114 -0
- package/dist/handlers.d.ts +17 -0
- package/dist/handlers.js +567 -0
- package/dist/hook.d.ts +13 -0
- package/dist/hook.js +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -0
- package/dist/settings.d.ts +16 -0
- package/dist/settings.js +78 -0
- package/dist/types.d.ts +77 -0
- package/dist/types.js +2 -0
- package/package.json +83 -0
package/dist/settings.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.generateSettings = generateSettings;
|
|
37
|
+
exports.generateInstalledSettings = generateInstalledSettings;
|
|
38
|
+
exports.generateDevSettings = generateDevSettings;
|
|
39
|
+
const path = __importStar(require("node:path"));
|
|
40
|
+
const argus_1 = require("@ory/argus");
|
|
41
|
+
/**
|
|
42
|
+
* Generate the .continue/settings.json hooks section that configures Ory hooks.
|
|
43
|
+
*
|
|
44
|
+
* Continue's hook block is Claude-Code-compatible: a top-level `hooks` object
|
|
45
|
+
* mapping each event name to an array of matcher entries, each carrying
|
|
46
|
+
* command-type hooks. Verified against @continuedev/cli.
|
|
47
|
+
*/
|
|
48
|
+
function generateSettings(hookScriptPath) {
|
|
49
|
+
const cmd = `node ${hookScriptPath}`;
|
|
50
|
+
return {
|
|
51
|
+
hooks: {
|
|
52
|
+
SessionStart: (0, argus_1.matcherHookEntry)(cmd),
|
|
53
|
+
PreToolUse: (0, argus_1.matcherHookEntry)(cmd),
|
|
54
|
+
PostToolUse: (0, argus_1.matcherHookEntry)(cmd),
|
|
55
|
+
PostToolUseFailure: (0, argus_1.matcherHookEntry)(cmd),
|
|
56
|
+
PermissionRequest: (0, argus_1.matcherHookEntry)(cmd),
|
|
57
|
+
UserPromptSubmit: (0, argus_1.matcherHookEntry)(cmd),
|
|
58
|
+
SubagentStart: (0, argus_1.matcherHookEntry)(cmd),
|
|
59
|
+
SubagentStop: (0, argus_1.matcherHookEntry)(cmd),
|
|
60
|
+
Stop: (0, argus_1.matcherHookEntry)(cmd),
|
|
61
|
+
SessionEnd: (0, argus_1.matcherHookEntry)(cmd),
|
|
62
|
+
PreCompact: (0, argus_1.matcherHookEntry)(cmd),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Generate settings assuming the plugin is installed via npm/pnpm.
|
|
68
|
+
*/
|
|
69
|
+
function generateInstalledSettings() {
|
|
70
|
+
return generateSettings("ory-continue-hook");
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Generate settings pointing to a local dev build.
|
|
74
|
+
*/
|
|
75
|
+
function generateDevSettings(packageDir) {
|
|
76
|
+
const hookPath = path.resolve(packageDir, "dist", "hook.js");
|
|
77
|
+
return generateSettings(hookPath);
|
|
78
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Continue CLI (`cn`) hook event payload delivered on stdin.
|
|
3
|
+
*
|
|
4
|
+
* Continue invokes hooks as shell commands, passing JSON on stdin and reading
|
|
5
|
+
* JSON from stdout. Exit code 2 blocks the action. Continue's hook contract is
|
|
6
|
+
* explicitly Claude-Code-compatible, so these shapes mirror Claude Code's.
|
|
7
|
+
*
|
|
8
|
+
* Events: SessionStart, PreToolUse, PostToolUse, PostToolUseFailure,
|
|
9
|
+
* PermissionRequest, UserPromptSubmit, SubagentStart, SubagentStop, Stop,
|
|
10
|
+
* SessionEnd, PreCompact, ConfigChange.
|
|
11
|
+
*
|
|
12
|
+
* Verified against @continuedev/cli.
|
|
13
|
+
*/
|
|
14
|
+
export interface ContinueHookInput {
|
|
15
|
+
session_id: string;
|
|
16
|
+
transcript_path?: string;
|
|
17
|
+
cwd: string;
|
|
18
|
+
hook_event_name: string;
|
|
19
|
+
timestamp?: string;
|
|
20
|
+
source?: string;
|
|
21
|
+
tool_name?: string;
|
|
22
|
+
tool_input?: Record<string, unknown>;
|
|
23
|
+
tool_response?: Record<string, unknown>;
|
|
24
|
+
tool_use_id?: string;
|
|
25
|
+
/** PostToolUseFailure — tool error message. */
|
|
26
|
+
error?: string;
|
|
27
|
+
model?: string;
|
|
28
|
+
prompt?: string;
|
|
29
|
+
subagent_type?: string;
|
|
30
|
+
subagent_prompt?: string;
|
|
31
|
+
subagent_response?: string;
|
|
32
|
+
agent_id?: string;
|
|
33
|
+
agent_type?: string;
|
|
34
|
+
reason?: string;
|
|
35
|
+
stop_hook_active?: boolean;
|
|
36
|
+
last_assistant_message?: string;
|
|
37
|
+
trigger?: "auto" | "manual";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Continue CLI hook output written to stdout. Claude-Code-compatible.
|
|
41
|
+
*
|
|
42
|
+
* Top-level `decision: "block"` is honored on blocking-capable events
|
|
43
|
+
* (PreToolUse, etc.) and is paired with exit code 2 by the hook entry point.
|
|
44
|
+
* PreToolUse uses the structured `hookSpecificOutput.permissionDecision` shape;
|
|
45
|
+
* PermissionRequest uses the nested `hookSpecificOutput.decision.{behavior}`.
|
|
46
|
+
*/
|
|
47
|
+
export interface ContinueHookOutput {
|
|
48
|
+
continue?: boolean;
|
|
49
|
+
decision?: "block";
|
|
50
|
+
reason?: string;
|
|
51
|
+
stopReason?: string;
|
|
52
|
+
suppressOutput?: boolean;
|
|
53
|
+
systemMessage?: string;
|
|
54
|
+
updatedInput?: Record<string, unknown>;
|
|
55
|
+
hookSpecificOutput?: ContinueHookSpecificOutput;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Per-event structured output. Field shape depends on `hookEventName`:
|
|
59
|
+
* - PreToolUse: `permissionDecision` ("allow" | "deny" | "ask") +
|
|
60
|
+
* `permissionDecisionReason`.
|
|
61
|
+
* - PermissionRequest: nested `decision: { behavior }`. Omit `decision`
|
|
62
|
+
* entirely to fall through to Continue's normal user prompt.
|
|
63
|
+
* - SessionStart / UserPromptSubmit: `additionalContext` for context
|
|
64
|
+
* injection.
|
|
65
|
+
*/
|
|
66
|
+
export interface ContinueHookSpecificOutput {
|
|
67
|
+
hookEventName?: string;
|
|
68
|
+
permissionDecision?: "allow" | "deny" | "ask";
|
|
69
|
+
permissionDecisionReason?: string;
|
|
70
|
+
decision?: {
|
|
71
|
+
behavior: "allow" | "deny";
|
|
72
|
+
updatedInput?: Record<string, unknown>;
|
|
73
|
+
};
|
|
74
|
+
additionalContext?: string;
|
|
75
|
+
message?: string;
|
|
76
|
+
[key: string]: unknown;
|
|
77
|
+
}
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ory/continue",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"description": "Ory plugin for Continue CLI (cn): scaffolding skills, a local Ory instance, and authentication, authorization, and audit for every tool call",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://ory.com",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ory",
|
|
9
|
+
"continue",
|
|
10
|
+
"continuedev",
|
|
11
|
+
"cn",
|
|
12
|
+
"hooks",
|
|
13
|
+
"plugin",
|
|
14
|
+
"extension",
|
|
15
|
+
"identity",
|
|
16
|
+
"identity-management",
|
|
17
|
+
"iam",
|
|
18
|
+
"authentication",
|
|
19
|
+
"authorization",
|
|
20
|
+
"access-control",
|
|
21
|
+
"permissions",
|
|
22
|
+
"rbac",
|
|
23
|
+
"zanzibar",
|
|
24
|
+
"oauth",
|
|
25
|
+
"oauth2",
|
|
26
|
+
"openid-connect",
|
|
27
|
+
"oidc",
|
|
28
|
+
"session",
|
|
29
|
+
"mfa",
|
|
30
|
+
"sso",
|
|
31
|
+
"audit",
|
|
32
|
+
"audit-log",
|
|
33
|
+
"compliance",
|
|
34
|
+
"agent",
|
|
35
|
+
"ai-agent",
|
|
36
|
+
"agent-security",
|
|
37
|
+
"guardrails",
|
|
38
|
+
"llm",
|
|
39
|
+
"tracing",
|
|
40
|
+
"distributed-tracing",
|
|
41
|
+
"observability",
|
|
42
|
+
"kratos",
|
|
43
|
+
"keto",
|
|
44
|
+
"hydra"
|
|
45
|
+
],
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public",
|
|
48
|
+
"registry": "https://registry.npmjs.org/",
|
|
49
|
+
"provenance": true
|
|
50
|
+
},
|
|
51
|
+
"main": "dist/index.js",
|
|
52
|
+
"types": "dist/index.d.ts",
|
|
53
|
+
"exports": {
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./dist/index.d.ts",
|
|
56
|
+
"default": "./dist/index.js"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"bin": {
|
|
60
|
+
"ory-continue": "dist/cli/main.js",
|
|
61
|
+
"ory-continue-hook": "dist/hook.js",
|
|
62
|
+
"ory-continue-setup": "dist/cli/setup.js"
|
|
63
|
+
},
|
|
64
|
+
"files": [
|
|
65
|
+
"dist",
|
|
66
|
+
"!dist/dev",
|
|
67
|
+
"!dist/**/*.tsbuildinfo"
|
|
68
|
+
],
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@ory/argus": "0.10.0"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=22"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "tsc",
|
|
77
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
78
|
+
"test": "vitest run",
|
|
79
|
+
"test:watch": "vitest",
|
|
80
|
+
"typecheck": "tsc --noEmit",
|
|
81
|
+
"dev": "node dist/dev/launcher.js"
|
|
82
|
+
}
|
|
83
|
+
}
|