@kehto/paja 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  startPajaServer,
10
10
  summarizePajaSimulation,
11
11
  waitForTargetUrl
12
- } from "./chunk-EYSQOKVF.js";
12
+ } from "./chunk-M5ZFET3T.js";
13
13
 
14
14
  // src/cli.ts
15
15
  import { spawn } from "child_process";
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { Filter } from 'nostr-tools/filter';
5
5
  import { ResolvedNapplet } from '@kehto/nip/5d';
6
6
  import { ShellCapabilities, NormalizedIntentUri } from '@kehto/shell';
7
7
  export { NappletCspDirective, NappletCspDirectives, NappletCspOptions } from '@kehto/shell';
8
- import { IntentCatalogEntry, IntentTargetController, IntentDispatchParams, IntentTargetAcceptance, LlmProviderProtocol, LlmCredentialHeader, LlmConnectionHost, LlmRequirements, HttpLlmProvider } from '@kehto/services';
8
+ import { IntentCatalogEntry, IntentTargetController, IntentDispatchParams, IntentTargetAcceptance, LlmRequirements, LlmProviderProtocol, LlmCredentialHeader, LlmConnectionHost, HttpLlmProvider } from '@kehto/services';
9
9
  import { NostrEvent as NostrEvent$1 } from '@napplet/core';
10
10
 
11
11
  /**
@@ -591,6 +591,8 @@ type PajaConfirmationRequest = ({
591
591
  readonly description: string;
592
592
  }) & {
593
593
  readonly isCurrent?: () => boolean;
594
+ /** Withdraws the request: a queued prompt is dropped and an open dialog closes as denied. */
595
+ readonly signal?: AbortSignal;
594
596
  };
595
597
 
596
598
  /** Async-capable host policy callback for user-visible Paja operations. */
@@ -737,21 +739,25 @@ interface PajaLlmHostOptions {
737
739
  vault: PajaLlmVault;
738
740
  /** Host confirmation dialog shared with signer, upload and other operations. */
739
741
  confirm: PajaConfirmationHandler;
740
- /** Show the connection chooser; resolve null when the user declines. */
741
- chooseConnection(candidates: readonly PajaLlmConnectionRecord[], context: {
742
- windowId: string;
743
- napplet: PajaLlmRequestIdentity;
744
- requirements: LlmRequirements;
745
- }): Promise<PajaLlmConnectionRecord | null>;
746
- /** Ask for the vault password; resolve null when the user cancels. */
747
- requestUnlock(): Promise<boolean>;
742
+ /** Show the connection chooser; resolve null when the user declines or `context.signal` aborts. */
743
+ chooseConnection(candidates: readonly PajaLlmConnectionRecord[], context: PajaLlmChooserContext): Promise<PajaLlmConnectionRecord | null>;
744
+ /** Ask for the vault password; resolve false when the user cancels or `signal` aborts. */
745
+ requestUnlock(signal?: AbortSignal): Promise<boolean>;
748
746
  /** Reveal and focus the Language models panel. */
749
747
  openPanel(): void;
750
748
  /** Resolve the napplet identity bound to a runtime window. */
751
749
  getIdentity(windowId: string): PajaLlmRequestIdentity;
752
- /** Provider transport; defaults to the fetch-based provider. */
750
+ /** Provider transport; defaults to the streaming fetch-based provider. */
753
751
  provider?: HttpLlmProvider;
754
752
  }
753
+ /** What the connection chooser shows for one `llm.select`. */
754
+ interface PajaLlmChooserContext {
755
+ readonly windowId: string;
756
+ readonly napplet: PajaLlmRequestIdentity;
757
+ readonly requirements: LlmRequirements;
758
+ /** Aborts when the selection settles without the user's answer; close the chooser. */
759
+ readonly signal?: AbortSignal;
760
+ }
755
761
  /** Paja's NAP-LLM host plus the configuration probe the shell adapter needs. */
756
762
  interface PajaLlmHost extends LlmConnectionHost {
757
763
  /** True when at least one connection exists. */
@@ -842,4 +848,4 @@ type PajaTargetCorsFetch = (input: string, init: {
842
848
  */
843
849
  declare function probeTargetCors(targetUrl: string, fetchImpl?: PajaTargetCorsFetch): Promise<PajaTargetCorsDiagnostic>;
844
850
 
845
- export { BrowserIntentController, type BrowserIntentControllerOptions, type BrowserIntentGeneration, type BrowserIntentTerminalReason, InstalledNappletCatalog, type InstalledNappletCatalogListener, type InstalledNappletRecord, PAJA_ADVERTISED_DOMAINS, PAJA_COMPATIBILITY_ALIASES, PAJA_HANDSHAKE_DOMAINS, PAJA_LLM_CONNECTIONS_STORAGE_KEY, PAJA_LLM_VAULT_MIN_PASSWORD_LENGTH, PAJA_LLM_VAULT_STORAGE_KEY, PAJA_LOCAL_SINGLE_FILE_HINT, PAJA_NAPPLET_MANIFEST_KIND, PAJA_NAPPLET_MANIFEST_KINDS, PAJA_REQUIRED_SERVICES, PAJA_TARGET_CORS_HINT, PAJA_UPSTREAM_WEB_DOMAINS, type PajaConfirmationHandler, type PajaConfirmationRequest, type PajaDecodedPointer, PajaHostConfig, type PajaIntentLauncherMessage, type PajaIntentLinkDescriptor, type PajaLlmConnectionRecord, type PajaLlmConnectionStore, type PajaLlmCredentialStorage, type PajaLlmHost, type PajaLlmHostOptions, type PajaLlmRequestIdentity, type PajaLlmVault, type PajaLlmVaultCrypto, type PajaLlmVaultOptions, type PajaLocalFileInput, type PajaLocalTarget, type PajaPointerRelayPool, PajaRawOptions, type PajaResolvedPointer, type PajaRuntimeTarget, type PajaSignerRequestContext, type PajaSignerSource, type PajaTargetCorsDiagnostic, type PajaTargetCorsFetch, type PajaTargetCorsStatus, type ParsedPajaIntentLink, type ResolvePajaPointerOptions, classifyTargetCors, createPajaIntentLink, createPajaLlmConnectionStore, createPajaLlmHost, createPajaLlmVault, createPajaLocalTarget, decodePajaPointer, describePajaLlmRoute, findRelativeAssetReferences, getMissingAdvertisedDomains, getMissingServices, injectPajaRuntimeCsp, isPajaLocalHtmlFile, isPajaLocalTarget, loadPajaConfigFile, mergePajaRawOptions, normalizePajaLlmBaseUrl, parsePajaIntentLink, postPajaIntentLauncherMessage, probeTargetCors, readNappletIdMeta, renderPajaHtml, resolvePajaIntentLauncher, resolvePajaPointer, resolvePajaRawOptions, validatePajaLlmVaultPassword };
851
+ export { BrowserIntentController, type BrowserIntentControllerOptions, type BrowserIntentGeneration, type BrowserIntentTerminalReason, InstalledNappletCatalog, type InstalledNappletCatalogListener, type InstalledNappletRecord, PAJA_ADVERTISED_DOMAINS, PAJA_COMPATIBILITY_ALIASES, PAJA_HANDSHAKE_DOMAINS, PAJA_LLM_CONNECTIONS_STORAGE_KEY, PAJA_LLM_VAULT_MIN_PASSWORD_LENGTH, PAJA_LLM_VAULT_STORAGE_KEY, PAJA_LOCAL_SINGLE_FILE_HINT, PAJA_NAPPLET_MANIFEST_KIND, PAJA_NAPPLET_MANIFEST_KINDS, PAJA_REQUIRED_SERVICES, PAJA_TARGET_CORS_HINT, PAJA_UPSTREAM_WEB_DOMAINS, type PajaConfirmationHandler, type PajaConfirmationRequest, type PajaDecodedPointer, PajaHostConfig, type PajaIntentLauncherMessage, type PajaIntentLinkDescriptor, type PajaLlmChooserContext, type PajaLlmConnectionRecord, type PajaLlmConnectionStore, type PajaLlmCredentialStorage, type PajaLlmHost, type PajaLlmHostOptions, type PajaLlmRequestIdentity, type PajaLlmVault, type PajaLlmVaultCrypto, type PajaLlmVaultOptions, type PajaLocalFileInput, type PajaLocalTarget, type PajaPointerRelayPool, PajaRawOptions, type PajaResolvedPointer, type PajaRuntimeTarget, type PajaSignerRequestContext, type PajaSignerSource, type PajaTargetCorsDiagnostic, type PajaTargetCorsFetch, type PajaTargetCorsStatus, type ParsedPajaIntentLink, type ResolvePajaPointerOptions, classifyTargetCors, createPajaIntentLink, createPajaLlmConnectionStore, createPajaLlmHost, createPajaLlmVault, createPajaLocalTarget, decodePajaPointer, describePajaLlmRoute, findRelativeAssetReferences, getMissingAdvertisedDomains, getMissingServices, injectPajaRuntimeCsp, isPajaLocalHtmlFile, isPajaLocalTarget, loadPajaConfigFile, mergePajaRawOptions, normalizePajaLlmBaseUrl, parsePajaIntentLink, postPajaIntentLauncherMessage, probeTargetCors, readNappletIdMeta, renderPajaHtml, resolvePajaIntentLauncher, resolvePajaPointer, resolvePajaRawOptions, validatePajaLlmVaultPassword };
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  summarizePajaSimulation,
59
59
  validatePajaLlmVaultPassword,
60
60
  waitForTargetUrl
61
- } from "./chunk-EYSQOKVF.js";
61
+ } from "./chunk-M5ZFET3T.js";
62
62
  export {
63
63
  BrowserIntentController,
64
64
  DEFAULT_PAJA_AGGREGATE_HASH,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kehto/paja",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Paja local authoring workshop for hosting napplets in a real Kehto iframe during development",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,17 +25,17 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "@kehto/acl": "^0.20.0",
29
- "@kehto/firewall": "^0.6.1",
28
+ "@kehto/acl": "^0.20.1",
29
+ "@kehto/firewall": "^0.6.2",
30
30
  "@kehto/nip": "^0.8.0",
31
- "@kehto/runtime": "^0.27.0",
32
- "@kehto/services": "^0.27.0",
33
- "@kehto/shell": "^0.26.0",
31
+ "@kehto/runtime": "^0.27.1",
32
+ "@kehto/services": "^0.28.0",
33
+ "@kehto/shell": "^0.26.1",
34
34
  "@kehto/wm": "^0.0.2"
35
35
  },
36
36
  "peerDependencies": {
37
- "@napplet/core": ">=0.32.0 <0.35.0",
38
- "@napplet/nap": ">=0.32.0 <0.35.0",
37
+ "@napplet/core": ">=0.32.0 <0.37.0",
38
+ "@napplet/nap": ">=0.32.0 <0.36.0",
39
39
  "nostr-tools": ">=2.23.3 <=2.x"
40
40
  },
41
41
  "devDependencies": {