@llblab/pi-kit 0.8.0 → 0.8.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to `@llblab/pi-kit` are documented here.
4
4
 
5
+ ## 0.8.1 - 2026-09-11
6
+
7
+ - `Telegram Schema Hotfix`: Advances the exact Telegram pin to `0.45.2`, whose bounded-depth `telegram_bind` argument schema is accepted by OpenAI and Gemini tool APIs again, restoring working agent requests while the bridge is connected. The package set, resource inventory, and explicit load order remain unchanged.
8
+
5
9
  ## 0.8.0 - 2026-09-11
6
10
 
7
11
  - `State Flow Resolution`: Advances the exact State Flow pin to `0.7.0`, bringing explicit PATCH/UNCHANGED resolution, bounded passive-stop continuation, runtime-owned artifact provenance, fixed hot history, local-first activation, asynchronous publication, and opt-in diagnostics while preserving the package set and resource order.
package/README.md CHANGED
@@ -15,7 +15,7 @@ Package links lead to the owning repositories for usage, documentation, issues,
15
15
  | [`@llblab/pi-codex-usage`](https://github.com/llblab/pi-codex-usage) | `0.9.4` | Compact Codex/Spark subscription-limit status |
16
16
  | [`@llblab/pi-grow-loop`](https://github.com/llblab/pi-grow-loop) | `0.7.5` | Visible continuation scheduling and bounded worker Skills |
17
17
  | [`@llblab/pi-state-flow`](https://github.com/llblab/pi-state-flow) | `0.7.0` | Explicit scoped state resolution and bounded session continuation |
18
- | [`@llblab/pi-telegram`](https://github.com/llblab/pi-telegram) | `0.45.1` | Telegram companion, queues, files, voice, controls, and Generative Apps guidance |
18
+ | [`@llblab/pi-telegram`](https://github.com/llblab/pi-telegram) | `0.45.2` | Telegram companion, queues, files, voice, controls, and Generative Apps guidance |
19
19
  | [`@llblab/skills`](https://github.com/llblab/skills) | `1.15.0` | Portable workflows for engineering, review, design, context maintenance, and other focused tasks |
20
20
 
21
21
  Versions are exact by design. An upstream release does not change an installed kit until this repository explicitly advances the dependency and publishes a new kit version. Runtime defects and package-specific feature requests belong in the linked repository; package selection and kit installation issues belong here.
@@ -4,6 +4,10 @@
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.45.2: Provider-Compatible Bind Schema Hotfix
8
+
9
+ - `Provider-Compatible Bind Argument`: Serializes the `telegram_bind` `argument` schema as an inline builder-made JSON-value union bounded to four container levels, with no `$ref`/`$defs` recursion or raw TypeBox marker leakage; OpenAI no longer rejects every request with "Recursive JSON schemas are not currently supported" (#273) and Gemini no longer rejects the unknown `~optional` field (#269) while the tool is registered.
10
+
7
11
  ## 0.45.1: Guest Mode And Channel Media Hotfixes
8
12
 
9
13
  - `Environment-backed bot tokens`: `telegram.json` profiles may store an exact `$NAME`/`${NAME}` reference instead of a copied token. Resolution happens only at validation/activation boundaries, including pairing identity hashing; setup prefills the first supported alias, validates the resolved value, and persists the alias; literals stay compatible; unresolved references fail closed with a redacted named-variable diagnostic in setup, connect, and status.
@@ -98,7 +98,7 @@ An absent, stale, or invalid bound app fails closed and never degrades into an a
98
98
 
99
99
  ## `telegram_bind` Tool
100
100
 
101
- One agent Tool owns installation and deliberate invocation through two mutually exclusive shapes. Its optional `argument` schema explicitly describes recursive JSON values (`null`, boolean, number, string, array, or object) rather than using an unconstrained subschema. Pi keeps the same JSON semantics, while schema aggregators cannot lower this field to a bare `true` schema that some llama-server grammars reject. The recursive definition lives in the tool root `$defs` and uses only local `#/$defs/TelegramBindJsonValue` references; it does not rely on named/remote reference resolution or newer TypeBox runtime helpers.
101
+ One agent Tool owns installation and deliberate invocation through two mutually exclusive shapes. Its optional `argument` schema explicitly describes JSON values (`null`, boolean, number, string, array, or object) as a bounded union nested four container levels deep rather than using an unconstrained subschema. Pi keeps the same JSON semantics, while schema aggregators cannot lower this field to a bare `true` schema that some llama-server grammars reject. The union is built through standard schema builders and serialized inline with no `$ref`/`$defs` recursion, so provider tool APIs that reject recursive or reference-resolved schemas (OpenAI) accept it alongside providers strict about unknown schema fields (Gemini).
102
102
 
103
103
  Install an external self-contained module and initialize it:
104
104
 
@@ -862,21 +862,23 @@ export function formatGenerativeAppToolError(error: unknown): Error {
862
862
  return new Error(`\n${message.replace(/^\n+/u, "") || "Generative App operation failed."}`);
863
863
  }
864
864
 
865
- const TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE = "#/$defs/TelegramBindJsonValue";
866
- const TELEGRAM_BIND_JSON_ARGUMENT_SCHEMA = {
867
- $ref: TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE,
868
- } as unknown as ReturnType<typeof Type.Unknown>;
869
- const TELEGRAM_BIND_JSON_ARGUMENT_DEFINITION = {
870
- anyOf: [
871
- { type: "null" },
872
- { type: "boolean" },
873
- { type: "number" },
874
- { type: "string" },
875
- { type: "array", items: { $ref: TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE } },
876
- { type: "object", properties: {},
877
- additionalProperties: { $ref: TELEGRAM_BIND_JSON_ARGUMENT_REFERENCE } },
878
- ],
879
- };
865
+ // Provider tool APIs reject recursive $ref schemas (OpenAI) and raw TypeBox
866
+ // optional markers on non-builder objects (Gemini), while llama-server rejects
867
+ // unconstrained subschemas; one bounded builder-made JSON-value union satisfies all.
868
+ const TELEGRAM_BIND_JSON_ARGUMENT_MAX_DEPTH = 4;
869
+
870
+ function createTelegramBindJsonArgumentSchema(
871
+ depth: number,
872
+ ): ReturnType<typeof Type.Union> {
873
+ const scalars = [Type.Null(), Type.Boolean(), Type.Number(), Type.String()];
874
+ if (depth <= 0) return Type.Union(scalars);
875
+ const nested = createTelegramBindJsonArgumentSchema(depth - 1);
876
+ return Type.Union([
877
+ ...scalars,
878
+ Type.Array(nested),
879
+ Type.Object({}, { additionalProperties: nested }),
880
+ ]);
881
+ }
880
882
 
881
883
  export function registerTelegramBindTool(
882
884
  pi: ExtensionAPI,
@@ -893,10 +895,10 @@ export function registerTelegramBindTool(
893
895
  method: Type.Optional(Type.String()),
894
896
  replace: Type.Optional(Type.Boolean()),
895
897
  display: Type.Optional(Type.Boolean()),
896
- argument: Type.Optional(TELEGRAM_BIND_JSON_ARGUMENT_SCHEMA),
897
- }, { additionalProperties: false,
898
- $defs: { TelegramBindJsonValue: TELEGRAM_BIND_JSON_ARGUMENT_DEFINITION },
899
- }),
898
+ argument: Type.Optional(
899
+ createTelegramBindJsonArgumentSchema(TELEGRAM_BIND_JSON_ARGUMENT_MAX_DEPTH),
900
+ ),
901
+ }, { additionalProperties: false }),
900
902
  async execute(_toolCallId, params) {
901
903
  try {
902
904
  const result = await bindGenerativeApp({
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-telegram",
3
- "version": "0.45.1",
3
+ "version": "0.45.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-kit",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -45,7 +45,7 @@
45
45
  "@llblab/pi-codex-usage": "0.9.4",
46
46
  "@llblab/pi-grow-loop": "0.7.5",
47
47
  "@llblab/pi-state-flow": "0.7.0",
48
- "@llblab/pi-telegram": "0.45.1",
48
+ "@llblab/pi-telegram": "0.45.2",
49
49
  "@llblab/skills": "1.15.0"
50
50
  },
51
51
  "bundledDependencies": [