@f5-sales-demo/pi-ai 19.51.2 → 19.51.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/pi-ai",
4
- "version": "19.51.2",
4
+ "version": "19.51.4",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -45,7 +45,7 @@
45
45
  "@aws-sdk/client-bedrock-runtime": "^3",
46
46
  "@bufbuild/protobuf": "^2.11",
47
47
  "@google/genai": "^1.43",
48
- "@f5-sales-demo/pi-utils": "workspace:*",
48
+ "@f5-sales-demo/pi-utils": "19.51.4",
49
49
  "@sinclair/typebox": "^0.34",
50
50
  "@smithy/node-http-handler": "^4.4",
51
51
  "ajv": "^8.20",
@@ -10,7 +10,7 @@
10
10
  import { Database, type Statement } from "bun:sqlite";
11
11
  import * as fs from "node:fs/promises";
12
12
  import * as path from "node:path";
13
- import { getAgentDbPath, logger } from "@f5xc-salesdemos/pi-utils";
13
+ import { getAgentDbPath, logger } from "@f5-sales-demo/pi-utils";
14
14
  import { getEnvApiKey } from "./stream";
15
15
  import type { Provider } from "./types";
16
16
  import type {
package/src/cli.ts CHANGED
@@ -323,7 +323,7 @@ async function main(): Promise<void> {
323
323
  const command = args[0];
324
324
 
325
325
  if (!command || command === "help" || command === "--help" || command === "-h") {
326
- console.log(`Usage: bunx @f5xc-salesdemos/pi-ai <command> [provider]
326
+ console.log(`Usage: bunx @f5-sales-demo/pi-ai <command> [provider]
327
327
 
328
328
  Commands:
329
329
  login [provider] Login to a provider
@@ -349,11 +349,11 @@ Providers:
349
349
  zenmux ZenMux
350
350
 
351
351
  Examples:
352
- bunx @f5xc-salesdemos/pi-ai login # interactive provider selection
353
- bunx @f5xc-salesdemos/pi-ai login anthropic # login to specific provider
354
- bunx @f5xc-salesdemos/pi-ai logout anthropic # logout from specific provider
355
- bunx @f5xc-salesdemos/pi-ai status # show logged-in providers
356
- bunx @f5xc-salesdemos/pi-ai list # list providers
352
+ bunx @f5-sales-demo/pi-ai login # interactive provider selection
353
+ bunx @f5-sales-demo/pi-ai login anthropic # login to specific provider
354
+ bunx @f5-sales-demo/pi-ai logout anthropic # logout from specific provider
355
+ bunx @f5-sales-demo/pi-ai status # show logged-in providers
356
+ bunx @f5-sales-demo/pi-ai list # list providers
357
357
  `);
358
358
  return;
359
359
  }
@@ -364,7 +364,7 @@ Examples:
364
364
  const providers = storage.listProviders();
365
365
  if (providers.length === 0) {
366
366
  console.log("No credentials stored.");
367
- console.log(`Use 'bunx @f5xc-salesdemos/pi-ai login' to authenticate.`);
367
+ console.log(`Use 'bunx @f5-sales-demo/pi-ai login' to authenticate.`);
368
368
  } else {
369
369
  console.log("Logged-in providers:\n");
370
370
  for (const provider of providers) {
@@ -473,7 +473,7 @@ Examples:
473
473
 
474
474
  if (!PROVIDERS.some(p => p.id === provider)) {
475
475
  console.error(`Unknown provider: ${provider}`);
476
- console.error(`Use 'bunx @f5xc-salesdemos/pi-ai list' to see available providers`);
476
+ console.error(`Use 'bunx @f5-sales-demo/pi-ai list' to see available providers`);
477
477
  process.exit(1);
478
478
  }
479
479
 
@@ -483,7 +483,7 @@ Examples:
483
483
  }
484
484
 
485
485
  console.error(`Unknown command: ${command}`);
486
- console.error(`Use 'bunx @f5xc-salesdemos/pi-ai --help' for usage`);
486
+ console.error(`Use 'bunx @f5-sales-demo/pi-ai --help' for usage`);
487
487
  process.exit(1);
488
488
  }
489
489
 
@@ -3,7 +3,7 @@
3
3
  * Replaces per-provider JSON files with a single cache.db.
4
4
  */
5
5
  import { Database } from "bun:sqlite";
6
- import { getModelDbPath } from "@f5xc-salesdemos/pi-utils";
6
+ import { getModelDbPath } from "@f5-sales-demo/pi-utils";
7
7
  import type { Api, Model } from "./types";
8
8
 
9
9
  const CACHE_SCHEMA_VERSION = 2;
@@ -19,7 +19,7 @@ import {
19
19
  type ToolConfiguration,
20
20
  ToolResultStatus,
21
21
  } from "@aws-sdk/client-bedrock-runtime";
22
- import { $env, $flag } from "@f5xc-salesdemos/pi-utils";
22
+ import { $env, $flag } from "@f5-sales-demo/pi-utils";
23
23
  import { NodeHttpHandler } from "@smithy/node-http-handler";
24
24
  import type { Effort } from "../model-thinking";
25
25
  import { mapEffortToAnthropicAdaptiveEffort, requireSupportedEffort } from "../model-thinking";
@@ -7,7 +7,7 @@ import type {
7
7
  MessageCreateParamsStreaming,
8
8
  MessageParam,
9
9
  } from "@anthropic-ai/sdk/resources/messages";
10
- import { $env, abortableSleep, isEnoent } from "@f5xc-salesdemos/pi-utils";
10
+ import { $env, abortableSleep, isEnoent } from "@f5-sales-demo/pi-utils";
11
11
  import { mapEffortToAnthropicAdaptiveEffort } from "../model-thinking";
12
12
  import { calculateCost } from "../models";
13
13
  import { getEnvApiKey, OUTPUT_FALLBACK_BUFFER } from "../stream";
@@ -1,4 +1,4 @@
1
- import { $env } from "@f5xc-salesdemos/pi-utils";
1
+ import { $env } from "@f5-sales-demo/pi-utils";
2
2
  import { AzureOpenAI } from "openai";
3
3
  import type {
4
4
  Tool as OpenAITool,
@@ -313,7 +313,7 @@ function buildParams(
313
313
  // Always request encrypted reasoning content so reasoning items can be
314
314
  // replayed in multi-turn conversations when store is false (items aren't
315
315
  // persisted server-side, so we must include the full content).
316
- // See: https://github.com/f5xc-salesdemos/xcsh/issues/41
316
+ // See: https://github.com/f5-sales-demo/xcsh/issues/41
317
317
  params.include = ["reasoning.encrypted_content"];
318
318
 
319
319
  if (options?.reasoning || options?.reasoningSummary) {
@@ -3,7 +3,7 @@ import * as fs from "node:fs/promises";
3
3
  import http2 from "node:http2";
4
4
  import { create, fromBinary, fromJson, type JsonValue, toBinary, toJson } from "@bufbuild/protobuf";
5
5
  import { ValueSchema } from "@bufbuild/protobuf/wkt";
6
- import { $env } from "@f5xc-salesdemos/pi-utils";
6
+ import { $env } from "@f5-sales-demo/pi-utils";
7
7
  import { calculateCost } from "../models";
8
8
  import type {
9
9
  Api,
@@ -4,7 +4,7 @@
4
4
  * Uses the Cloud Code Assist API endpoint to access Gemini and Claude models.
5
5
  */
6
6
  import { createHash, randomBytes, randomUUID } from "node:crypto";
7
- import { abortableSleep, readSseJson } from "@f5xc-salesdemos/pi-utils";
7
+ import { abortableSleep, readSseJson } from "@f5-sales-demo/pi-utils";
8
8
  import type { Content, FunctionCallingConfigMode, ThinkingConfig } from "@google/genai";
9
9
  import { calculateCost } from "../models";
10
10
  import type {
@@ -1,4 +1,4 @@
1
- import { $env } from "@f5xc-salesdemos/pi-utils";
1
+ import { $env } from "@f5-sales-demo/pi-utils";
2
2
  import {
3
3
  type GenerateContentConfig,
4
4
  type GenerateContentParameters,
@@ -7,7 +7,7 @@ import {
7
7
  logger,
8
8
  readSseJson,
9
9
  structuredCloneJSON,
10
- } from "@f5xc-salesdemos/pi-utils";
10
+ } from "@f5-sales-demo/pi-utils";
11
11
  import type OpenAI from "openai";
12
12
  import type {
13
13
  ResponseFunctionToolCall,
@@ -1,4 +1,4 @@
1
- import { $env } from "@f5xc-salesdemos/pi-utils";
1
+ import { $env } from "@f5-sales-demo/pi-utils";
2
2
  import OpenAI from "openai";
3
3
  import type {
4
4
  ChatCompletionAssistantMessageParam,
@@ -1,4 +1,4 @@
1
- import { structuredCloneJSON } from "@f5xc-salesdemos/pi-utils";
1
+ import { structuredCloneJSON } from "@f5-sales-demo/pi-utils";
2
2
  import type OpenAI from "openai";
3
3
  import type {
4
4
  ResponseFunctionToolCall,
@@ -1,4 +1,4 @@
1
- import { $env, structuredCloneJSON } from "@f5xc-salesdemos/pi-utils";
1
+ import { $env, structuredCloneJSON } from "@f5-sales-demo/pi-utils";
2
2
  import OpenAI from "openai";
3
3
  import type {
4
4
  Tool as OpenAITool,
@@ -381,7 +381,7 @@ function buildParams(
381
381
  // Always request encrypted reasoning content so reasoning items can be
382
382
  // replayed in multi-turn conversations when store is false (items aren't
383
383
  // persisted server-side, so we must include the full content).
384
- // See: https://github.com/f5xc-salesdemos/xcsh/issues/41
384
+ // See: https://github.com/f5-sales-demo/xcsh/issues/41
385
385
  params.include = ["reasoning.encrypted_content"];
386
386
 
387
387
  if (options?.reasoning || options?.reasoningSummary) {
package/src/stream.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as os from "node:os";
3
3
  import * as path from "node:path";
4
- import { $env, $pickenv } from "@f5xc-salesdemos/pi-utils";
4
+ import { $env, $pickenv } from "@f5-sales-demo/pi-utils";
5
5
  import { getCustomApi } from "./api-registry";
6
6
  import type { Effort } from "./model-thinking";
7
7
  import {
package/src/usage/kimi.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $env } from "@f5xc-salesdemos/pi-utils";
1
+ import { $env } from "@f5-sales-demo/pi-utils";
2
2
  import type {
3
3
  UsageAmount,
4
4
  UsageFetchContext,
@@ -10,7 +10,7 @@
10
10
  * 6. Anthropic provider credentials from models.yml
11
11
  * 7. LiteLLM passthrough (LITELLM_BASE_URL / LITELLM_API_KEY)
12
12
  */
13
- import { $env, getAgentDbPath, readProviderFromModelsYml } from "@f5xc-salesdemos/pi-utils";
13
+ import { $env, getAgentDbPath, readProviderFromModelsYml } from "@f5-sales-demo/pi-utils";
14
14
  import { type AuthCredential, AuthCredentialStore } from "../auth-storage";
15
15
  import {
16
16
  buildAnthropicHeaders as buildProviderAnthropicHeaders,
@@ -1,4 +1,4 @@
1
- import { UNK_CONTEXT_WINDOW, UNK_MAX_TOKENS } from "@f5xc-salesdemos/pi-ai";
1
+ import { UNK_CONTEXT_WINDOW, UNK_MAX_TOKENS } from "@f5-sales-demo/pi-ai";
2
2
  import { z } from "zod";
3
3
  import { getBundledModels } from "../../models";
4
4
  import type { Model } from "../../types";
@@ -1,4 +1,4 @@
1
- import { UNK_CONTEXT_WINDOW, UNK_MAX_TOKENS } from "@f5xc-salesdemos/pi-ai";
1
+ import { UNK_CONTEXT_WINDOW, UNK_MAX_TOKENS } from "@f5-sales-demo/pi-ai";
2
2
  import { z } from "zod";
3
3
  import type { Api, Model, Provider } from "../../types";
4
4
 
@@ -1,5 +1,5 @@
1
1
  import * as path from "node:path";
2
- import { getLogsDir } from "@f5xc-salesdemos/pi-utils";
2
+ import { getLogsDir } from "@f5-sales-demo/pi-utils";
3
3
  import { extractHttpStatusFromError } from "./retry.js";
4
4
  import { formatErrorMessageWithRetryAfter } from "./retry-after.js";
5
5
 
@@ -1,4 +1,4 @@
1
- import { $env } from "@f5xc-salesdemos/pi-utils";
1
+ import { $env } from "@f5-sales-demo/pi-utils";
2
2
 
3
3
  const DEFAULT_OPENAI_STREAM_IDLE_TIMEOUT_MS = 120_000;
4
4
  const DEFAULT_STREAM_FIRST_EVENT_TIMEOUT_MS = 60_000;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * GitHub Copilot OAuth flow (opencode OAuth app)
3
3
  */
4
- import { abortableSleep } from "@f5xc-salesdemos/pi-utils";
4
+ import { abortableSleep } from "@f5-sales-demo/pi-utils";
5
5
  import { getBundledModels } from "../../models";
6
6
  import type { OAuthCredentials } from "./types";
7
7
 
@@ -3,7 +3,7 @@
3
3
  * Standard Gemini models only (gemini-2.0-flash, gemini-2.5-*)
4
4
  */
5
5
 
6
- import { $env } from "@f5xc-salesdemos/pi-utils";
6
+ import { $env } from "@f5-sales-demo/pi-utils";
7
7
  import { getGeminiCliHeaders } from "../../providers/google-gemini-cli";
8
8
  import { OAuthCallbackFlow } from "./callback-server";
9
9
  import type { OAuthController, OAuthCredentials } from "./types";
@@ -6,7 +6,7 @@ import * as crypto from "node:crypto";
6
6
  import * as fs from "node:fs/promises";
7
7
  import * as os from "node:os";
8
8
  import * as path from "node:path";
9
- import { $env, abortableSleep, getAgentDir, isEnoent } from "@f5xc-salesdemos/pi-utils";
9
+ import { $env, abortableSleep, getAgentDir, isEnoent } from "@f5-sales-demo/pi-utils";
10
10
  import packageJson from "../../../package.json" with { type: "json" };
11
11
  import type { OAuthController, OAuthCredentials } from "./types";
12
12
 
@@ -12,7 +12,7 @@
12
12
  * Architecture reverse-engineered from Perplexity macOS app (ai.perplexity.mac).
13
13
  */
14
14
  import * as os from "node:os";
15
- import { $env } from "@f5xc-salesdemos/pi-utils";
15
+ import { $env } from "@f5-sales-demo/pi-utils";
16
16
  import { $ } from "bun";
17
17
  import type { OAuthController, OAuthCredentials } from "./types";
18
18
 
@@ -1,4 +1,4 @@
1
- import { logger } from "@f5xc-salesdemos/pi-utils";
1
+ import { logger } from "@f5-sales-demo/pi-utils";
2
2
  import type { AnySchema } from "ajv";
3
3
  import Ajv2020 from "ajv/dist/2020.js";
4
4
  import { areJsonValuesEqual, mergePropertySchemas } from "./equality";
@@ -1,4 +1,4 @@
1
- import { $flag } from "@f5xc-salesdemos/pi-utils";
1
+ import { $flag } from "@f5-sales-demo/pi-utils";
2
2
  import { type TUnsafe, Type } from "@sinclair/typebox";
3
3
  import { areJsonValuesEqual } from "./equality";
4
4
  import { COMBINATOR_KEYS, NON_STRUCTURAL_SCHEMA_KEYS } from "./fields";
@@ -1,4 +1,4 @@
1
- import { structuredCloneJSON } from "@f5xc-salesdemos/pi-utils";
1
+ import { structuredCloneJSON } from "@f5-sales-demo/pi-utils";
2
2
  import Ajv from "ajv";
3
3
  import addFormats from "ajv-formats";
4
4
  import type { Tool, ToolCall } from "../types";
package/src/utils.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { $env } from "@f5xc-salesdemos/pi-utils";
1
+ import { $env } from "@f5-sales-demo/pi-utils";
2
2
  import type { ResponseInput } from "openai/resources/responses/responses";
3
3
  import type { CacheRetention, OpenAIResponsesHistoryPayload, ProviderPayload } from "./types";
4
4
 
5
5
  type OpenAIResponsesReplayItem = ResponseInput[number];
6
6
 
7
- export { isRecord } from "@f5xc-salesdemos/pi-utils";
7
+ export { isRecord } from "@f5-sales-demo/pi-utils";
8
8
 
9
9
  export function toNumber(value: unknown): number | undefined {
10
10
  if (typeof value === "number" && Number.isFinite(value)) return value;