@psnext/slingcli 2.5.20260615-2 → 2.5.20260617-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/node_modules/@aws-sdk/core/dist-cjs/index.js +45 -50
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +2 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +21 -22
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +51 -51
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +21 -22
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +19 -21
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +107 -109
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -4
- package/node_modules/@aws-sdk/core/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +4 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js +3 -7
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.browser.js +12 -16
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +16 -21
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js +14 -18
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js +1 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.browser.js +2 -5
- package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js +2 -7
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
- package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +47 -41
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js +8 -4
- package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js +14 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js +31 -33
- package/node_modules/@aws-sdk/credential-provider-login/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +16 -18
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +11 -13
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +22 -24
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BGYXHf8s.js +3 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +26 -28
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js +10 -14
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +2 -6
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +3 -27
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
- package/node_modules/@aws-sdk/eventstream-handler-node/dist-cjs/index.js +7 -9
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +3 -5
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-websocket/dist-cjs/index.js +16 -18
- package/node_modules/@aws-sdk/middleware-websocket/package.json +6 -6
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +0 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +82 -84
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +158 -119
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +80 -82
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +80 -82
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +99 -101
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js +4 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js +70 -35
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +3 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +12 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/endpoint/EndpointParameters.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +3 -0
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -13
- package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/package.json +9 -8
- package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +4 -6
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +5 -5
- package/node_modules/@aws-sdk/types/dist-cjs/index.js +7 -8
- package/node_modules/@aws-sdk/types/package.json +4 -4
- package/node_modules/@aws-sdk/util-locate-window/dist-cjs/index.js +0 -2
- package/node_modules/@aws-sdk/util-locate-window/package.json +4 -4
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +2 -4
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js +4 -7
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.browser.js +2 -5
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js +7 -10
- package/node_modules/@aws-sdk/xml-builder/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +21 -57
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +277 -175
- package/node_modules/@earendil-works/pi-ai/dist/models.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +52 -34
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +11 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +7 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +15 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +18 -17
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +21 -8
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +8 -7
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +17 -22
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js +44 -0
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bun/restore-sandbox-env.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +10 -7
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +8 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +10 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/vendor/marked.min.js +75 -3
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +17 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +8 -4
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.js +19 -19
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +6 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +17 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +0 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/session-selector.js +0 -5
- package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +6 -6
- package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +23 -5
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +17 -17
- package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +5 -1
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/index.js +13 -15
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +29 -31
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.browser.js +2 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js +7 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.native.js +3 -5
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +22 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +10 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +38 -39
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +10 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +14 -17
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +20 -23
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +9 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +11 -13
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +59 -60
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +23 -24
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +25 -26
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +5 -7
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +4 -6
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +23 -25
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +4 -6
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +2 -4
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
- package/node_modules/@smithy/core/package.json +7 -6
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +23 -24
- package/node_modules/@smithy/credential-provider-imds/package.json +6 -6
- package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +6 -8
- package/node_modules/@smithy/fetch-http-handler/package.json +7 -7
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +27 -29
- package/node_modules/@smithy/signature-v4/package.json +6 -6
- package/node_modules/@smithy/types/dist-cjs/index.js +23 -18
- package/node_modules/@smithy/types/package.json +4 -4
- package/node_modules/marked/README.md +13 -4
- package/node_modules/marked/bin/main.js +16 -14
- package/node_modules/marked/bin/marked.js +2 -1
- package/node_modules/marked/lib/marked.d.ts +157 -125
- package/node_modules/marked/lib/marked.esm.js +67 -2179
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +67 -2201
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +4 -2
- package/node_modules/marked/man/marked.1.md +2 -1
- package/node_modules/marked/package.json +27 -35
- package/node_modules/undici/docs/docs/api/Client.md +3 -0
- package/node_modules/undici/docs/docs/api/Cookies.md +27 -0
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +1 -0
- package/node_modules/undici/lib/core/socks5-client.js +14 -4
- package/node_modules/undici/lib/core/socks5-utils.js +18 -4
- package/node_modules/undici/lib/dispatcher/agent.js +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/client-h1.js +69 -1
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +19 -0
- package/node_modules/undici/lib/dispatcher/pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +2 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +45 -34
- package/node_modules/undici/lib/util/cache.js +8 -2
- package/node_modules/undici/lib/web/cookies/parse.js +17 -25
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +13 -31
- package/node_modules/undici/lib/web/websocket/receiver.js +80 -23
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
- package/node_modules/undici/lib/web/websocket/websocket.js +8 -1
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +16 -0
- package/package.json +6 -6
- package/slingshot/index.js +253 -253
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js +0 -8
- package/node_modules/marked/lib/marked.cjs +0 -2211
- package/node_modules/marked/lib/marked.cjs.map +0 -7
- package/node_modules/marked/lib/marked.d.cts +0 -728
- package/node_modules/marked/marked.min.js +0 -69
- /package/node_modules/marked/{LICENSE.md → LICENSE} +0 -0
|
@@ -20,7 +20,7 @@ import { createAgentSessionFromServices, createAgentSessionServices, } from "./c
|
|
|
20
20
|
import { formatNoModelsAvailableMessage } from "./core/auth-guidance.js";
|
|
21
21
|
import { AuthStorage } from "./core/auth-storage.js";
|
|
22
22
|
import { exportFromFile } from "./core/export-html/index.js";
|
|
23
|
-
import { configureHttpDispatcher } from "./core/http-dispatcher.js";
|
|
23
|
+
import { applyHttpProxySettings, configureHttpDispatcher } from "./core/http-dispatcher.js";
|
|
24
24
|
import { resolveCliModel, resolveModelScope } from "./core/model-resolver.js";
|
|
25
25
|
import { restoreStdout, takeOverStdout } from "./core/output-guard.js";
|
|
26
26
|
import { resolveProjectTrusted } from "./core/project-trust.js";
|
|
@@ -360,8 +360,21 @@ export async function main(args, options) {
|
|
|
360
360
|
if (process.platform === "win32") {
|
|
361
361
|
cleanupWindowsSelfUpdateQuarantine(getPackageDir());
|
|
362
362
|
}
|
|
363
|
+
const cwd = process.cwd();
|
|
364
|
+
const agentDir = getAgentDir();
|
|
365
|
+
const bootstrapSettingsManager = SettingsManager.create(cwd, agentDir, { projectTrusted: false });
|
|
366
|
+
applyHttpProxySettings(bootstrapSettingsManager.getGlobalSettings().httpProxy);
|
|
367
|
+
configureHttpDispatcher();
|
|
363
368
|
if (await handlePackageCommand(args, { extensionFactories: options?.extensionFactories })) {
|
|
364
|
-
process.
|
|
369
|
+
const exitCode = process.exitCode ?? 0;
|
|
370
|
+
if (process.platform === "win32" && exitCode === 0 && args[0] === "update") {
|
|
371
|
+
// We normally prefer process.exit(0) for package commands so bad extensions cannot keep
|
|
372
|
+
// one-shot commands alive. On Windows, Node can assert after fetch() if process.exit(0)
|
|
373
|
+
// runs during teardown; let successful `pi update` drain naturally instead.
|
|
374
|
+
// https://github.com/nodejs/node/issues/56645
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
process.exit(exitCode);
|
|
365
378
|
return;
|
|
366
379
|
}
|
|
367
380
|
if (await handleConfigCommand(args, { extensionFactories: options?.extensionFactories })) {
|
|
@@ -408,10 +421,8 @@ export async function main(args, options) {
|
|
|
408
421
|
validateForkFlags(parsed);
|
|
409
422
|
validateSessionIdFlags(parsed);
|
|
410
423
|
// Run migrations (pass cwd for project-local migrations)
|
|
411
|
-
const { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(
|
|
424
|
+
const { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(cwd);
|
|
412
425
|
time("runMigrations");
|
|
413
|
-
const cwd = process.cwd();
|
|
414
|
-
const agentDir = getAgentDir();
|
|
415
426
|
const startupSettingsManager = SettingsManager.create(cwd, agentDir);
|
|
416
427
|
reportDiagnostics(collectSettingsDiagnostics(startupSettingsManager, "startup session lookup"));
|
|
417
428
|
// Experimental first-time setup: theme choice and analytics opt-in.
|
|
@@ -577,6 +588,7 @@ export async function main(args, options) {
|
|
|
577
588
|
time("createAgentSessionRuntime");
|
|
578
589
|
const { services, session, modelFallbackMessage } = runtime;
|
|
579
590
|
const { settingsManager, modelRegistry, resourceLoader } = services;
|
|
591
|
+
applyHttpProxySettings(settingsManager.getGlobalSettings().httpProxy);
|
|
580
592
|
configureHttpDispatcher(settingsManager.getHttpIdleTimeoutMs());
|
|
581
593
|
if (parsed.help) {
|
|
582
594
|
const extensionFlags = resourceLoader
|
package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
2
2
|
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
|
+
import { areExperimentalFeaturesEnabled } from "../../../core/experimental.js";
|
|
3
4
|
import { theme } from "../theme/theme.js";
|
|
4
5
|
/**
|
|
5
6
|
* Sanitize text for display in a single-line status.
|
|
@@ -144,6 +145,9 @@ export class FooterComponent {
|
|
|
144
145
|
contextPercentStr = contextPercentDisplay;
|
|
145
146
|
}
|
|
146
147
|
statsParts.push(contextPercentStr);
|
|
148
|
+
if (areExperimentalFeaturesEnabled()) {
|
|
149
|
+
statsParts.push(`${theme.fg("dim", "•")} ${theme.bold(theme.fg("warning", "xp"))}`);
|
|
150
|
+
}
|
|
147
151
|
let statsLeft = statsParts.join(" ");
|
|
148
152
|
// Add model name on the right side, plus thinking level if model supports it
|
|
149
153
|
const modelName = state.model?.id || "no-model";
|
|
@@ -101,7 +101,6 @@ export class LoginDialogComponent extends Container {
|
|
|
101
101
|
this.contentContainer.addChild(new Text(theme.fg("dim", hyperlink), 1, 0));
|
|
102
102
|
this.contentContainer.addChild(new Spacer(1));
|
|
103
103
|
this.contentContainer.addChild(new Text(theme.fg("warning", `Enter code: ${info.userCode}`), 1, 0));
|
|
104
|
-
openBrowser(info.verificationUri);
|
|
105
104
|
this.tui.requestRender();
|
|
106
105
|
}
|
|
107
106
|
/**
|
|
@@ -587,7 +587,6 @@ export class SessionSelectorComponent extends Container {
|
|
|
587
587
|
allSessions = null;
|
|
588
588
|
currentSessionsLoader;
|
|
589
589
|
allSessionsLoader;
|
|
590
|
-
onCancel;
|
|
591
590
|
requestRender;
|
|
592
591
|
renameSession;
|
|
593
592
|
currentLoading = false;
|
|
@@ -627,7 +626,6 @@ export class SessionSelectorComponent extends Container {
|
|
|
627
626
|
this.keybindings = options?.keybindings ?? KeybindingsManager.create();
|
|
628
627
|
this.currentSessionsLoader = currentSessionsLoader;
|
|
629
628
|
this.allSessionsLoader = allSessionsLoader;
|
|
630
|
-
this.onCancel = onCancel;
|
|
631
629
|
this.requestRender = requestRender;
|
|
632
630
|
this.header = new SessionSelectorHeader(this.scope, this.sortMode, this.nameFilter, this.requestRender);
|
|
633
631
|
const renameSession = options?.renameSession;
|
|
@@ -793,9 +791,6 @@ export class SessionSelectorComponent extends Container {
|
|
|
793
791
|
this.header.setLoading(false);
|
|
794
792
|
this.sessionList.setSessions(sessions, showCwd);
|
|
795
793
|
this.requestRender();
|
|
796
|
-
if (scope === "all" && sessions.length === 0 && (this.currentSessions?.length ?? 0) === 0) {
|
|
797
|
-
this.onCancel();
|
|
798
|
-
}
|
|
799
794
|
}
|
|
800
795
|
catch (err) {
|
|
801
796
|
if (scope === "current") {
|
|
@@ -78,7 +78,7 @@ Remove a package and its source from settings.
|
|
|
78
78
|
Alias: ${APP_NAME} uninstall <source> [-l]
|
|
79
79
|
|
|
80
80
|
Options:
|
|
81
|
-
-l, --local Remove from project settings (.
|
|
81
|
+
-l, --local Remove from project settings (.pi/settings.json)
|
|
82
82
|
-a, --approve Trust project-local files for this command
|
|
83
83
|
-na, --no-approve Ignore project-local files for this command
|
|
84
84
|
|
|
@@ -91,20 +91,20 @@ Examples:
|
|
|
91
91
|
console.log(`${chalk.bold("Usage:")}
|
|
92
92
|
${getPackageCommandUsage("update")}
|
|
93
93
|
|
|
94
|
-
Update
|
|
94
|
+
Update pi and installed packages.
|
|
95
95
|
|
|
96
96
|
Options:
|
|
97
|
-
--self Update
|
|
97
|
+
--self Update pi only
|
|
98
98
|
--extensions Update installed packages only
|
|
99
99
|
--extension <source> Update one package only
|
|
100
100
|
-a, --approve Trust project-local files for this command
|
|
101
101
|
-na, --no-approve Ignore project-local files for this command
|
|
102
|
-
--force Reinstall
|
|
102
|
+
--force Reinstall pi even if the current version is latest
|
|
103
103
|
|
|
104
104
|
Short forms:
|
|
105
|
-
${APP_NAME} update Update
|
|
105
|
+
${APP_NAME} update Update pi and all extensions
|
|
106
106
|
${APP_NAME} update <source> Update one package
|
|
107
|
-
${APP_NAME} update
|
|
107
|
+
${APP_NAME} update pi Update pi only (self works as alias to pi)
|
|
108
108
|
`);
|
|
109
109
|
return;
|
|
110
110
|
case "list":
|
|
@@ -12,10 +12,13 @@ export function spawnProcessSync(command, args, options) {
|
|
|
12
12
|
/**
|
|
13
13
|
* Wait for a child process to terminate without hanging on inherited stdio handles.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* A short-lived child can `exit` while a detached descendant keeps its stdout/stderr
|
|
16
|
+
* pipe open. We must not resolve and destroy the streams on a fixed deadline measured
|
|
17
|
+
* from `exit`, or output still being written past that deadline is silently lost
|
|
18
|
+
* (earendil-works/pi#5303). Instead, after `exit` we wait for the pipes to fall idle:
|
|
19
|
+
* the grace timer is re-armed on every chunk, so an actively writing descendant keeps
|
|
20
|
+
* us reading, while a quiet inherited handle (e.g. a Windows daemonized descendant
|
|
21
|
+
* that never lets `close` fire) still releases us after the grace elapses.
|
|
19
22
|
*/
|
|
20
23
|
export function waitForChildProcess(child) {
|
|
21
24
|
return new Promise((resolve, reject) => {
|
|
@@ -35,6 +38,8 @@ export function waitForChildProcess(child) {
|
|
|
35
38
|
child.removeListener("close", onClose);
|
|
36
39
|
child.stdout?.removeListener("end", onStdoutEnd);
|
|
37
40
|
child.stderr?.removeListener("end", onStderrEnd);
|
|
41
|
+
child.stdout?.removeListener("data", onData);
|
|
42
|
+
child.stderr?.removeListener("data", onData);
|
|
38
43
|
};
|
|
39
44
|
const finalize = (code) => {
|
|
40
45
|
if (settled)
|
|
@@ -52,6 +57,17 @@ export function waitForChildProcess(child) {
|
|
|
52
57
|
finalize(exitCode);
|
|
53
58
|
}
|
|
54
59
|
};
|
|
60
|
+
const armIdleTimer = () => {
|
|
61
|
+
if (postExitTimer)
|
|
62
|
+
clearTimeout(postExitTimer);
|
|
63
|
+
postExitTimer = setTimeout(() => finalize(exitCode), EXIT_STDIO_GRACE_MS);
|
|
64
|
+
};
|
|
65
|
+
const onData = () => {
|
|
66
|
+
// Output is still arriving after exit; defer finalizing so we don't
|
|
67
|
+
// destroy the stream mid-write and truncate the tail.
|
|
68
|
+
if (exited && !settled)
|
|
69
|
+
armIdleTimer();
|
|
70
|
+
};
|
|
55
71
|
const onStdoutEnd = () => {
|
|
56
72
|
stdoutEnded = true;
|
|
57
73
|
maybeFinalizeAfterExit();
|
|
@@ -72,7 +88,7 @@ export function waitForChildProcess(child) {
|
|
|
72
88
|
exitCode = code;
|
|
73
89
|
maybeFinalizeAfterExit();
|
|
74
90
|
if (!settled) {
|
|
75
|
-
|
|
91
|
+
armIdleTimer();
|
|
76
92
|
}
|
|
77
93
|
};
|
|
78
94
|
const onClose = (code) => {
|
|
@@ -80,6 +96,8 @@ export function waitForChildProcess(child) {
|
|
|
80
96
|
};
|
|
81
97
|
child.stdout?.once("end", onStdoutEnd);
|
|
82
98
|
child.stderr?.once("end", onStderrEnd);
|
|
99
|
+
child.stdout?.on("data", onData);
|
|
100
|
+
child.stderr?.on("data", onData);
|
|
83
101
|
child.once("error", onError);
|
|
84
102
|
child.once("exit", onExit);
|
|
85
103
|
child.once("close", onClose);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-coding-agent",
|
|
3
|
-
"version": "0.79.
|
|
3
|
+
"version": "0.79.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@earendil-works/pi-coding-agent",
|
|
9
|
-
"version": "0.79.
|
|
9
|
+
"version": "0.79.6",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@earendil-works/pi-agent-core": "^0.79.
|
|
13
|
-
"@earendil-works/pi-ai": "^0.79.
|
|
14
|
-
"@earendil-works/pi-tui": "^0.79.
|
|
12
|
+
"@earendil-works/pi-agent-core": "^0.79.6",
|
|
13
|
+
"@earendil-works/pi-ai": "^0.79.6",
|
|
14
|
+
"@earendil-works/pi-tui": "^0.79.6",
|
|
15
15
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
16
16
|
"chalk": "5.6.2",
|
|
17
17
|
"cross-spawn": "7.0.6",
|
|
@@ -474,11 +474,11 @@
|
|
|
474
474
|
}
|
|
475
475
|
},
|
|
476
476
|
"node_modules/@earendil-works/pi-agent-core": {
|
|
477
|
-
"version": "0.79.
|
|
478
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.79.
|
|
477
|
+
"version": "0.79.6",
|
|
478
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.79.6.tgz",
|
|
479
479
|
"license": "MIT",
|
|
480
480
|
"dependencies": {
|
|
481
|
-
"@earendil-works/pi-ai": "^0.79.
|
|
481
|
+
"@earendil-works/pi-ai": "^0.79.6",
|
|
482
482
|
"ignore": "7.0.5",
|
|
483
483
|
"typebox": "1.1.38",
|
|
484
484
|
"yaml": "2.9.0"
|
|
@@ -488,8 +488,8 @@
|
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
490
|
"node_modules/@earendil-works/pi-ai": {
|
|
491
|
-
"version": "0.79.
|
|
492
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.79.
|
|
491
|
+
"version": "0.79.6",
|
|
492
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.79.6.tgz",
|
|
493
493
|
"license": "MIT",
|
|
494
494
|
"dependencies": {
|
|
495
495
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -511,12 +511,12 @@
|
|
|
511
511
|
}
|
|
512
512
|
},
|
|
513
513
|
"node_modules/@earendil-works/pi-tui": {
|
|
514
|
-
"version": "0.79.
|
|
515
|
-
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.79.
|
|
514
|
+
"version": "0.79.6",
|
|
515
|
+
"resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.79.6.tgz",
|
|
516
516
|
"license": "MIT",
|
|
517
517
|
"dependencies": {
|
|
518
518
|
"get-east-asian-width": "1.6.0",
|
|
519
|
-
"marked": "
|
|
519
|
+
"marked": "18.0.5"
|
|
520
520
|
},
|
|
521
521
|
"engines": {
|
|
522
522
|
"node": ">=22.19.0"
|
|
@@ -1399,15 +1399,15 @@
|
|
|
1399
1399
|
}
|
|
1400
1400
|
},
|
|
1401
1401
|
"node_modules/marked": {
|
|
1402
|
-
"version": "
|
|
1403
|
-
"resolved": "https://registry.npmjs.org/marked/-/marked-
|
|
1404
|
-
"integrity": "sha512-
|
|
1402
|
+
"version": "18.0.5",
|
|
1403
|
+
"resolved": "https://registry.npmjs.org/marked/-/marked-18.0.5.tgz",
|
|
1404
|
+
"integrity": "sha512-S6GcvALHg6K4ohtu4E7x0a1AqhAjp6cV8KhLSyN9qVapnzJkusVBxZRcIU9AeYsbe6P1hKDusSbEOzGyyuce6w==",
|
|
1405
1405
|
"license": "MIT",
|
|
1406
1406
|
"bin": {
|
|
1407
1407
|
"marked": "bin/marked.js"
|
|
1408
1408
|
},
|
|
1409
1409
|
"engines": {
|
|
1410
|
-
"node": ">=
|
|
1410
|
+
"node": ">= 20"
|
|
1411
1411
|
}
|
|
1412
1412
|
},
|
|
1413
1413
|
"node_modules/minimatch": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-coding-agent",
|
|
3
|
-
"version": "0.79.
|
|
3
|
+
"version": "0.79.6",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@earendil-works/pi-agent-core": "^0.79.
|
|
41
|
-
"@earendil-works/pi-ai": "^0.79.
|
|
42
|
-
"@earendil-works/pi-tui": "^0.79.
|
|
40
|
+
"@earendil-works/pi-agent-core": "^0.79.6",
|
|
41
|
+
"@earendil-works/pi-ai": "^0.79.6",
|
|
42
|
+
"@earendil-works/pi-tui": "^0.79.6",
|
|
43
43
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
44
44
|
"chalk": "5.6.2",
|
|
45
45
|
"cross-spawn": "7.0.6",
|
|
@@ -296,6 +296,9 @@ export class Editor {
|
|
|
296
296
|
this.history.pop();
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
+
isEditorEmpty() {
|
|
300
|
+
return this.state.lines.length === 1 && this.state.lines[0] === "";
|
|
301
|
+
}
|
|
299
302
|
isOnFirstVisualLine() {
|
|
300
303
|
const visualLines = this.buildVisualLineMap(this.lastWidth);
|
|
301
304
|
const currentVisualLine = this.findCurrentVisualLine(visualLines);
|
|
@@ -656,7 +659,8 @@ export class Editor {
|
|
|
656
659
|
}
|
|
657
660
|
// Arrow key navigation (with history support)
|
|
658
661
|
if (kb.matches(data, "tui.editor.cursorUp")) {
|
|
659
|
-
if (this.isOnFirstVisualLine() &&
|
|
662
|
+
if (this.isOnFirstVisualLine() &&
|
|
663
|
+
(this.isEditorEmpty() || this.historyIndex > -1 || this.state.cursorCol === 0)) {
|
|
660
664
|
this.navigateHistory(-1);
|
|
661
665
|
}
|
|
662
666
|
else if (this.isOnFirstVisualLine()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-tui",
|
|
3
|
-
"version": "0.79.
|
|
3
|
+
"version": "0.79.6",
|
|
4
4
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"types": "./dist/index.d.ts",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"get-east-asian-width": "1.6.0",
|
|
41
|
-
"marked": "
|
|
41
|
+
"marked": "18.0.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@xterm/headless": "5.5.0",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const { getSmithyContext } = require("@smithy/core/transport");
|
|
2
|
+
exports.getSmithyContext = getSmithyContext;
|
|
3
|
+
const { HttpRequest } = require("@smithy/core/protocols");
|
|
4
|
+
const { requestBuilder } = require("@smithy/core/protocols");
|
|
5
|
+
exports.requestBuilder = requestBuilder;
|
|
6
|
+
const { HttpApiKeyAuthLocation } = require("@smithy/types");
|
|
7
7
|
|
|
8
8
|
const resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => {
|
|
9
9
|
if (!authSchemePreference || authSchemePreference.length === 0) {
|
|
@@ -38,7 +38,7 @@ const httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async
|
|
|
38
38
|
const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
|
|
39
39
|
const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
|
|
40
40
|
const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
|
|
41
|
-
const smithyContext =
|
|
41
|
+
const smithyContext = getSmithyContext(context);
|
|
42
42
|
const failureReasons = [];
|
|
43
43
|
for (const option of resolvedOptions) {
|
|
44
44
|
const scheme = authSchemes.get(option.schemeId);
|
|
@@ -106,10 +106,10 @@ const defaultErrorHandler = (signingProperties) => (error) => {
|
|
|
106
106
|
};
|
|
107
107
|
const defaultSuccessHandler = (httpResponse, signingProperties) => { };
|
|
108
108
|
const httpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
109
|
-
if (!
|
|
109
|
+
if (!HttpRequest.isInstance(args.request)) {
|
|
110
110
|
return next(args);
|
|
111
111
|
}
|
|
112
|
-
const smithyContext =
|
|
112
|
+
const smithyContext = getSmithyContext(context);
|
|
113
113
|
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
114
114
|
if (!scheme) {
|
|
115
115
|
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
@@ -228,11 +228,11 @@ class HttpApiKeyAuthSigner {
|
|
|
228
228
|
if (!identity.apiKey) {
|
|
229
229
|
throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
|
|
230
230
|
}
|
|
231
|
-
const clonedRequest =
|
|
232
|
-
if (signingProperties.in ===
|
|
231
|
+
const clonedRequest = HttpRequest.clone(httpRequest);
|
|
232
|
+
if (signingProperties.in === HttpApiKeyAuthLocation.QUERY) {
|
|
233
233
|
clonedRequest.query[signingProperties.name] = identity.apiKey;
|
|
234
234
|
}
|
|
235
|
-
else if (signingProperties.in ===
|
|
235
|
+
else if (signingProperties.in === HttpApiKeyAuthLocation.HEADER) {
|
|
236
236
|
clonedRequest.headers[signingProperties.name] = signingProperties.scheme
|
|
237
237
|
? `${signingProperties.scheme} ${identity.apiKey}`
|
|
238
238
|
: identity.apiKey;
|
|
@@ -249,7 +249,7 @@ class HttpApiKeyAuthSigner {
|
|
|
249
249
|
|
|
250
250
|
class HttpBearerAuthSigner {
|
|
251
251
|
async sign(httpRequest, identity, signingProperties) {
|
|
252
|
-
const clonedRequest =
|
|
252
|
+
const clonedRequest = HttpRequest.clone(httpRequest);
|
|
253
253
|
if (!identity.token) {
|
|
254
254
|
throw new Error("request could not be signed with `token` since the `token` is not defined");
|
|
255
255
|
}
|
|
@@ -320,8 +320,6 @@ const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
|
|
|
320
320
|
};
|
|
321
321
|
};
|
|
322
322
|
|
|
323
|
-
exports.getSmithyContext = transport.getSmithyContext;
|
|
324
|
-
exports.requestBuilder = protocols.requestBuilder;
|
|
325
323
|
exports.DefaultIdentityProviderConfig = DefaultIdentityProviderConfig;
|
|
326
324
|
exports.EXPIRATION_MS = EXPIRATION_MS;
|
|
327
325
|
exports.HttpApiKeyAuthSigner = HttpApiKeyAuthSigner;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var client = require('@smithy/core/client');
|
|
6
|
-
var schema = require('@smithy/core/schema');
|
|
1
|
+
const { nv, toUtf8, fromUtf8, NumericValue, calculateBodyLength, _parseEpochTimestamp, fromBase64, generateIdempotencyToken } = require("@smithy/core/serde");
|
|
2
|
+
const { HttpRequest, collectBody, SerdeContext, RpcProtocol } = require("@smithy/core/protocols");
|
|
3
|
+
const { NormalizedSchema, deref, TypeRegistry } = require("@smithy/core/schema");
|
|
4
|
+
const { getSmithyContext } = require("@smithy/core/transport");
|
|
7
5
|
|
|
8
6
|
const majorUint64 = 0;
|
|
9
7
|
const majorNegativeInt64 = 1;
|
|
@@ -133,7 +131,7 @@ function decode(at, to) {
|
|
|
133
131
|
}
|
|
134
132
|
numericString = sign + numericString;
|
|
135
133
|
_offset = offset + _offset;
|
|
136
|
-
return
|
|
134
|
+
return nv(numericString);
|
|
137
135
|
}
|
|
138
136
|
else {
|
|
139
137
|
const value = decode(at + offset, to);
|
|
@@ -181,7 +179,7 @@ function bytesToUtf8(bytes, at, to) {
|
|
|
181
179
|
if (textDecoder) {
|
|
182
180
|
return textDecoder.decode(bytes.subarray(at, to));
|
|
183
181
|
}
|
|
184
|
-
return
|
|
182
|
+
return toUtf8(bytes.subarray(at, to));
|
|
185
183
|
}
|
|
186
184
|
function demote(bigInteger) {
|
|
187
185
|
const num = Number(bigInteger);
|
|
@@ -525,7 +523,7 @@ function encode(_input) {
|
|
|
525
523
|
cursor += data.write(input, cursor);
|
|
526
524
|
}
|
|
527
525
|
else {
|
|
528
|
-
const bytes =
|
|
526
|
+
const bytes = fromUtf8(input);
|
|
529
527
|
encodeHeader(majorUtf8String, bytes.byteLength);
|
|
530
528
|
data.set(bytes, cursor);
|
|
531
529
|
cursor += bytes.byteLength;
|
|
@@ -641,7 +639,7 @@ function encode(_input) {
|
|
|
641
639
|
continue;
|
|
642
640
|
}
|
|
643
641
|
else if (typeof input === "object") {
|
|
644
|
-
if (input instanceof
|
|
642
|
+
if (input instanceof NumericValue) {
|
|
645
643
|
const decimalIndex = input.string.indexOf(".");
|
|
646
644
|
const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1;
|
|
647
645
|
const mantissa = BigInt(input.string.replace(".", ""));
|
|
@@ -695,7 +693,7 @@ const cbor = {
|
|
|
695
693
|
};
|
|
696
694
|
|
|
697
695
|
const parseCborBody = (streamBody, context) => {
|
|
698
|
-
return
|
|
696
|
+
return collectBody(streamBody, context).then(async (bytes) => {
|
|
699
697
|
if (bytes.length) {
|
|
700
698
|
try {
|
|
701
699
|
return cbor.deserialize(bytes);
|
|
@@ -781,14 +779,14 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
|
|
|
781
779
|
if (body !== undefined) {
|
|
782
780
|
contents.body = body;
|
|
783
781
|
try {
|
|
784
|
-
contents.headers["content-length"] = String(
|
|
782
|
+
contents.headers["content-length"] = String(calculateBodyLength(body));
|
|
785
783
|
}
|
|
786
784
|
catch (e) { }
|
|
787
785
|
}
|
|
788
|
-
return new
|
|
786
|
+
return new HttpRequest(contents);
|
|
789
787
|
};
|
|
790
788
|
|
|
791
|
-
class CborCodec extends
|
|
789
|
+
class CborCodec extends SerdeContext {
|
|
792
790
|
createSerializer() {
|
|
793
791
|
const serializer = new CborShapeSerializer();
|
|
794
792
|
serializer.setSerdeContext(this.serdeContext);
|
|
@@ -800,22 +798,22 @@ class CborCodec extends protocols.SerdeContext {
|
|
|
800
798
|
return deserializer;
|
|
801
799
|
}
|
|
802
800
|
}
|
|
803
|
-
class CborShapeSerializer extends
|
|
801
|
+
class CborShapeSerializer extends SerdeContext {
|
|
804
802
|
value;
|
|
805
803
|
write(schema, value) {
|
|
806
804
|
this.value = this.serialize(schema, value);
|
|
807
805
|
}
|
|
808
|
-
serialize(schema
|
|
809
|
-
const ns =
|
|
806
|
+
serialize(schema, source) {
|
|
807
|
+
const ns = NormalizedSchema.of(schema);
|
|
810
808
|
if (source == null) {
|
|
811
809
|
if (ns.isIdempotencyToken()) {
|
|
812
|
-
return
|
|
810
|
+
return generateIdempotencyToken();
|
|
813
811
|
}
|
|
814
812
|
return source;
|
|
815
813
|
}
|
|
816
814
|
if (ns.isBlobSchema()) {
|
|
817
815
|
if (typeof source === "string") {
|
|
818
|
-
return (this.serdeContext?.base64Decoder ??
|
|
816
|
+
return (this.serdeContext?.base64Decoder ?? fromBase64)(source);
|
|
819
817
|
}
|
|
820
818
|
return source;
|
|
821
819
|
}
|
|
@@ -890,26 +888,26 @@ class CborShapeSerializer extends protocols.SerdeContext {
|
|
|
890
888
|
return buffer;
|
|
891
889
|
}
|
|
892
890
|
}
|
|
893
|
-
class CborShapeDeserializer extends
|
|
891
|
+
class CborShapeDeserializer extends SerdeContext {
|
|
894
892
|
read(schema, bytes) {
|
|
895
893
|
const data = cbor.deserialize(bytes);
|
|
896
894
|
return this.readValue(schema, data);
|
|
897
895
|
}
|
|
898
896
|
readValue(_schema, value) {
|
|
899
|
-
const ns =
|
|
897
|
+
const ns = NormalizedSchema.of(_schema);
|
|
900
898
|
if (ns.isTimestampSchema()) {
|
|
901
899
|
if (typeof value === "number") {
|
|
902
|
-
return
|
|
900
|
+
return _parseEpochTimestamp(value);
|
|
903
901
|
}
|
|
904
902
|
if (typeof value === "object") {
|
|
905
903
|
if (value.tag === 1 && "value" in value) {
|
|
906
|
-
return
|
|
904
|
+
return _parseEpochTimestamp(value.value);
|
|
907
905
|
}
|
|
908
906
|
}
|
|
909
907
|
}
|
|
910
908
|
if (ns.isBlobSchema()) {
|
|
911
909
|
if (typeof value === "string") {
|
|
912
|
-
return (this.serdeContext?.base64Decoder ??
|
|
910
|
+
return (this.serdeContext?.base64Decoder ?? fromBase64)(value);
|
|
913
911
|
}
|
|
914
912
|
return value;
|
|
915
913
|
}
|
|
@@ -989,7 +987,7 @@ class CborShapeDeserializer extends protocols.SerdeContext {
|
|
|
989
987
|
}
|
|
990
988
|
}
|
|
991
989
|
}
|
|
992
|
-
else if (value instanceof
|
|
990
|
+
else if (value instanceof NumericValue) {
|
|
993
991
|
return value;
|
|
994
992
|
}
|
|
995
993
|
return newObject;
|
|
@@ -1000,7 +998,7 @@ class CborShapeDeserializer extends protocols.SerdeContext {
|
|
|
1000
998
|
}
|
|
1001
999
|
}
|
|
1002
1000
|
|
|
1003
|
-
class SmithyRpcV2CborProtocol extends
|
|
1001
|
+
class SmithyRpcV2CborProtocol extends RpcProtocol {
|
|
1004
1002
|
codec = new CborCodec();
|
|
1005
1003
|
serializer = this.codec.createSerializer();
|
|
1006
1004
|
deserializer = this.codec.createDeserializer();
|
|
@@ -1020,7 +1018,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1020
1018
|
"smithy-protocol": "rpc-v2-cbor",
|
|
1021
1019
|
accept: this.getDefaultContentType(),
|
|
1022
1020
|
});
|
|
1023
|
-
if (
|
|
1021
|
+
if (deref(operationSchema.input) === "unit") {
|
|
1024
1022
|
delete request.body;
|
|
1025
1023
|
delete request.headers["content-type"];
|
|
1026
1024
|
}
|
|
@@ -1034,7 +1032,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1034
1032
|
}
|
|
1035
1033
|
catch (e) { }
|
|
1036
1034
|
}
|
|
1037
|
-
const { service, operation } =
|
|
1035
|
+
const { service, operation } = getSmithyContext(context);
|
|
1038
1036
|
const path = `/service/${service}/operation/${operation}`;
|
|
1039
1037
|
if (request.path.endsWith("/")) {
|
|
1040
1038
|
request.path += path.slice(1);
|
|
@@ -1058,7 +1056,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1058
1056
|
[namespace] = errorName.split("#");
|
|
1059
1057
|
}
|
|
1060
1058
|
const registry = this.compositeErrorRegistry;
|
|
1061
|
-
const nsRegistry =
|
|
1059
|
+
const nsRegistry = TypeRegistry.for(namespace);
|
|
1062
1060
|
registry.copyFrom(nsRegistry);
|
|
1063
1061
|
let errorSchema;
|
|
1064
1062
|
try {
|
|
@@ -1068,7 +1066,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1068
1066
|
if (dataObject.Message) {
|
|
1069
1067
|
dataObject.message = dataObject.Message;
|
|
1070
1068
|
}
|
|
1071
|
-
const syntheticRegistry =
|
|
1069
|
+
const syntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
|
|
1072
1070
|
registry.copyFrom(syntheticRegistry);
|
|
1073
1071
|
const baseExceptionSchema = registry.getBaseException();
|
|
1074
1072
|
if (baseExceptionSchema) {
|
|
@@ -1077,7 +1075,7 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
|
|
|
1077
1075
|
}
|
|
1078
1076
|
throw Object.assign(new Error(errorName), errorMetadata, dataObject);
|
|
1079
1077
|
}
|
|
1080
|
-
const ns =
|
|
1078
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
1081
1079
|
const ErrorCtor = registry.getErrorCtor(errorSchema);
|
|
1082
1080
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
1083
1081
|
const exception = new ErrorCtor({});
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var serde = require('@smithy/core/serde');
|
|
1
|
+
const { fromUtf8 } = require("@smithy/core/serde");
|
|
4
2
|
|
|
5
3
|
async function blobReader(blob, onChunk, chunkSize = 1024 * 1024) {
|
|
6
4
|
const size = blob.size;
|
|
@@ -183,7 +181,7 @@ function isEmptyData(data) {
|
|
|
183
181
|
}
|
|
184
182
|
function convertToBuffer(data) {
|
|
185
183
|
if (typeof data === "string") {
|
|
186
|
-
return
|
|
184
|
+
return fromUtf8(data);
|
|
187
185
|
}
|
|
188
186
|
if (ArrayBuffer.isView(data)) {
|
|
189
187
|
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|