poe-code 3.0.231 → 3.0.233
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/dist/agent.js +12 -7
- package/dist/agent.js.map +3 -3
- package/dist/index.js +536 -229
- package/dist/index.js.map +4 -4
- package/dist/metafile.json +1 -0
- package/dist/providers/poe-agent.js +424 -126
- package/dist/providers/poe-agent.js.map +4 -4
- package/package.json +6 -1
- package/packages/agent-skill-config/dist/index.d.ts +1 -0
- package/packages/agent-skill-config/dist/index.js +1 -0
- package/packages/memory/dist/explain.js +1 -1
- package/packages/memory/dist/index.js +315 -44
- package/packages/memory/dist/index.js.map +4 -4
- package/packages/memory/dist/query.js +1 -1
- package/packages/memory/dist/tokens.js +1 -1
- package/packages/superintendent/dist/mcp.js +41194 -151
- package/packages/superintendent/dist/mcp.js.map +7 -0
- package/packages/tiny-stdio-mcp-server/dist/index.d.ts +1 -1
- package/packages/tiny-stdio-mcp-server/dist/server.d.ts +12 -2
- package/packages/tiny-stdio-mcp-server/dist/server.js +310 -40
- package/packages/tiny-stdio-mcp-server/dist/types.d.ts +136 -9
- package/packages/tiny-stdio-mcp-server/dist/types.js +2 -1
|
@@ -19077,7 +19077,7 @@ var init_agent_host = __esm({
|
|
|
19077
19077
|
}
|
|
19078
19078
|
});
|
|
19079
19079
|
|
|
19080
|
-
// packages/mcp-oauth/
|
|
19080
|
+
// packages/mcp-oauth/src/resource-indicator.ts
|
|
19081
19081
|
function canonicalizeResourceIndicator(value) {
|
|
19082
19082
|
let url;
|
|
19083
19083
|
try {
|
|
@@ -19089,12 +19089,12 @@ function canonicalizeResourceIndicator(value) {
|
|
|
19089
19089
|
return url.toString();
|
|
19090
19090
|
}
|
|
19091
19091
|
var init_resource_indicator = __esm({
|
|
19092
|
-
"packages/mcp-oauth/
|
|
19092
|
+
"packages/mcp-oauth/src/resource-indicator.ts"() {
|
|
19093
19093
|
"use strict";
|
|
19094
19094
|
}
|
|
19095
19095
|
});
|
|
19096
19096
|
|
|
19097
|
-
// packages/mcp-oauth/
|
|
19097
|
+
// packages/mcp-oauth/src/client/auth-store-session-store.ts
|
|
19098
19098
|
import crypto from "node:crypto";
|
|
19099
19099
|
import path17 from "node:path";
|
|
19100
19100
|
function createAuthStoreSessionStore(options = {}) {
|
|
@@ -19162,24 +19162,32 @@ function createNamedSecretStore(key2, options, defaults) {
|
|
|
19162
19162
|
return createSecretStore({ ...options, fileStore, keychainStore }).store;
|
|
19163
19163
|
}
|
|
19164
19164
|
function createResourceSecretStore(resource, options) {
|
|
19165
|
-
return createNamedSecretStore(
|
|
19166
|
-
|
|
19167
|
-
|
|
19168
|
-
|
|
19169
|
-
|
|
19170
|
-
|
|
19165
|
+
return createNamedSecretStore(
|
|
19166
|
+
canonicalizeResourceIndicator(resource),
|
|
19167
|
+
options,
|
|
19168
|
+
{
|
|
19169
|
+
salt: DEFAULT_FILE_SALT,
|
|
19170
|
+
directory: DEFAULT_FILE_DIRECTORY,
|
|
19171
|
+
service: DEFAULT_KEYCHAIN_SERVICE,
|
|
19172
|
+
accountPrefix: "provider"
|
|
19173
|
+
}
|
|
19174
|
+
);
|
|
19171
19175
|
}
|
|
19172
19176
|
function createIssuerSecretStore(issuer, options) {
|
|
19173
|
-
return createNamedSecretStore(
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19177
|
+
return createNamedSecretStore(
|
|
19178
|
+
issuer,
|
|
19179
|
+
options,
|
|
19180
|
+
{
|
|
19181
|
+
salt: DEFAULT_CLIENT_FILE_SALT,
|
|
19182
|
+
directory: DEFAULT_CLIENT_FILE_DIRECTORY,
|
|
19183
|
+
service: DEFAULT_CLIENT_KEYCHAIN_SERVICE,
|
|
19184
|
+
accountPrefix: "issuer"
|
|
19185
|
+
}
|
|
19186
|
+
);
|
|
19179
19187
|
}
|
|
19180
19188
|
var DEFAULT_FILE_SALT, DEFAULT_FILE_DIRECTORY, DEFAULT_KEYCHAIN_SERVICE, DEFAULT_CLIENT_FILE_SALT, DEFAULT_CLIENT_FILE_DIRECTORY, DEFAULT_CLIENT_KEYCHAIN_SERVICE;
|
|
19181
19189
|
var init_auth_store_session_store = __esm({
|
|
19182
|
-
"packages/mcp-oauth/
|
|
19190
|
+
"packages/mcp-oauth/src/client/auth-store-session-store.ts"() {
|
|
19183
19191
|
"use strict";
|
|
19184
19192
|
init_src8();
|
|
19185
19193
|
init_resource_indicator();
|
|
@@ -19192,7 +19200,7 @@ var init_auth_store_session_store = __esm({
|
|
|
19192
19200
|
}
|
|
19193
19201
|
});
|
|
19194
19202
|
|
|
19195
|
-
// packages/mcp-oauth/
|
|
19203
|
+
// packages/mcp-oauth/src/client/authorization-state.ts
|
|
19196
19204
|
import crypto2 from "node:crypto";
|
|
19197
19205
|
function createAuthorizationState(input) {
|
|
19198
19206
|
const payload = {
|
|
@@ -19222,12 +19230,12 @@ function parseAuthorizationState(value) {
|
|
|
19222
19230
|
}
|
|
19223
19231
|
}
|
|
19224
19232
|
var init_authorization_state = __esm({
|
|
19225
|
-
"packages/mcp-oauth/
|
|
19233
|
+
"packages/mcp-oauth/src/client/authorization-state.ts"() {
|
|
19226
19234
|
"use strict";
|
|
19227
19235
|
}
|
|
19228
19236
|
});
|
|
19229
19237
|
|
|
19230
|
-
// packages/mcp-oauth/
|
|
19238
|
+
// packages/mcp-oauth/src/client/loopback-authorization.ts
|
|
19231
19239
|
import http from "node:http";
|
|
19232
19240
|
async function createLoopbackAuthorizationSession(options = {}) {
|
|
19233
19241
|
const callbackPath = options.callbackPath ?? "/callback";
|
|
@@ -19420,13 +19428,13 @@ function buildSuccessPage(landingPage) {
|
|
|
19420
19428
|
].join("");
|
|
19421
19429
|
}
|
|
19422
19430
|
var init_loopback_authorization = __esm({
|
|
19423
|
-
"packages/mcp-oauth/
|
|
19431
|
+
"packages/mcp-oauth/src/client/loopback-authorization.ts"() {
|
|
19424
19432
|
"use strict";
|
|
19425
19433
|
init_authorization_state();
|
|
19426
19434
|
}
|
|
19427
19435
|
});
|
|
19428
19436
|
|
|
19429
|
-
// packages/mcp-oauth/
|
|
19437
|
+
// packages/mcp-oauth/src/client/pkce.ts
|
|
19430
19438
|
import crypto3 from "node:crypto";
|
|
19431
19439
|
function generateCodeVerifier() {
|
|
19432
19440
|
return crypto3.randomBytes(32).toString("base64url");
|
|
@@ -19435,12 +19443,12 @@ function generateCodeChallenge(verifier) {
|
|
|
19435
19443
|
return crypto3.createHash("sha256").update(verifier).digest("base64url");
|
|
19436
19444
|
}
|
|
19437
19445
|
var init_pkce = __esm({
|
|
19438
|
-
"packages/mcp-oauth/
|
|
19446
|
+
"packages/mcp-oauth/src/client/pkce.ts"() {
|
|
19439
19447
|
"use strict";
|
|
19440
19448
|
}
|
|
19441
19449
|
});
|
|
19442
19450
|
|
|
19443
|
-
// packages/mcp-oauth/
|
|
19451
|
+
// packages/mcp-oauth/src/client/token-endpoint.ts
|
|
19444
19452
|
function isRetryableOAuthError(error2) {
|
|
19445
19453
|
return error2 instanceof OAuthError && (error2.status >= 500 || error2.error === "server_error" || error2.error === "temporarily_unavailable");
|
|
19446
19454
|
}
|
|
@@ -19552,7 +19560,7 @@ function normalizeBearerTokenType(value) {
|
|
|
19552
19560
|
}
|
|
19553
19561
|
var OAuthError;
|
|
19554
19562
|
var init_token_endpoint = __esm({
|
|
19555
|
-
"packages/mcp-oauth/
|
|
19563
|
+
"packages/mcp-oauth/src/client/token-endpoint.ts"() {
|
|
19556
19564
|
"use strict";
|
|
19557
19565
|
init_resource_indicator();
|
|
19558
19566
|
OAuthError = class extends Error {
|
|
@@ -19580,7 +19588,7 @@ var init_token_endpoint = __esm({
|
|
|
19580
19588
|
}
|
|
19581
19589
|
});
|
|
19582
19590
|
|
|
19583
|
-
// packages/mcp-oauth/
|
|
19591
|
+
// packages/mcp-oauth/src/client/default-oauth-client-provider.ts
|
|
19584
19592
|
import { URL as URL2 } from "node:url";
|
|
19585
19593
|
function createOAuthClientProvider(options) {
|
|
19586
19594
|
if (isProviderOptions(options)) {
|
|
@@ -19614,10 +19622,16 @@ function createDefaultOAuthClientProvider(options) {
|
|
|
19614
19622
|
const resource = canonicalizeResourceIndicator(input.discovery.resource);
|
|
19615
19623
|
assertRequestMatchesResource(requestUrl, resource);
|
|
19616
19624
|
const forceRefresh = hasCachedAccessToken(await loadSession(resource)) && input.challenge?.params.error === "invalid_token";
|
|
19617
|
-
const session = await ensureAuthorizedSession(
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19625
|
+
const session = await ensureAuthorizedSession(
|
|
19626
|
+
resource,
|
|
19627
|
+
{
|
|
19628
|
+
...input.discovery,
|
|
19629
|
+
resource
|
|
19630
|
+
},
|
|
19631
|
+
input.fetch,
|
|
19632
|
+
true,
|
|
19633
|
+
forceRefresh
|
|
19634
|
+
);
|
|
19621
19635
|
if (session?.tokens?.accessToken === void 0) {
|
|
19622
19636
|
return { action: "fail" };
|
|
19623
19637
|
}
|
|
@@ -19683,7 +19697,11 @@ function createDefaultOAuthClientProvider(options) {
|
|
|
19683
19697
|
await saveSession(resource, clearedSession);
|
|
19684
19698
|
return clearedSession;
|
|
19685
19699
|
}
|
|
19686
|
-
if (shouldReRegisterStoredDynamicClient(
|
|
19700
|
+
if (shouldReRegisterStoredDynamicClient(
|
|
19701
|
+
error2,
|
|
19702
|
+
await loadRegisteredClient(discovery.authorizationServer),
|
|
19703
|
+
false
|
|
19704
|
+
)) {
|
|
19687
19705
|
await clearRegisteredClient(discovery.authorizationServer);
|
|
19688
19706
|
await clearSession(resource);
|
|
19689
19707
|
return null;
|
|
@@ -19845,7 +19863,10 @@ function createDefaultOAuthClientProvider(options) {
|
|
|
19845
19863
|
};
|
|
19846
19864
|
}
|
|
19847
19865
|
}
|
|
19848
|
-
const registrationBody = buildClientRegistrationBody(
|
|
19866
|
+
const registrationBody = buildClientRegistrationBody(
|
|
19867
|
+
getClientMetadata(options.client),
|
|
19868
|
+
redirectUri
|
|
19869
|
+
);
|
|
19849
19870
|
const response = await fetch2(registrationEndpoint, {
|
|
19850
19871
|
method: "POST",
|
|
19851
19872
|
headers: {
|
|
@@ -19984,7 +20005,9 @@ function buildAuthorizationUrl(input) {
|
|
|
19984
20005
|
}
|
|
19985
20006
|
function assertS256PkceSupport(metadata) {
|
|
19986
20007
|
if (!metadata.code_challenge_methods_supported.includes("S256")) {
|
|
19987
|
-
throw new Error(
|
|
20008
|
+
throw new Error(
|
|
20009
|
+
"Authorization server metadata must advertise code_challenge_methods_supported including S256"
|
|
20010
|
+
);
|
|
19988
20011
|
}
|
|
19989
20012
|
}
|
|
19990
20013
|
function normalizeHostname(hostname2) {
|
|
@@ -20022,7 +20045,9 @@ function assertNoAccessTokenInUrl(value, label) {
|
|
|
20022
20045
|
}
|
|
20023
20046
|
function assertRequestMatchesResource(requestUrl, resource) {
|
|
20024
20047
|
if (requestUrl !== resource) {
|
|
20025
|
-
throw new Error(
|
|
20048
|
+
throw new Error(
|
|
20049
|
+
`OAuth request URL ${requestUrl} does not match discovered resource ${resource}`
|
|
20050
|
+
);
|
|
20026
20051
|
}
|
|
20027
20052
|
}
|
|
20028
20053
|
function buildClientRegistrationBody(metadata, redirectUri) {
|
|
@@ -20066,7 +20091,7 @@ function shouldReRegisterStoredDynamicClient(error2, client, alreadyAttempted) {
|
|
|
20066
20091
|
return true;
|
|
20067
20092
|
}
|
|
20068
20093
|
var init_default_oauth_client_provider = __esm({
|
|
20069
|
-
"packages/mcp-oauth/
|
|
20094
|
+
"packages/mcp-oauth/src/client/default-oauth-client-provider.ts"() {
|
|
20070
20095
|
"use strict";
|
|
20071
20096
|
init_auth_store_session_store();
|
|
20072
20097
|
init_loopback_authorization();
|
|
@@ -20077,18 +20102,23 @@ var init_default_oauth_client_provider = __esm({
|
|
|
20077
20102
|
}
|
|
20078
20103
|
});
|
|
20079
20104
|
|
|
20080
|
-
// packages/mcp-oauth/
|
|
20081
|
-
import {
|
|
20105
|
+
// packages/mcp-oauth/src/server/jwks-token-verifier.ts
|
|
20106
|
+
import {
|
|
20107
|
+
decodeProtectedHeader,
|
|
20108
|
+
errors,
|
|
20109
|
+
importJWK,
|
|
20110
|
+
jwtVerify
|
|
20111
|
+
} from "jose";
|
|
20082
20112
|
var init_jwks_token_verifier = __esm({
|
|
20083
|
-
"packages/mcp-oauth/
|
|
20113
|
+
"packages/mcp-oauth/src/server/jwks-token-verifier.ts"() {
|
|
20084
20114
|
"use strict";
|
|
20085
20115
|
init_resource_indicator();
|
|
20086
20116
|
}
|
|
20087
20117
|
});
|
|
20088
20118
|
|
|
20089
|
-
// packages/mcp-oauth/
|
|
20090
|
-
var
|
|
20091
|
-
"packages/mcp-oauth/
|
|
20119
|
+
// packages/mcp-oauth/src/index.ts
|
|
20120
|
+
var init_src9 = __esm({
|
|
20121
|
+
"packages/mcp-oauth/src/index.ts"() {
|
|
20092
20122
|
"use strict";
|
|
20093
20123
|
init_auth_store_session_store();
|
|
20094
20124
|
init_default_oauth_client_provider();
|
|
@@ -20421,7 +20451,7 @@ var OAuthMetadataDiscovery;
|
|
|
20421
20451
|
var init_oauth_discovery = __esm({
|
|
20422
20452
|
"packages/tiny-mcp-client/src/oauth-discovery.ts"() {
|
|
20423
20453
|
"use strict";
|
|
20424
|
-
|
|
20454
|
+
init_src9();
|
|
20425
20455
|
OAuthMetadataDiscovery = class {
|
|
20426
20456
|
fetchImpl;
|
|
20427
20457
|
cache;
|
|
@@ -20732,10 +20762,10 @@ var MCP_PROTOCOL_VERSION, McpClient, ERROR_PARSE, ERROR_INVALID_REQUEST, ERROR_M
|
|
|
20732
20762
|
var init_internal = __esm({
|
|
20733
20763
|
"packages/tiny-mcp-client/src/internal.ts"() {
|
|
20734
20764
|
"use strict";
|
|
20735
|
-
|
|
20765
|
+
init_src9();
|
|
20736
20766
|
init_oauth_discovery();
|
|
20737
20767
|
init_oauth_discovery();
|
|
20738
|
-
|
|
20768
|
+
init_src9();
|
|
20739
20769
|
MCP_PROTOCOL_VERSION = "2025-03-26";
|
|
20740
20770
|
McpClient = class {
|
|
20741
20771
|
currentState = "disconnected";
|
|
@@ -22017,7 +22047,7 @@ var init_internal = __esm({
|
|
|
22017
22047
|
});
|
|
22018
22048
|
|
|
22019
22049
|
// packages/tiny-mcp-client/src/index.ts
|
|
22020
|
-
var
|
|
22050
|
+
var init_src10 = __esm({
|
|
22021
22051
|
"packages/tiny-mcp-client/src/index.ts"() {
|
|
22022
22052
|
"use strict";
|
|
22023
22053
|
init_internal();
|
|
@@ -22088,7 +22118,7 @@ var DEFAULT_MCP_CLIENT_INFO, PluginApiImpl;
|
|
|
22088
22118
|
var init_plugin_api_impl = __esm({
|
|
22089
22119
|
"packages/poe-agent/src/runtime/plugin-api-impl.ts"() {
|
|
22090
22120
|
"use strict";
|
|
22091
|
-
|
|
22121
|
+
init_src10();
|
|
22092
22122
|
init_hooks();
|
|
22093
22123
|
init_config2();
|
|
22094
22124
|
init_tool_results();
|
|
@@ -24522,7 +24552,7 @@ var init_testing = __esm({
|
|
|
24522
24552
|
});
|
|
24523
24553
|
|
|
24524
24554
|
// packages/process-runner/src/index.ts
|
|
24525
|
-
var
|
|
24555
|
+
var init_src11 = __esm({
|
|
24526
24556
|
"packages/process-runner/src/index.ts"() {
|
|
24527
24557
|
"use strict";
|
|
24528
24558
|
init_context();
|
|
@@ -24602,7 +24632,7 @@ var DEFAULT_ENDPOINT, USER_AGENT, AUTH_ERROR;
|
|
|
24602
24632
|
var init_gh_issues_client = __esm({
|
|
24603
24633
|
"packages/task-list/src/backends/gh-issues-client.ts"() {
|
|
24604
24634
|
"use strict";
|
|
24605
|
-
|
|
24635
|
+
init_src11();
|
|
24606
24636
|
DEFAULT_ENDPOINT = "https://api.github.com/graphql";
|
|
24607
24637
|
USER_AGENT = "poe-code-task-list/0.0.1";
|
|
24608
24638
|
AUTH_ERROR = "gh auth token failed; install gh, run 'gh auth login', or pass auth: { token }";
|
|
@@ -27526,7 +27556,7 @@ var init_gh_issues_sync = __esm({
|
|
|
27526
27556
|
});
|
|
27527
27557
|
|
|
27528
27558
|
// packages/task-list/src/index.ts
|
|
27529
|
-
var
|
|
27559
|
+
var init_src12 = __esm({
|
|
27530
27560
|
"packages/task-list/src/index.ts"() {
|
|
27531
27561
|
"use strict";
|
|
27532
27562
|
init_open();
|
|
@@ -27653,7 +27683,7 @@ var PLAN_LIST_NAME, MARKDOWN_EXTENSION2;
|
|
|
27653
27683
|
var init_plans = __esm({
|
|
27654
27684
|
"packages/agent-harness-tools/src/plans.ts"() {
|
|
27655
27685
|
"use strict";
|
|
27656
|
-
|
|
27686
|
+
init_src12();
|
|
27657
27687
|
init_paths();
|
|
27658
27688
|
PLAN_LIST_NAME = "plans";
|
|
27659
27689
|
MARKDOWN_EXTENSION2 = ".md";
|
|
@@ -28682,12 +28712,12 @@ var init_skill_config = __esm({
|
|
|
28682
28712
|
var init_workspace_transfer2 = __esm({
|
|
28683
28713
|
"packages/agent-harness-tools/src/workspace-transfer.ts"() {
|
|
28684
28714
|
"use strict";
|
|
28685
|
-
|
|
28715
|
+
init_src11();
|
|
28686
28716
|
}
|
|
28687
28717
|
});
|
|
28688
28718
|
|
|
28689
28719
|
// packages/agent-harness-tools/src/index.ts
|
|
28690
|
-
var
|
|
28720
|
+
var init_src13 = __esm({
|
|
28691
28721
|
"packages/agent-harness-tools/src/index.ts"() {
|
|
28692
28722
|
"use strict";
|
|
28693
28723
|
init_paths();
|
|
@@ -28974,7 +29004,7 @@ var JOB_DIR2;
|
|
|
28974
29004
|
var init_job_handle = __esm({
|
|
28975
29005
|
"packages/runner-e2b/src/job-handle.ts"() {
|
|
28976
29006
|
"use strict";
|
|
28977
|
-
|
|
29007
|
+
init_src13();
|
|
28978
29008
|
JOB_DIR2 = "/tmp/poe-jobs";
|
|
28979
29009
|
}
|
|
28980
29010
|
});
|
|
@@ -29363,7 +29393,7 @@ function isExitError(error2) {
|
|
|
29363
29393
|
var init_opened_env = __esm({
|
|
29364
29394
|
"packages/runner-e2b/src/opened-env.ts"() {
|
|
29365
29395
|
"use strict";
|
|
29366
|
-
|
|
29396
|
+
init_src13();
|
|
29367
29397
|
init_job_handle();
|
|
29368
29398
|
init_sdk();
|
|
29369
29399
|
}
|
|
@@ -29506,7 +29536,7 @@ var init_factory = __esm({
|
|
|
29506
29536
|
|
|
29507
29537
|
// packages/runner-e2b/src/index.ts
|
|
29508
29538
|
var e2bExecutionEnvFactory2;
|
|
29509
|
-
var
|
|
29539
|
+
var init_src14 = __esm({
|
|
29510
29540
|
"packages/runner-e2b/src/index.ts"() {
|
|
29511
29541
|
"use strict";
|
|
29512
29542
|
init_factory();
|
|
@@ -29602,9 +29632,9 @@ function runHost(spawnProcess, spec10) {
|
|
|
29602
29632
|
var init_register_factories = __esm({
|
|
29603
29633
|
"packages/agent-spawn/src/register-factories.ts"() {
|
|
29604
29634
|
"use strict";
|
|
29605
|
-
init_src12();
|
|
29606
|
-
init_src10();
|
|
29607
29635
|
init_src13();
|
|
29636
|
+
init_src11();
|
|
29637
|
+
init_src14();
|
|
29608
29638
|
registerExecutionEnvFactory(hostExecutionEnvFactory);
|
|
29609
29639
|
registerExecutionEnvFactory(dockerExecutionEnvFactory);
|
|
29610
29640
|
registerExecutionEnvFactory(e2bExecutionEnvFactory2);
|
|
@@ -30575,7 +30605,7 @@ var init_retry = __esm({
|
|
|
30575
30605
|
var init_runtime3 = __esm({
|
|
30576
30606
|
"packages/agent-spawn/src/runtime.ts"() {
|
|
30577
30607
|
"use strict";
|
|
30578
|
-
|
|
30608
|
+
init_src13();
|
|
30579
30609
|
}
|
|
30580
30610
|
});
|
|
30581
30611
|
|
|
@@ -31342,13 +31372,14 @@ var init_bridge_active_skills = __esm({
|
|
|
31342
31372
|
});
|
|
31343
31373
|
|
|
31344
31374
|
// packages/agent-skill-config/src/index.ts
|
|
31345
|
-
var
|
|
31375
|
+
var init_src15 = __esm({
|
|
31346
31376
|
"packages/agent-skill-config/src/index.ts"() {
|
|
31347
31377
|
"use strict";
|
|
31348
31378
|
init_configs2();
|
|
31349
31379
|
init_apply();
|
|
31350
31380
|
init_resolve_skill_reference();
|
|
31351
31381
|
init_git_exclude();
|
|
31382
|
+
init_git_exclude();
|
|
31352
31383
|
init_bridge_active_skills();
|
|
31353
31384
|
}
|
|
31354
31385
|
});
|
|
@@ -32189,7 +32220,7 @@ var hookExcludeMarkerPrefix, bridgeStates, liveTransformOwners;
|
|
|
32189
32220
|
var init_bridge_hooks = __esm({
|
|
32190
32221
|
"packages/agent-hook-config/src/bridge-hooks.ts"() {
|
|
32191
32222
|
"use strict";
|
|
32192
|
-
|
|
32223
|
+
init_src15();
|
|
32193
32224
|
init_configs3();
|
|
32194
32225
|
init_read_hooks();
|
|
32195
32226
|
init_symlink_hooks();
|
|
@@ -32202,7 +32233,7 @@ var init_bridge_hooks = __esm({
|
|
|
32202
32233
|
});
|
|
32203
32234
|
|
|
32204
32235
|
// packages/agent-hook-config/src/index.ts
|
|
32205
|
-
var
|
|
32236
|
+
var init_src16 = __esm({
|
|
32206
32237
|
"packages/agent-hook-config/src/index.ts"() {
|
|
32207
32238
|
"use strict";
|
|
32208
32239
|
init_configs3();
|
|
@@ -32262,8 +32293,8 @@ function cleanupResourcesForRun(manifest) {
|
|
|
32262
32293
|
var init_skill_bridge = __esm({
|
|
32263
32294
|
"packages/agent-spawn/src/skill-bridge.ts"() {
|
|
32264
32295
|
"use strict";
|
|
32265
|
-
init_src14();
|
|
32266
32296
|
init_src15();
|
|
32297
|
+
init_src16();
|
|
32267
32298
|
init_src2();
|
|
32268
32299
|
}
|
|
32269
32300
|
});
|
|
@@ -33184,7 +33215,7 @@ var init_spawn = __esm({
|
|
|
33184
33215
|
"packages/agent-spawn/src/acp/spawn.ts"() {
|
|
33185
33216
|
"use strict";
|
|
33186
33217
|
init_register_factories();
|
|
33187
|
-
|
|
33218
|
+
init_src13();
|
|
33188
33219
|
init_adapters();
|
|
33189
33220
|
init_meta();
|
|
33190
33221
|
init_resolve_config();
|
|
@@ -33437,7 +33468,7 @@ var init_spawn2 = __esm({
|
|
|
33437
33468
|
"packages/agent-spawn/src/spawn.ts"() {
|
|
33438
33469
|
"use strict";
|
|
33439
33470
|
init_register_factories();
|
|
33440
|
-
|
|
33471
|
+
init_src13();
|
|
33441
33472
|
init_resolve_config();
|
|
33442
33473
|
init_mcp_args();
|
|
33443
33474
|
init_model_utils();
|
|
@@ -33469,7 +33500,7 @@ var init_spawn_interactive = __esm({
|
|
|
33469
33500
|
"packages/agent-spawn/src/spawn-interactive.ts"() {
|
|
33470
33501
|
"use strict";
|
|
33471
33502
|
init_register_factories();
|
|
33472
|
-
|
|
33503
|
+
init_src13();
|
|
33473
33504
|
init_resolve_config();
|
|
33474
33505
|
init_mcp_args();
|
|
33475
33506
|
init_model_utils();
|
|
@@ -33988,7 +34019,7 @@ var init_spawn_log = __esm({
|
|
|
33988
34019
|
});
|
|
33989
34020
|
|
|
33990
34021
|
// packages/agent-spawn/src/index.ts
|
|
33991
|
-
var
|
|
34022
|
+
var init_src17 = __esm({
|
|
33992
34023
|
"packages/agent-spawn/src/index.ts"() {
|
|
33993
34024
|
"use strict";
|
|
33994
34025
|
init_register_factories();
|
|
@@ -34021,7 +34052,7 @@ var gitContext, poe_agent_plugin_git_context_default;
|
|
|
34021
34052
|
var init_poe_agent_plugin_git_context = __esm({
|
|
34022
34053
|
"packages/poe-agent/src/plugins/poe-agent-plugin-git-context.ts"() {
|
|
34023
34054
|
"use strict";
|
|
34024
|
-
|
|
34055
|
+
init_src17();
|
|
34025
34056
|
gitContext = (cwd) => ({
|
|
34026
34057
|
name: "git-context",
|
|
34027
34058
|
async prompt(ctx) {
|
|
@@ -34260,7 +34291,7 @@ __export(src_exports, {
|
|
|
34260
34291
|
systemPromptPlugin: () => poe_agent_plugin_system_prompt_default,
|
|
34261
34292
|
webPlugin: () => poe_agent_plugin_web_default
|
|
34262
34293
|
});
|
|
34263
|
-
var
|
|
34294
|
+
var init_src18 = __esm({
|
|
34264
34295
|
"packages/poe-agent/src/index.ts"() {
|
|
34265
34296
|
"use strict";
|
|
34266
34297
|
init_agent();
|
|
@@ -34474,7 +34505,7 @@ function createInstallRunner(definition) {
|
|
|
34474
34505
|
// src/services/config.ts
|
|
34475
34506
|
init_src4();
|
|
34476
34507
|
init_src7();
|
|
34477
|
-
|
|
34508
|
+
init_src18();
|
|
34478
34509
|
import path59 from "node:path";
|
|
34479
34510
|
|
|
34480
34511
|
// packages/superintendent/src/document/parse.ts
|
|
@@ -34965,7 +34996,7 @@ function extractText(node) {
|
|
|
34965
34996
|
}
|
|
34966
34997
|
|
|
34967
34998
|
// packages/superintendent/src/runtime/loop.ts
|
|
34968
|
-
|
|
34999
|
+
init_src13();
|
|
34969
35000
|
import path52 from "node:path";
|
|
34970
35001
|
import * as fsPromises10 from "node:fs/promises";
|
|
34971
35002
|
|
|
@@ -34984,8 +35015,8 @@ function createLoopState(doc) {
|
|
|
34984
35015
|
|
|
34985
35016
|
// packages/superintendent/src/runtime/agent-runner.ts
|
|
34986
35017
|
init_register_factories();
|
|
34987
|
-
|
|
34988
|
-
|
|
35018
|
+
init_src13();
|
|
35019
|
+
init_src17();
|
|
34989
35020
|
import { mkdirSync as mkdirSync6, openSync as openSync3, writeSync as writeSync2, closeSync as closeSync3 } from "node:fs";
|
|
34990
35021
|
import path50 from "node:path";
|
|
34991
35022
|
var injectedRunner;
|
|
@@ -37341,8 +37372,8 @@ import path54 from "node:path";
|
|
|
37341
37372
|
import { readFile as readFile6, stat as stat3, lstat as lstat3, mkdir as mkdir5, writeFile as writeFile3, rename as rename2, unlink, readdir as readdir5, chmod as chmod2 } from "node:fs/promises";
|
|
37342
37373
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
37343
37374
|
init_src7();
|
|
37344
|
-
|
|
37345
|
-
|
|
37375
|
+
init_src15();
|
|
37376
|
+
init_src13();
|
|
37346
37377
|
var fs5 = {
|
|
37347
37378
|
readFile: (p, encoding) => readFile6(p, encoding),
|
|
37348
37379
|
writeFile: (p, content) => writeFile3(p, content),
|
|
@@ -37799,8 +37830,8 @@ function resolveAbsoluteDirectory2(dir, cwd, homeDir) {
|
|
|
37799
37830
|
}
|
|
37800
37831
|
|
|
37801
37832
|
// packages/superintendent/src/commands/run.ts
|
|
37802
|
-
|
|
37803
|
-
|
|
37833
|
+
init_src13();
|
|
37834
|
+
init_src17();
|
|
37804
37835
|
init_src5();
|
|
37805
37836
|
import path56 from "node:path";
|
|
37806
37837
|
import * as fsPromises11 from "node:fs/promises";
|
|
@@ -37808,7 +37839,7 @@ import { spawn as nodeSpawn, spawnSync as nodeSpawnSync } from "node:child_proce
|
|
|
37808
37839
|
|
|
37809
37840
|
// packages/superintendent/src/commands/poe-agent-runner.ts
|
|
37810
37841
|
init_src5();
|
|
37811
|
-
|
|
37842
|
+
init_src18();
|
|
37812
37843
|
async function executePoeAgent(agentSpec, input, createAgent = agent) {
|
|
37813
37844
|
const { model } = parseAgentSpecifier(agentSpec);
|
|
37814
37845
|
if (!model) {
|
|
@@ -42980,7 +43011,7 @@ import { randomUUID as randomUUID6 } from "node:crypto";
|
|
|
42980
43011
|
import { constants as constants4 } from "node:fs";
|
|
42981
43012
|
import { lstat as lstat9, mkdir as mkdir11, open as open5, readdir as readdir11, rename as rename8, rm, stat as stat9 } from "node:fs/promises";
|
|
42982
43013
|
import { basename as basename4, dirname as dirname3, join as join3, relative as relative4, resolve as resolve5, sep as sep4 } from "node:path";
|
|
42983
|
-
|
|
43014
|
+
init_src17();
|
|
42984
43015
|
var DEFAULT_CODE_REVIEW_INGEST_DIRECTORY = ".poe-code/code-review/ingest";
|
|
42985
43016
|
var DEFAULT_CODE_REVIEW_PROFILES_DIRECTORY = ".poe-code/code-review/profiles";
|
|
42986
43017
|
async function ingestCodeReviewProfile(input, dependencies = {}) {
|
|
@@ -43350,13 +43381,16 @@ function isMissingFileError5(error2) {
|
|
|
43350
43381
|
}
|
|
43351
43382
|
|
|
43352
43383
|
// packages/agent-code-review/src/mcp.ts
|
|
43353
|
-
|
|
43384
|
+
init_src17();
|
|
43354
43385
|
|
|
43355
43386
|
// packages/toolcraft/src/mcp.ts
|
|
43356
43387
|
import { access as access3, lstat as lstat12, readFile as readFile13, rename as rename11, unlink as unlink8, writeFile as writeFile10 } from "node:fs/promises";
|
|
43357
43388
|
|
|
43358
43389
|
// packages/tiny-stdio-mcp-server/src/server.ts
|
|
43359
43390
|
import * as readline2 from "readline";
|
|
43391
|
+
import AjvModule from "ajv";
|
|
43392
|
+
import uriTemplateParser from "uri-template";
|
|
43393
|
+
import UriTemplate from "uri-template-lite";
|
|
43360
43394
|
|
|
43361
43395
|
// packages/tiny-stdio-mcp-server/src/types.ts
|
|
43362
43396
|
var JSON_RPC_ERROR_CODES = Object.freeze({
|
|
@@ -43364,7 +43398,8 @@ var JSON_RPC_ERROR_CODES = Object.freeze({
|
|
|
43364
43398
|
INVALID_REQUEST: -32600,
|
|
43365
43399
|
METHOD_NOT_FOUND: -32601,
|
|
43366
43400
|
INVALID_PARAMS: -32602,
|
|
43367
|
-
INTERNAL_ERROR: -32603
|
|
43401
|
+
INTERNAL_ERROR: -32603,
|
|
43402
|
+
RESOURCE_NOT_FOUND: -32002
|
|
43368
43403
|
});
|
|
43369
43404
|
var ToolError = class extends Error {
|
|
43370
43405
|
constructor(code, message2) {
|
|
@@ -43867,12 +43902,21 @@ var SUPPORTED_PROTOCOL_VERSIONS = /* @__PURE__ */ new Set([
|
|
|
43867
43902
|
PROTOCOL_VERSION
|
|
43868
43903
|
]);
|
|
43869
43904
|
function createServer(options) {
|
|
43905
|
+
const Ajv = "default" in AjvModule ? AjvModule.default : AjvModule;
|
|
43906
|
+
const jsonSchemaValidator = new Ajv({ strict: false });
|
|
43907
|
+
const supportNotifications = options.supportNotifications !== false;
|
|
43908
|
+
const supportResourceSubscriptions = options.supportResourceSubscriptions !== false;
|
|
43870
43909
|
const tools = /* @__PURE__ */ new Map();
|
|
43910
|
+
const prompts = /* @__PURE__ */ new Map();
|
|
43911
|
+
const resources = /* @__PURE__ */ new Map();
|
|
43912
|
+
const resourceTemplates = /* @__PURE__ */ new Map();
|
|
43871
43913
|
const notificationListeners = /* @__PURE__ */ new Set();
|
|
43872
43914
|
const connectionNotificationListeners = /* @__PURE__ */ new Map();
|
|
43873
43915
|
const defaultLifecycle = {
|
|
43874
43916
|
initialized: false,
|
|
43875
|
-
initializeAccepted: false
|
|
43917
|
+
initializeAccepted: false,
|
|
43918
|
+
notificationReady: false,
|
|
43919
|
+
resourceSubscriptions: /* @__PURE__ */ new Set()
|
|
43876
43920
|
};
|
|
43877
43921
|
const messageLifecycles = /* @__PURE__ */ new Set([defaultLifecycle]);
|
|
43878
43922
|
const handleMessageWithLifecycle = async (method, lifecycle, params) => {
|
|
@@ -43882,12 +43926,20 @@ function createServer(options) {
|
|
|
43882
43926
|
if (method === "initialize") {
|
|
43883
43927
|
lifecycle.initializeAccepted = true;
|
|
43884
43928
|
lifecycle.initialized = true;
|
|
43929
|
+
lifecycle.notificationReady = false;
|
|
43885
43930
|
const requestedProtocol = typeof params?.protocolVersion === "string" ? params.protocolVersion : void 0;
|
|
43886
43931
|
const result = {
|
|
43887
43932
|
protocolVersion: requestedProtocol !== void 0 && SUPPORTED_PROTOCOL_VERSIONS.has(requestedProtocol) ? requestedProtocol : PROTOCOL_VERSION,
|
|
43888
43933
|
capabilities: {
|
|
43889
43934
|
tools: {
|
|
43890
|
-
listChanged: true
|
|
43935
|
+
...supportNotifications ? { listChanged: true } : {}
|
|
43936
|
+
},
|
|
43937
|
+
prompts: {
|
|
43938
|
+
...supportNotifications ? { listChanged: true } : {}
|
|
43939
|
+
},
|
|
43940
|
+
resources: {
|
|
43941
|
+
...supportNotifications ? { listChanged: true } : {},
|
|
43942
|
+
...supportResourceSubscriptions ? { subscribe: true } : {}
|
|
43891
43943
|
}
|
|
43892
43944
|
},
|
|
43893
43945
|
serverInfo: {
|
|
@@ -43906,6 +43958,7 @@ function createServer(options) {
|
|
|
43906
43958
|
}
|
|
43907
43959
|
};
|
|
43908
43960
|
}
|
|
43961
|
+
lifecycle.notificationReady = true;
|
|
43909
43962
|
return { result: void 0 };
|
|
43910
43963
|
}
|
|
43911
43964
|
if (!lifecycle.initialized) {
|
|
@@ -43919,10 +43972,10 @@ function createServer(options) {
|
|
|
43919
43972
|
if (method === "tools/list") {
|
|
43920
43973
|
const toolList = [];
|
|
43921
43974
|
for (const tool of tools.values()) {
|
|
43975
|
+
const descriptor = { ...tool };
|
|
43976
|
+
delete descriptor.handler;
|
|
43922
43977
|
toolList.push({
|
|
43923
|
-
|
|
43924
|
-
description: tool.description,
|
|
43925
|
-
inputSchema: tool.inputSchema
|
|
43978
|
+
...descriptor
|
|
43926
43979
|
});
|
|
43927
43980
|
}
|
|
43928
43981
|
return { result: { tools: toolList } };
|
|
@@ -43947,7 +44000,7 @@ function createServer(options) {
|
|
|
43947
44000
|
};
|
|
43948
44001
|
}
|
|
43949
44002
|
const toolArgs = params?.arguments ?? {};
|
|
43950
|
-
if (options.validateToolArguments !== false && !
|
|
44003
|
+
if (options.validateToolArguments !== false && !jsonSchemaValidator.validate(tool.inputSchema, toolArgs)) {
|
|
43951
44004
|
return {
|
|
43952
44005
|
error: {
|
|
43953
44006
|
code: JSON_RPC_ERROR_CODES.INVALID_PARAMS,
|
|
@@ -43961,6 +44014,9 @@ function createServer(options) {
|
|
|
43961
44014
|
throw new Error("Invalid tool result");
|
|
43962
44015
|
}
|
|
43963
44016
|
const result = isCallToolResult2(handlerResult) ? handlerResult : { content: toContentBlocks(handlerResult) };
|
|
44017
|
+
if (tool.outputSchema !== void 0 && (result.structuredContent === void 0 || !jsonSchemaValidator.validate(tool.outputSchema, result.structuredContent))) {
|
|
44018
|
+
throw new Error("Invalid structured tool result");
|
|
44019
|
+
}
|
|
43964
44020
|
return { result };
|
|
43965
44021
|
} catch (err) {
|
|
43966
44022
|
if (err instanceof ToolError) {
|
|
@@ -43979,6 +44035,94 @@ function createServer(options) {
|
|
|
43979
44035
|
return { result };
|
|
43980
44036
|
}
|
|
43981
44037
|
}
|
|
44038
|
+
if (method === "prompts/list") {
|
|
44039
|
+
return {
|
|
44040
|
+
result: {
|
|
44041
|
+
prompts: [...prompts.values()].map(({ handler: _handler, ...prompt }) => prompt)
|
|
44042
|
+
}
|
|
44043
|
+
};
|
|
44044
|
+
}
|
|
44045
|
+
if (method === "prompts/get") {
|
|
44046
|
+
const promptName = typeof params?.name === "string" ? params.name : void 0;
|
|
44047
|
+
if (promptName === void 0) {
|
|
44048
|
+
return invalidParams2("Prompt name required");
|
|
44049
|
+
}
|
|
44050
|
+
const prompt = prompts.get(promptName);
|
|
44051
|
+
if (prompt === void 0) {
|
|
44052
|
+
return invalidParams2(`Prompt not found: ${promptName}`);
|
|
44053
|
+
}
|
|
44054
|
+
const args = toStringArguments(params?.arguments);
|
|
44055
|
+
if (args === void 0 || !hasRequiredPromptArguments(prompt, args)) {
|
|
44056
|
+
return invalidParams2("Invalid prompt arguments");
|
|
44057
|
+
}
|
|
44058
|
+
try {
|
|
44059
|
+
const result = await prompt.handler(args);
|
|
44060
|
+
if (!isGetPromptResult(result)) {
|
|
44061
|
+
return internalError2("Invalid prompt result");
|
|
44062
|
+
}
|
|
44063
|
+
return { result };
|
|
44064
|
+
} catch (error2) {
|
|
44065
|
+
return internalError2(toErrorMessage3(error2));
|
|
44066
|
+
}
|
|
44067
|
+
}
|
|
44068
|
+
if (method === "resources/list") {
|
|
44069
|
+
return {
|
|
44070
|
+
result: {
|
|
44071
|
+
resources: [...resources.values()].map(({ handler: _handler, ...resource }) => resource)
|
|
44072
|
+
}
|
|
44073
|
+
};
|
|
44074
|
+
}
|
|
44075
|
+
if (method === "resources/templates/list") {
|
|
44076
|
+
return {
|
|
44077
|
+
result: {
|
|
44078
|
+
resourceTemplates: [...resourceTemplates.values()].map(
|
|
44079
|
+
({ handler: _handler, ...resourceTemplate }) => resourceTemplate
|
|
44080
|
+
)
|
|
44081
|
+
}
|
|
44082
|
+
};
|
|
44083
|
+
}
|
|
44084
|
+
if (method === "resources/read") {
|
|
44085
|
+
const uri = typeof params?.uri === "string" ? params.uri : void 0;
|
|
44086
|
+
if (uri === void 0 || !isValidUri(uri)) {
|
|
44087
|
+
return invalidParams2("Resource URI required");
|
|
44088
|
+
}
|
|
44089
|
+
const resource = findReadableResource(uri, resources, resourceTemplates);
|
|
44090
|
+
if (resource === void 0) {
|
|
44091
|
+
return resourceNotFound2(uri);
|
|
44092
|
+
}
|
|
44093
|
+
try {
|
|
44094
|
+
const result = await resource.handler(uri);
|
|
44095
|
+
if (!isReadResourceResult(result)) {
|
|
44096
|
+
return internalError2("Invalid resource result");
|
|
44097
|
+
}
|
|
44098
|
+
return { result };
|
|
44099
|
+
} catch (error2) {
|
|
44100
|
+
return internalError2(toErrorMessage3(error2));
|
|
44101
|
+
}
|
|
44102
|
+
}
|
|
44103
|
+
if (method === "resources/subscribe" || method === "resources/unsubscribe") {
|
|
44104
|
+
if (!supportResourceSubscriptions) {
|
|
44105
|
+
return {
|
|
44106
|
+
error: {
|
|
44107
|
+
code: JSON_RPC_ERROR_CODES.METHOD_NOT_FOUND,
|
|
44108
|
+
message: "Method not found"
|
|
44109
|
+
}
|
|
44110
|
+
};
|
|
44111
|
+
}
|
|
44112
|
+
const uri = typeof params?.uri === "string" ? params.uri : void 0;
|
|
44113
|
+
if (uri === void 0 || !isValidUri(uri)) {
|
|
44114
|
+
return invalidParams2("Resource URI required");
|
|
44115
|
+
}
|
|
44116
|
+
if (method === "resources/subscribe" && findReadableResource(uri, resources, resourceTemplates) === void 0) {
|
|
44117
|
+
return resourceNotFound2(uri);
|
|
44118
|
+
}
|
|
44119
|
+
if (method === "resources/subscribe") {
|
|
44120
|
+
lifecycle.resourceSubscriptions.add(uri);
|
|
44121
|
+
} else {
|
|
44122
|
+
lifecycle.resourceSubscriptions.delete(uri);
|
|
44123
|
+
}
|
|
44124
|
+
return { result: {} };
|
|
44125
|
+
}
|
|
43982
44126
|
return {
|
|
43983
44127
|
error: {
|
|
43984
44128
|
code: JSON_RPC_ERROR_CODES.METHOD_NOT_FOUND,
|
|
@@ -43986,15 +44130,23 @@ function createServer(options) {
|
|
|
43986
44130
|
}
|
|
43987
44131
|
};
|
|
43988
44132
|
};
|
|
43989
|
-
const createMessageSession = () => {
|
|
44133
|
+
const createMessageSession = (listener) => {
|
|
43990
44134
|
const lifecycle = {
|
|
43991
44135
|
initialized: false,
|
|
43992
|
-
initializeAccepted: false
|
|
44136
|
+
initializeAccepted: false,
|
|
44137
|
+
notificationReady: false,
|
|
44138
|
+
resourceSubscriptions: /* @__PURE__ */ new Set()
|
|
43993
44139
|
};
|
|
43994
44140
|
messageLifecycles.add(lifecycle);
|
|
44141
|
+
if (listener !== void 0) {
|
|
44142
|
+
connectionNotificationListeners.set(listener, lifecycle);
|
|
44143
|
+
}
|
|
43995
44144
|
return {
|
|
43996
44145
|
handleMessage: (method, params) => handleMessageWithLifecycle(method, lifecycle, params),
|
|
43997
44146
|
close: () => {
|
|
44147
|
+
if (listener !== void 0) {
|
|
44148
|
+
connectionNotificationListeners.delete(listener);
|
|
44149
|
+
}
|
|
43998
44150
|
messageLifecycles.delete(lifecycle);
|
|
43999
44151
|
}
|
|
44000
44152
|
};
|
|
@@ -44029,17 +44181,18 @@ function createServer(options) {
|
|
|
44029
44181
|
write2(formatSuccessResponse(requestWithId.id, result) + "\n");
|
|
44030
44182
|
}
|
|
44031
44183
|
};
|
|
44032
|
-
const broadcastNotification = async (method) => {
|
|
44184
|
+
const broadcastNotification = async (method, params, canSend = () => true) => {
|
|
44033
44185
|
const notification = {
|
|
44034
44186
|
jsonrpc: "2.0",
|
|
44035
|
-
method
|
|
44187
|
+
method,
|
|
44188
|
+
...params === void 0 ? {} : { params }
|
|
44036
44189
|
};
|
|
44037
44190
|
for (const listener of notificationListeners) {
|
|
44038
44191
|
listener(notification);
|
|
44039
44192
|
}
|
|
44040
44193
|
await Promise.all(
|
|
44041
44194
|
[...connectionNotificationListeners].map(async ([listener, lifecycle]) => {
|
|
44042
|
-
if (lifecycle.
|
|
44195
|
+
if (lifecycle.notificationReady && canSend(lifecycle)) {
|
|
44043
44196
|
await listener(notification);
|
|
44044
44197
|
}
|
|
44045
44198
|
})
|
|
@@ -44055,6 +44208,30 @@ function createServer(options) {
|
|
|
44055
44208
|
});
|
|
44056
44209
|
return server;
|
|
44057
44210
|
},
|
|
44211
|
+
registerTool(definition, handler) {
|
|
44212
|
+
tools.set(definition.name, {
|
|
44213
|
+
...definition,
|
|
44214
|
+
handler
|
|
44215
|
+
});
|
|
44216
|
+
return server;
|
|
44217
|
+
},
|
|
44218
|
+
prompt(definition, handler) {
|
|
44219
|
+
prompts.set(definition.name, { ...definition, handler });
|
|
44220
|
+
return server;
|
|
44221
|
+
},
|
|
44222
|
+
resource(definition, handler) {
|
|
44223
|
+
if (!isValidUri(definition.uri)) {
|
|
44224
|
+
throw new Error(`Invalid resource URI: ${definition.uri}`);
|
|
44225
|
+
}
|
|
44226
|
+
resources.set(definition.uri, { ...definition, handler });
|
|
44227
|
+
return server;
|
|
44228
|
+
},
|
|
44229
|
+
resourceTemplate(definition, handler) {
|
|
44230
|
+
uriTemplateParser.parse(definition.uriTemplate);
|
|
44231
|
+
new UriTemplate(definition.uriTemplate);
|
|
44232
|
+
resourceTemplates.set(definition.uriTemplate, { ...definition, handler });
|
|
44233
|
+
return server;
|
|
44234
|
+
},
|
|
44058
44235
|
onNotification(listener) {
|
|
44059
44236
|
notificationListeners.add(listener);
|
|
44060
44237
|
return () => {
|
|
@@ -44064,11 +44241,40 @@ function createServer(options) {
|
|
|
44064
44241
|
removeTool(name) {
|
|
44065
44242
|
return tools.delete(name);
|
|
44066
44243
|
},
|
|
44244
|
+
removePrompt(name) {
|
|
44245
|
+
return prompts.delete(name);
|
|
44246
|
+
},
|
|
44247
|
+
removeResource(uri) {
|
|
44248
|
+
return resources.delete(uri);
|
|
44249
|
+
},
|
|
44250
|
+
removeResourceTemplate(uriTemplate) {
|
|
44251
|
+
return resourceTemplates.delete(uriTemplate);
|
|
44252
|
+
},
|
|
44067
44253
|
async notifyToolsChanged() {
|
|
44068
|
-
if ([...messageLifecycles].some((lifecycle) => lifecycle.
|
|
44254
|
+
if (supportNotifications && [...messageLifecycles].some((lifecycle) => lifecycle.notificationReady)) {
|
|
44069
44255
|
await broadcastNotification("notifications/tools/list_changed");
|
|
44070
44256
|
}
|
|
44071
44257
|
},
|
|
44258
|
+
async notifyPromptsChanged() {
|
|
44259
|
+
if (supportNotifications && [...messageLifecycles].some((lifecycle) => lifecycle.notificationReady)) {
|
|
44260
|
+
await broadcastNotification("notifications/prompts/list_changed");
|
|
44261
|
+
}
|
|
44262
|
+
},
|
|
44263
|
+
async notifyResourcesChanged() {
|
|
44264
|
+
if (supportNotifications && [...messageLifecycles].some((lifecycle) => lifecycle.notificationReady)) {
|
|
44265
|
+
await broadcastNotification("notifications/resources/list_changed");
|
|
44266
|
+
}
|
|
44267
|
+
},
|
|
44268
|
+
async notifyResourceUpdated(uri) {
|
|
44269
|
+
if (!supportResourceSubscriptions) {
|
|
44270
|
+
return;
|
|
44271
|
+
}
|
|
44272
|
+
await broadcastNotification(
|
|
44273
|
+
"notifications/resources/updated",
|
|
44274
|
+
{ uri },
|
|
44275
|
+
(lifecycle) => lifecycle.resourceSubscriptions.has(uri)
|
|
44276
|
+
);
|
|
44277
|
+
},
|
|
44072
44278
|
createMessageSession,
|
|
44073
44279
|
handleMessage,
|
|
44074
44280
|
async listen() {
|
|
@@ -44079,7 +44285,7 @@ function createServer(options) {
|
|
|
44079
44285
|
},
|
|
44080
44286
|
async connect(transport) {
|
|
44081
44287
|
return new Promise((resolve7) => {
|
|
44082
|
-
const lifecycle = { initialized: false, initializeAccepted: false };
|
|
44288
|
+
const lifecycle = { initialized: false, initializeAccepted: false, notificationReady: false, resourceSubscriptions: /* @__PURE__ */ new Set() };
|
|
44083
44289
|
const messageHandler = (method, params) => handleMessageWithLifecycle(method, lifecycle, params);
|
|
44084
44290
|
messageLifecycles.add(lifecycle);
|
|
44085
44291
|
const listener = (notification) => {
|
|
@@ -44109,7 +44315,7 @@ function createServer(options) {
|
|
|
44109
44315
|
},
|
|
44110
44316
|
async connectSDK(transport) {
|
|
44111
44317
|
return new Promise((resolve7, reject) => {
|
|
44112
|
-
const lifecycle = { initialized: false, initializeAccepted: false };
|
|
44318
|
+
const lifecycle = { initialized: false, initializeAccepted: false, notificationReady: false, resourceSubscriptions: /* @__PURE__ */ new Set() };
|
|
44113
44319
|
const messageHandler = (method, params) => handleMessageWithLifecycle(method, lifecycle, params);
|
|
44114
44320
|
messageLifecycles.add(lifecycle);
|
|
44115
44321
|
const listener = (notification) => transport.send(notification);
|
|
@@ -44169,35 +44375,99 @@ function createServer(options) {
|
|
|
44169
44375
|
};
|
|
44170
44376
|
return server;
|
|
44171
44377
|
}
|
|
44172
|
-
function
|
|
44173
|
-
return
|
|
44378
|
+
function invalidParams2(message2) {
|
|
44379
|
+
return {
|
|
44380
|
+
error: {
|
|
44381
|
+
code: JSON_RPC_ERROR_CODES.INVALID_PARAMS,
|
|
44382
|
+
message: message2
|
|
44383
|
+
}
|
|
44384
|
+
};
|
|
44174
44385
|
}
|
|
44175
|
-
function
|
|
44176
|
-
return
|
|
44386
|
+
function internalError2(message2) {
|
|
44387
|
+
return {
|
|
44388
|
+
error: {
|
|
44389
|
+
code: JSON_RPC_ERROR_CODES.INTERNAL_ERROR,
|
|
44390
|
+
message: message2
|
|
44391
|
+
}
|
|
44392
|
+
};
|
|
44177
44393
|
}
|
|
44178
|
-
function
|
|
44179
|
-
|
|
44394
|
+
function resourceNotFound2(uri) {
|
|
44395
|
+
return {
|
|
44396
|
+
error: {
|
|
44397
|
+
code: JSON_RPC_ERROR_CODES.RESOURCE_NOT_FOUND,
|
|
44398
|
+
message: `Resource not found: ${uri}`
|
|
44399
|
+
}
|
|
44400
|
+
};
|
|
44401
|
+
}
|
|
44402
|
+
function toErrorMessage3(error2) {
|
|
44403
|
+
return error2 instanceof Error ? error2.message : String(error2);
|
|
44404
|
+
}
|
|
44405
|
+
function isValidUri(uri) {
|
|
44406
|
+
try {
|
|
44407
|
+
new URL(uri);
|
|
44408
|
+
return true;
|
|
44409
|
+
} catch {
|
|
44180
44410
|
return false;
|
|
44181
44411
|
}
|
|
44182
|
-
|
|
44183
|
-
|
|
44184
|
-
|
|
44185
|
-
|
|
44186
|
-
}
|
|
44412
|
+
}
|
|
44413
|
+
function toStringArguments(value) {
|
|
44414
|
+
if (value === void 0) {
|
|
44415
|
+
return {};
|
|
44187
44416
|
}
|
|
44188
|
-
|
|
44189
|
-
|
|
44190
|
-
|
|
44191
|
-
|
|
44192
|
-
|
|
44193
|
-
if (argument
|
|
44194
|
-
|
|
44195
|
-
}
|
|
44196
|
-
if (property.type === "array" && !Array.isArray(argument) || property.type === "object" && (typeof argument !== "object" || argument === null || Array.isArray(argument)) || property.type === "integer" && !Number.isInteger(argument) || property.type !== "array" && property.type !== "object" && property.type !== "integer" && typeof argument !== property.type) {
|
|
44197
|
-
return false;
|
|
44417
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
44418
|
+
return void 0;
|
|
44419
|
+
}
|
|
44420
|
+
const args = {};
|
|
44421
|
+
for (const [name, argument] of Object.entries(value)) {
|
|
44422
|
+
if (typeof argument !== "string") {
|
|
44423
|
+
return void 0;
|
|
44198
44424
|
}
|
|
44425
|
+
args[name] = argument;
|
|
44199
44426
|
}
|
|
44200
|
-
return
|
|
44427
|
+
return args;
|
|
44428
|
+
}
|
|
44429
|
+
function hasRequiredPromptArguments(prompt, args) {
|
|
44430
|
+
return (prompt.arguments ?? []).every(
|
|
44431
|
+
(argument) => argument.required !== true || args[argument.name] !== void 0
|
|
44432
|
+
);
|
|
44433
|
+
}
|
|
44434
|
+
function findReadableResource(uri, resources, resourceTemplates) {
|
|
44435
|
+
const resource = resources.get(uri);
|
|
44436
|
+
if (resource !== void 0) {
|
|
44437
|
+
return resource;
|
|
44438
|
+
}
|
|
44439
|
+
return [...resourceTemplates.values()].find(
|
|
44440
|
+
(template) => matchesUriTemplate(template.uriTemplate, uri)
|
|
44441
|
+
);
|
|
44442
|
+
}
|
|
44443
|
+
function matchesUriTemplate(template, uri) {
|
|
44444
|
+
try {
|
|
44445
|
+
return new UriTemplate(template).match(uri) !== null;
|
|
44446
|
+
} catch {
|
|
44447
|
+
return false;
|
|
44448
|
+
}
|
|
44449
|
+
}
|
|
44450
|
+
function isCallToolResult2(value) {
|
|
44451
|
+
return hasContentArray(value) && value.content.every(isContentItem2);
|
|
44452
|
+
}
|
|
44453
|
+
function isGetPromptResult(value) {
|
|
44454
|
+
if (typeof value !== "object" || value === null || !("messages" in value)) {
|
|
44455
|
+
return false;
|
|
44456
|
+
}
|
|
44457
|
+
return Array.isArray(value.messages) && value.messages.every(
|
|
44458
|
+
(message2) => typeof message2 === "object" && message2 !== null && "role" in message2 && (message2.role === "user" || message2.role === "assistant") && "content" in message2 && isPromptContentItem(message2.content)
|
|
44459
|
+
);
|
|
44460
|
+
}
|
|
44461
|
+
function isReadResourceResult(value) {
|
|
44462
|
+
if (typeof value !== "object" || value === null || !("contents" in value)) {
|
|
44463
|
+
return false;
|
|
44464
|
+
}
|
|
44465
|
+
return Array.isArray(value.contents) && value.contents.every(
|
|
44466
|
+
(content) => typeof content === "object" && content !== null && "uri" in content && typeof content.uri === "string" && isValidUri(content.uri) && ("text" in content && typeof content.text === "string" || "blob" in content && typeof content.blob === "string" && isBase64(content.blob))
|
|
44467
|
+
);
|
|
44468
|
+
}
|
|
44469
|
+
function hasContentArray(value) {
|
|
44470
|
+
return typeof value === "object" && value !== null && "content" in value && Array.isArray(value.content);
|
|
44201
44471
|
}
|
|
44202
44472
|
function isContentItem2(value) {
|
|
44203
44473
|
if (typeof value !== "object" || value === null || !("type" in value)) {
|
|
@@ -44208,13 +44478,41 @@ function isContentItem2(value) {
|
|
|
44208
44478
|
return typeof block.text === "string";
|
|
44209
44479
|
}
|
|
44210
44480
|
if (block.type === "image" || block.type === "audio") {
|
|
44211
|
-
return typeof block.data === "string" && typeof block.mimeType === "string";
|
|
44481
|
+
return typeof block.data === "string" && isBase64(block.data) && typeof block.mimeType === "string";
|
|
44482
|
+
}
|
|
44483
|
+
if (block.type === "resource_link") {
|
|
44484
|
+
return typeof block.uri === "string" && typeof block.name === "string";
|
|
44212
44485
|
}
|
|
44213
44486
|
if (block.type !== "resource" || typeof block.resource !== "object" || block.resource === null) {
|
|
44214
44487
|
return false;
|
|
44215
44488
|
}
|
|
44216
44489
|
const resource = block.resource;
|
|
44217
|
-
return typeof resource.uri === "string" && typeof resource.mimeType === "string" && (typeof resource.text === "string" || typeof resource.blob === "string");
|
|
44490
|
+
return typeof resource.uri === "string" && (resource.mimeType === void 0 || typeof resource.mimeType === "string") && (typeof resource.text === "string" || typeof resource.blob === "string" && isBase64(resource.blob));
|
|
44491
|
+
}
|
|
44492
|
+
function isBase64(value) {
|
|
44493
|
+
if (value.length === 0) {
|
|
44494
|
+
return true;
|
|
44495
|
+
}
|
|
44496
|
+
if (value.length % 4 !== 0) {
|
|
44497
|
+
return false;
|
|
44498
|
+
}
|
|
44499
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
44500
|
+
const paddingStart = value.indexOf("=");
|
|
44501
|
+
const encoded = paddingStart === -1 ? value : value.slice(0, paddingStart);
|
|
44502
|
+
const padding = paddingStart === -1 ? "" : value.slice(paddingStart);
|
|
44503
|
+
if (padding.length > 2 || [...padding].some((character) => character !== "=")) {
|
|
44504
|
+
return false;
|
|
44505
|
+
}
|
|
44506
|
+
if ([...encoded].some((character) => !alphabet.includes(character))) {
|
|
44507
|
+
return false;
|
|
44508
|
+
}
|
|
44509
|
+
return Buffer.from(value, "base64").toString("base64") === value;
|
|
44510
|
+
}
|
|
44511
|
+
function isPromptContentItem(value) {
|
|
44512
|
+
if (!isContentItem2(value)) {
|
|
44513
|
+
return false;
|
|
44514
|
+
}
|
|
44515
|
+
return !(typeof value === "object" && value !== null && "type" in value && value.type === "resource_link");
|
|
44218
44516
|
}
|
|
44219
44517
|
|
|
44220
44518
|
// packages/toolcraft/src/error-report.ts
|
|
@@ -44226,7 +44524,7 @@ import { CommanderError } from "commander";
|
|
|
44226
44524
|
|
|
44227
44525
|
// packages/toolcraft/src/mcp-proxy.ts
|
|
44228
44526
|
init_src2();
|
|
44229
|
-
|
|
44527
|
+
init_src10();
|
|
44230
44528
|
import { existsSync as existsSync4 } from "node:fs";
|
|
44231
44529
|
import { lstat as lstat10, mkdir as mkdir12, readFile as readFile11, rename as rename9, writeFile as writeFile7 } from "node:fs/promises";
|
|
44232
44530
|
import path57 from "node:path";
|
|
@@ -45580,10 +45878,10 @@ async function writeErrorReport(context) {
|
|
|
45580
45878
|
}
|
|
45581
45879
|
|
|
45582
45880
|
// packages/toolcraft/src/human-in-loop/approvals-commands.ts
|
|
45583
|
-
|
|
45881
|
+
init_src12();
|
|
45584
45882
|
|
|
45585
45883
|
// packages/toolcraft/src/human-in-loop/approval-tasks.ts
|
|
45586
|
-
|
|
45884
|
+
init_src12();
|
|
45587
45885
|
import { randomBytes as randomBytes5 } from "node:crypto";
|
|
45588
45886
|
|
|
45589
45887
|
// packages/toolcraft/src/human-in-loop/state-machine.ts
|
|
@@ -45768,7 +46066,7 @@ function areEqualStrings(left, right) {
|
|
|
45768
46066
|
}
|
|
45769
46067
|
|
|
45770
46068
|
// packages/toolcraft/src/human-in-loop/runner.ts
|
|
45771
|
-
|
|
46069
|
+
init_src12();
|
|
45772
46070
|
import { access as access2, lstat as lstat11, readFile as readFile12, rename as rename10, unlink as unlink7, writeFile as writeFile9 } from "node:fs/promises";
|
|
45773
46071
|
|
|
45774
46072
|
// packages/toolcraft/src/human-in-loop/default-provider.ts
|
|
@@ -47022,7 +47320,7 @@ async function runMCP(roots, options) {
|
|
|
47022
47320
|
}
|
|
47023
47321
|
|
|
47024
47322
|
// packages/agent-code-review/src/prompt-transport.ts
|
|
47025
|
-
|
|
47323
|
+
init_src17();
|
|
47026
47324
|
function shouldUseTextStdinForCodeReview(agent2) {
|
|
47027
47325
|
const config = getSpawnConfig(agent2);
|
|
47028
47326
|
return config?.kind === "cli" && (config.agentId === "codex" || config.agentId === "claude-code");
|
|
@@ -47515,7 +47813,7 @@ function requirePositiveInteger(value, field) {
|
|
|
47515
47813
|
// packages/agent-code-review/src/review.ts
|
|
47516
47814
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
47517
47815
|
import { resolve as resolve6 } from "node:path";
|
|
47518
|
-
|
|
47816
|
+
init_src17();
|
|
47519
47817
|
async function runCodeReview(input, dependencies = {}) {
|
|
47520
47818
|
const unresolvedOptions = await (dependencies.resolveOptions ?? resolveCodeReviewRuntimeOptions)(
|
|
47521
47819
|
input
|
|
@@ -47994,7 +48292,7 @@ function toAgentSessionMcpServers(servers) {
|
|
|
47994
48292
|
}
|
|
47995
48293
|
return Object.keys(mappedServers).length > 0 ? mappedServers : void 0;
|
|
47996
48294
|
}
|
|
47997
|
-
function
|
|
48295
|
+
function toErrorMessage4(value) {
|
|
47998
48296
|
if (value instanceof Error) {
|
|
47999
48297
|
return value.message;
|
|
48000
48298
|
}
|
|
@@ -48298,7 +48596,7 @@ function createInMemoryAcpTransport2(options) {
|
|
|
48298
48596
|
}
|
|
48299
48597
|
if (method === "session/new") {
|
|
48300
48598
|
const request = params;
|
|
48301
|
-
const { createAgentSession: createAgentSession2 } = await Promise.resolve().then(() => (
|
|
48599
|
+
const { createAgentSession: createAgentSession2 } = await Promise.resolve().then(() => (init_src18(), src_exports));
|
|
48302
48600
|
const session = await createAgentSession2({
|
|
48303
48601
|
model: options.model,
|
|
48304
48602
|
cwd: request.cwd || options.cwd,
|
|
@@ -48417,7 +48715,7 @@ async function runPoeAgentAcpLifecycle(options) {
|
|
|
48417
48715
|
} catch (error2) {
|
|
48418
48716
|
emitEvent(options.onEvent, {
|
|
48419
48717
|
event: "error",
|
|
48420
|
-
message:
|
|
48718
|
+
message: toErrorMessage4(error2),
|
|
48421
48719
|
...toErrorStack(error2) ? { stack: toErrorStack(error2) } : {}
|
|
48422
48720
|
});
|
|
48423
48721
|
throw error2;
|