toolcraft 0.0.92 → 0.0.94

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 (123) hide show
  1. package/README.md +74 -4
  2. package/composition.json +1 -6
  3. package/dist/agent-defs.d.ts +1 -0
  4. package/dist/agent-defs.js +1 -0
  5. package/dist/agent-human-in-loop.d.ts +1 -0
  6. package/dist/agent-human-in-loop.js +1 -0
  7. package/dist/agent-mcp-config.d.ts +1 -0
  8. package/dist/agent-mcp-config.js +1 -0
  9. package/dist/auth-store.d.ts +1 -0
  10. package/dist/auth-store.js +1 -0
  11. package/dist/cli.d.ts +4 -1
  12. package/dist/cli.js +23 -64
  13. package/dist/composition.json +1 -6
  14. package/dist/config-mutations.d.ts +1 -0
  15. package/dist/config-mutations.js +1 -0
  16. package/dist/frontmatter.d.ts +1 -0
  17. package/dist/frontmatter.js +1 -0
  18. package/dist/human-in-loop/gate.d.ts +5 -1
  19. package/dist/human-in-loop/gate.js +10 -8
  20. package/dist/human-in-loop/runner.js +1 -28
  21. package/dist/mcp.d.ts +4 -1
  22. package/dist/mcp.js +8 -51
  23. package/dist/process-runner.d.ts +1 -0
  24. package/dist/process-runner.js +1 -0
  25. package/dist/runtime/io.d.ts +5 -0
  26. package/dist/runtime/io.js +50 -0
  27. package/dist/sdk.d.ts +12 -8
  28. package/dist/sdk.js +7 -52
  29. package/dist/task-list.d.ts +1 -0
  30. package/dist/task-list.js +1 -0
  31. package/dist/testing/fakes.d.ts +20 -0
  32. package/dist/testing/fakes.js +83 -0
  33. package/dist/testing/fixtures.d.ts +8 -0
  34. package/dist/testing/fixtures.js +248 -0
  35. package/dist/testing/harness.d.ts +76 -0
  36. package/dist/testing/harness.js +391 -0
  37. package/dist/testing/index.d.ts +4 -0
  38. package/dist/testing/index.js +3 -0
  39. package/dist/testing/memory-fs.d.ts +11 -0
  40. package/dist/testing/memory-fs.js +61 -0
  41. package/dist/testing/parity.d.ts +25 -0
  42. package/dist/testing/parity.js +384 -0
  43. package/dist/testing/render-capture.d.ts +6 -0
  44. package/dist/testing/render-capture.js +54 -0
  45. package/dist/tiny-mcp-client.d.ts +1 -0
  46. package/dist/tiny-mcp-client.js +1 -0
  47. package/node_modules/@poe-code/agent-defs/package.json +9 -3
  48. package/node_modules/@poe-code/agent-human-in-loop/README.md +12 -2
  49. package/node_modules/@poe-code/agent-human-in-loop/package.json +8 -2
  50. package/node_modules/@poe-code/agent-mcp-config/README.md +7 -7
  51. package/node_modules/@poe-code/agent-mcp-config/package.json +8 -2
  52. package/node_modules/@poe-code/config-mutations/README.md +8 -8
  53. package/node_modules/@poe-code/config-mutations/package.json +8 -2
  54. package/node_modules/@poe-code/frontmatter/README.md +2 -2
  55. package/node_modules/@poe-code/frontmatter/package.json +8 -2
  56. package/node_modules/@poe-code/process-runner/README.md +1 -1
  57. package/node_modules/@poe-code/process-runner/package.json +8 -2
  58. package/node_modules/@poe-code/task-list/README.md +15 -3
  59. package/node_modules/@poe-code/task-list/package.json +8 -2
  60. package/node_modules/auth-store/README.md +15 -0
  61. package/node_modules/auth-store/package.json +3 -2
  62. package/node_modules/tiny-mcp-client/.turbo/turbo-build.log +1 -1
  63. package/node_modules/tiny-mcp-client/README.md +36 -36
  64. package/node_modules/tiny-mcp-client/dist/index.d.ts +660 -2
  65. package/node_modules/tiny-mcp-client/dist/index.js +3870 -1
  66. package/node_modules/tiny-mcp-client/package.json +8 -2
  67. package/node_modules/tiny-mcp-client/scripts/build.mjs +63 -0
  68. package/node_modules/toolcraft-design/README.md +8 -4
  69. package/node_modules/toolcraft-design/dist/dashboard/terminal.js +48 -6
  70. package/node_modules/toolcraft-design/dist/explorer/actions.d.ts +4 -0
  71. package/node_modules/toolcraft-design/dist/explorer/actions.js +1 -0
  72. package/node_modules/toolcraft-design/dist/explorer/events.d.ts +4 -0
  73. package/node_modules/toolcraft-design/dist/explorer/reducer.js +52 -4
  74. package/node_modules/toolcraft-design/dist/explorer/render/list.js +47 -20
  75. package/node_modules/toolcraft-design/dist/explorer/render/modal.js +13 -1
  76. package/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.js +1 -1
  77. package/node_modules/toolcraft-design/dist/explorer/runtime.js +3 -0
  78. package/node_modules/toolcraft-design/dist/explorer/state.d.ts +9 -0
  79. package/node_modules/toolcraft-design/package.json +3 -2
  80. package/package.json +44 -6
  81. package/node_modules/mcp-oauth/LICENSE +0 -21
  82. package/node_modules/mcp-oauth/README.md +0 -31
  83. package/node_modules/mcp-oauth/dist/client/auth-store-session-store.d.ts +0 -14
  84. package/node_modules/mcp-oauth/dist/client/auth-store-session-store.js +0 -169
  85. package/node_modules/mcp-oauth/dist/client/authorization-state.d.ts +0 -8
  86. package/node_modules/mcp-oauth/dist/client/authorization-state.js +0 -47
  87. package/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.d.ts +0 -3
  88. package/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +0 -627
  89. package/node_modules/mcp-oauth/dist/client/loopback-authorization.d.ts +0 -20
  90. package/node_modules/mcp-oauth/dist/client/loopback-authorization.js +0 -207
  91. package/node_modules/mcp-oauth/dist/client/pkce.d.ts +0 -2
  92. package/node_modules/mcp-oauth/dist/client/pkce.js +0 -7
  93. package/node_modules/mcp-oauth/dist/client/token-endpoint.d.ts +0 -40
  94. package/node_modules/mcp-oauth/dist/client/token-endpoint.js +0 -164
  95. package/node_modules/mcp-oauth/dist/client/types.d.ts +0 -113
  96. package/node_modules/mcp-oauth/dist/client/types.js +0 -1
  97. package/node_modules/mcp-oauth/dist/index.d.ts +0 -10
  98. package/node_modules/mcp-oauth/dist/index.js +0 -7
  99. package/node_modules/mcp-oauth/dist/resource-indicator.d.ts +0 -1
  100. package/node_modules/mcp-oauth/dist/resource-indicator.js +0 -11
  101. package/node_modules/mcp-oauth/dist/server/jwks-token-verifier.d.ts +0 -28
  102. package/node_modules/mcp-oauth/dist/server/jwks-token-verifier.js +0 -304
  103. package/node_modules/mcp-oauth/dist/types.compile-check.d.ts +0 -1
  104. package/node_modules/mcp-oauth/dist/types.compile-check.js +0 -22
  105. package/node_modules/mcp-oauth/package.json +0 -32
  106. package/node_modules/tiny-mcp-client/dist/internal.d.ts +0 -556
  107. package/node_modules/tiny-mcp-client/dist/internal.js +0 -2688
  108. package/node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.d.ts +0 -1
  109. package/node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.js +0 -37
  110. package/node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.d.ts +0 -1
  111. package/node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.js +0 -50
  112. package/node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.d.ts +0 -1
  113. package/node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.js +0 -50
  114. package/node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.d.ts +0 -1
  115. package/node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.js +0 -51
  116. package/node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.d.ts +0 -1
  117. package/node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.js +0 -99
  118. package/node_modules/tiny-mcp-client/dist/mcp-transport-types.compile-check.d.ts +0 -1
  119. package/node_modules/tiny-mcp-client/dist/mcp-transport-types.compile-check.js +0 -56
  120. package/node_modules/tiny-mcp-client/dist/mcp-utility-types.compile-check.d.ts +0 -1
  121. package/node_modules/tiny-mcp-client/dist/mcp-utility-types.compile-check.js +0 -145
  122. package/node_modules/tiny-mcp-client/dist/oauth-discovery.d.ts +0 -24
  123. package/node_modules/tiny-mcp-client/dist/oauth-discovery.js +0 -382
@@ -1,31 +0,0 @@
1
- # mcp-oauth
2
-
3
- OAuth client primitives for MCP HTTP transports.
4
-
5
- ## Config
6
-
7
- `createDefaultOAuthClientProvider(options)` accepts:
8
-
9
- - `client`
10
- - `mode: "dynamic"` with optional `metadata`
11
- - `mode: "static"` with `clientId`, optional `clientSecret`, optional `metadata`
12
- - `browser.openBrowser(url)`
13
- - `browser.readLine()` optional
14
- - `browser.createServer()` optional
15
- - `browser.landingPage` optional
16
- - `sessionStore` optional
17
- - `authStore` optional `auth-store` backend config for the default session store
18
- - `now()` optional clock override
19
-
20
- `createJwksTokenVerifier(options)` accepts:
21
-
22
- - `jwksUrl`
23
- - `clockSkewSeconds` optional, defaults to `30`
24
- - `allowedAlgorithms` optional asymmetric allow-list
25
- - `fetch` optional override
26
-
27
- `createAuthStoreSessionStore(options)` accepts the standard `auth-store` config.
28
-
29
- ## Environment Variables
30
-
31
- None directly. When `authStore` is used, `auth-store` honors its own backend env var configuration.
@@ -1,14 +0,0 @@
1
- import { type CreateSecretStoreInput } from "auth-store";
2
- import type { OAuthSessionStore } from "./types.js";
3
- interface StoredOAuthClient {
4
- clientId: string;
5
- clientSecret?: string;
6
- }
7
- export interface OAuthClientStore {
8
- load(issuer: string): Promise<StoredOAuthClient | null>;
9
- save(issuer: string, client: StoredOAuthClient): Promise<void>;
10
- clear(issuer: string): Promise<void>;
11
- }
12
- export declare function createAuthStoreSessionStore(options?: CreateSecretStoreInput): OAuthSessionStore;
13
- export declare function createAuthStoreClientStore(options: CreateSecretStoreInput): OAuthClientStore;
14
- export {};
@@ -1,169 +0,0 @@
1
- import crypto from "node:crypto";
2
- import path from "node:path";
3
- import { createSecretStore } from "auth-store";
4
- import { canonicalizeResourceIndicator } from "../resource-indicator.js";
5
- const DEFAULT_FILE_SALT = "poe-code:mcp-oauth:v1";
6
- const DEFAULT_FILE_DIRECTORY = ".poe-code/mcp-oauth";
7
- const DEFAULT_KEYCHAIN_SERVICE = "poe-code-mcp-oauth";
8
- const DEFAULT_CLIENT_FILE_SALT = "poe-code:mcp-oauth:clients:v1";
9
- const DEFAULT_CLIENT_FILE_DIRECTORY = ".poe-code/mcp-oauth/clients";
10
- const DEFAULT_CLIENT_KEYCHAIN_SERVICE = "poe-code-mcp-oauth-clients";
11
- const MAX_JS_DATE_MS = 8_640_000_000_000_000;
12
- export function createAuthStoreSessionStore(options = {}) {
13
- return {
14
- async load(resource) {
15
- const store = createResourceSecretStore(resource, options);
16
- const value = await store.get();
17
- if (value === null) {
18
- return null;
19
- }
20
- const parsed = JSON.parse(value);
21
- if (isStoredOAuthSession(parsed)) {
22
- return parsed;
23
- }
24
- throw new Error("Stored OAuth session must match the expected shape");
25
- },
26
- async save(resource, session) {
27
- const store = createResourceSecretStore(resource, options);
28
- await store.set(JSON.stringify(session));
29
- },
30
- async clear(resource) {
31
- const store = createResourceSecretStore(resource, options);
32
- await store.delete();
33
- }
34
- };
35
- }
36
- export function createAuthStoreClientStore(options) {
37
- return {
38
- async load(issuer) {
39
- const store = createIssuerSecretStore(issuer, options);
40
- const value = await store.get();
41
- if (value === null) {
42
- return null;
43
- }
44
- const parsed = JSON.parse(value);
45
- const clientId = isObjectRecord(parsed) ? getOwnString(parsed, "clientId") : undefined;
46
- if (clientId !== undefined) {
47
- const client = { clientId };
48
- if (isObjectRecord(parsed) &&
49
- Object.prototype.hasOwnProperty.call(parsed, "clientSecret")) {
50
- client.clientSecret = getOwnEntry(parsed, "clientSecret");
51
- }
52
- return client;
53
- }
54
- throw new Error("Stored OAuth client must be a JSON object with clientId");
55
- },
56
- async save(issuer, client) {
57
- const store = createIssuerSecretStore(issuer, options);
58
- await store.set(JSON.stringify(client));
59
- },
60
- async clear(issuer) {
61
- const store = createIssuerSecretStore(issuer, options);
62
- await store.delete();
63
- }
64
- };
65
- }
66
- function createNamedSecretStore(key, options, defaults) {
67
- const hash = crypto.createHash("sha256").update(key).digest("hex");
68
- const configuredFilePath = options.fileStore?.filePath;
69
- const parsedFilePath = configuredFilePath === undefined ? null : path.parse(configuredFilePath);
70
- const fileStore = {
71
- ...options.fileStore,
72
- filePath: parsedFilePath === null
73
- ? undefined
74
- : path.join(parsedFilePath.dir, `${parsedFilePath.name}-${hash}${parsedFilePath.ext || ".enc"}`),
75
- salt: options.fileStore?.salt ?? defaults.salt,
76
- defaultDirectory: options.fileStore?.defaultDirectory || defaults.directory,
77
- defaultFileName: parsedFilePath === null
78
- ? `${hash}.enc`
79
- : `${parsedFilePath.name}-${hash}${parsedFilePath.ext || ".enc"}`
80
- };
81
- const keychainStore = {
82
- ...options.keychainStore,
83
- service: options.keychainStore?.service ?? defaults.service,
84
- account: `${options.keychainStore?.account ?? defaults.accountPrefix}:${hash}`
85
- };
86
- return createSecretStore({ ...options, fileStore, keychainStore }).store;
87
- }
88
- function createResourceSecretStore(resource, options) {
89
- return createNamedSecretStore(canonicalizeResourceIndicator(resource), options, {
90
- salt: DEFAULT_FILE_SALT,
91
- directory: DEFAULT_FILE_DIRECTORY,
92
- service: DEFAULT_KEYCHAIN_SERVICE,
93
- accountPrefix: "provider"
94
- });
95
- }
96
- function createIssuerSecretStore(issuer, options) {
97
- return createNamedSecretStore(issuer, options, {
98
- salt: DEFAULT_CLIENT_FILE_SALT,
99
- directory: DEFAULT_CLIENT_FILE_DIRECTORY,
100
- service: DEFAULT_CLIENT_KEYCHAIN_SERVICE,
101
- accountPrefix: "issuer"
102
- });
103
- }
104
- function isObjectRecord(value) {
105
- return typeof value === "object" && value !== null && !Array.isArray(value);
106
- }
107
- function getOwnEntry(record, key) {
108
- return Object.prototype.hasOwnProperty.call(record, key) ? record[key] : undefined;
109
- }
110
- function getOwnString(record, key) {
111
- const value = getOwnEntry(record, key);
112
- return typeof value === "string" ? value : undefined;
113
- }
114
- function isStoredOAuthSession(value) {
115
- if (!isObjectRecord(value)) {
116
- return false;
117
- }
118
- return (isNonBlankOwnString(value, "resource") &&
119
- isNonBlankOwnString(value, "authorizationServer") &&
120
- isStoredOAuthClient(getOwnEntry(value, "client")) &&
121
- isStoredOAuthDiscovery(getOwnEntry(value, "discovery")) &&
122
- isStoredOAuthTokensOrMissing(getOwnEntry(value, "tokens")));
123
- }
124
- function isStoredOAuthClient(value) {
125
- if (!isObjectRecord(value) || !isNonBlankOwnString(value, "clientId")) {
126
- return false;
127
- }
128
- const clientSecret = getOwnEntry(value, "clientSecret");
129
- return (clientSecret === undefined ||
130
- (typeof clientSecret === "string" && clientSecret.trim().length > 0));
131
- }
132
- function isStoredOAuthDiscovery(value) {
133
- if (!isObjectRecord(value)) {
134
- return false;
135
- }
136
- return (isNonBlankOwnString(value, "resourceMetadataUrl") &&
137
- isObjectRecord(getOwnEntry(value, "resourceMetadata")) &&
138
- isObjectRecord(getOwnEntry(value, "authorizationServerMetadata")));
139
- }
140
- function isStoredOAuthTokensOrMissing(value) {
141
- if (value === undefined) {
142
- return true;
143
- }
144
- if (!isObjectRecord(value)) {
145
- return false;
146
- }
147
- if (!isNonBlankOwnString(value, "accessToken") || getOwnString(value, "tokenType") !== "Bearer") {
148
- return false;
149
- }
150
- const expiresAt = getOwnEntry(value, "expiresAt");
151
- if (expiresAt !== null &&
152
- (typeof expiresAt !== "number" ||
153
- !Number.isSafeInteger(expiresAt) ||
154
- expiresAt > MAX_JS_DATE_MS ||
155
- !Number.isFinite(new Date(expiresAt).getTime()))) {
156
- return false;
157
- }
158
- const refreshToken = getOwnEntry(value, "refreshToken");
159
- if (refreshToken !== undefined &&
160
- (typeof refreshToken !== "string" || refreshToken.trim().length === 0)) {
161
- return false;
162
- }
163
- const scope = getOwnEntry(value, "scope");
164
- return scope === undefined || (typeof scope === "string" && scope.trim().length > 0);
165
- }
166
- function isNonBlankOwnString(record, key) {
167
- const value = getOwnString(record, key);
168
- return value !== undefined && value.trim().length > 0;
169
- }
@@ -1,8 +0,0 @@
1
- export declare function createAuthorizationState(input: {
2
- issuer: string;
3
- requireIssuer: boolean;
4
- }): string;
5
- export declare function parseAuthorizationState(value: string | null): {
6
- issuer: string;
7
- requireIssuer: boolean;
8
- } | null;
@@ -1,47 +0,0 @@
1
- import crypto from "node:crypto";
2
- export function createAuthorizationState(input) {
3
- const payload = {
4
- v: 1,
5
- n: crypto.randomBytes(16).toString("base64url"),
6
- i: input.issuer,
7
- r: input.requireIssuer,
8
- };
9
- return Buffer.from(JSON.stringify(payload), "utf8").toString("base64url");
10
- }
11
- export function parseAuthorizationState(value) {
12
- if (value === null || value.length === 0) {
13
- return null;
14
- }
15
- try {
16
- const decoded = Buffer.from(value, "base64url").toString("utf8");
17
- const parsed = JSON.parse(decoded);
18
- if (!isObjectRecord(parsed)) {
19
- return null;
20
- }
21
- const version = getOwnEntry(parsed, "v");
22
- const nonce = getOwnEntry(parsed, "n");
23
- const issuer = getOwnEntry(parsed, "i");
24
- const requireIssuer = getOwnEntry(parsed, "r");
25
- if (version !== 1
26
- || typeof nonce !== "string"
27
- || nonce.length === 0
28
- || typeof issuer !== "string"
29
- || issuer.length === 0
30
- || typeof requireIssuer !== "boolean") {
31
- return null;
32
- }
33
- return {
34
- issuer,
35
- requireIssuer,
36
- };
37
- }
38
- catch {
39
- return null;
40
- }
41
- }
42
- function isObjectRecord(value) {
43
- return typeof value === "object" && value !== null && !Array.isArray(value);
44
- }
45
- function getOwnEntry(record, key) {
46
- return Object.prototype.hasOwnProperty.call(record, key) ? record[key] : undefined;
47
- }
@@ -1,3 +0,0 @@
1
- import type { DefaultOAuthClientProviderOptions, OAuthClientProvider, OAuthClientProviderOptions } from "./types.js";
2
- export declare function createOAuthClientProvider(options: OAuthClientProviderOptions): OAuthClientProvider;
3
- export declare function createDefaultOAuthClientProvider(options: DefaultOAuthClientProviderOptions): OAuthClientProvider;