@applica-software-guru/persona-sdk 0.1.111 → 0.1.113

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.
@@ -0,0 +1,26 @@
1
+ name: CI
2
+
3
+ # Validate su PR: lint + test (il test include la build).
4
+ # Il publish avviene solo al push su main (deploy.yml).
5
+ # Il pipeline Bitbucket non aveva validate su PR: aggiunta in migrazione.
6
+
7
+ on:
8
+ pull_request:
9
+ branches: [main]
10
+
11
+ concurrency:
12
+ group: ci-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ validate:
17
+ name: Validate
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 22
24
+ - run: npm ci
25
+ - run: npm run lint
26
+ - run: npm test
@@ -0,0 +1,81 @@
1
+ name: Deploy
2
+
3
+ # Push su main: versione riconciliata su NPM (dist della serie 0.1.x,
4
+ # lo stesso algoritmo della pipeline Bitbucket: patch-max su npm +1)
5
+ # → lint/test (miglioria: il BB non li eseguiva) → build → publish su
6
+ # npm tramite TRUSTED PUBLISHING OIDC (nessun token: GitHub firma ogni
7
+ # publish, configurato su npmjs.com → package → Trusted Publisher)
8
+ # → tag di versione. npm stesso è la guard anti-collisione: rifiuta
9
+ # (403) una versione già pubblicata, il run fallisce senza side-effect.
10
+
11
+ on:
12
+ push:
13
+ branches: [main]
14
+
15
+ concurrency:
16
+ group: npm-publish-persona-sdk-js
17
+ cancel-in-progress: false
18
+
19
+ permissions:
20
+ contents: write # push del tag di versione con GITHUB_TOKEN
21
+ id-token: write # OIDC → npm trusted publishing
22
+
23
+ jobs:
24
+ version:
25
+ name: Calcola versione (riconciliazione su npm, serie 0.1.x)
26
+ runs-on: ubuntu-latest
27
+ outputs:
28
+ version: ${{ steps.v.outputs.version }}
29
+ steps:
30
+ - id: v
31
+ run: |
32
+ PKG="@applica-software-guru/persona-sdk"
33
+ # patch-max sulla serie 0.1 (esclude prerelease), +1 —
34
+ # identico all'algoritmo della pipeline Bitbucket
35
+ NEXT=$(npm view "$PKG" versions --json | node -e '
36
+ const versions = JSON.parse(require("fs").readFileSync(0, "utf8"));
37
+ const prefix = "0.1.";
38
+ const patches = versions
39
+ .filter(v => v.startsWith(prefix) && !v.includes("-"))
40
+ .map(v => Number(v.slice(prefix.length)))
41
+ .filter(Number.isFinite);
42
+ console.log(prefix + (Math.max(...patches, 0) + 1));')
43
+ echo "Prossima versione: ${NEXT}"
44
+ echo "version=${NEXT}" >> "$GITHUB_OUTPUT"
45
+
46
+ publish:
47
+ name: Lint, test, build & publish su npm (OIDC)
48
+ runs-on: ubuntu-latest
49
+ needs: version
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+ - uses: actions/setup-node@v4
53
+ with:
54
+ node-version: 22
55
+ registry-url: 'https://registry.npmjs.org'
56
+ # niente cache npm nei rilasci (recommendation npm per trusted publishing)
57
+ - name: Assicura npm >= 11.5.1 (richiesto per trusted publishing OIDC)
58
+ run: npm install -g npm@^11
59
+ - name: Versiona il package
60
+ run: npm version "${{ needs.version.outputs.version }}" --no-git-tag-version
61
+ - run: npm ci
62
+ - run: npm run lint
63
+ - run: npm test
64
+ - name: Publish su npm (OIDC trusted publishing, nessun token)
65
+ run: npm publish --access public
66
+
67
+ tag-release:
68
+ name: Tag di versione
69
+ runs-on: ubuntu-latest
70
+ needs: [version, publish]
71
+ if: always() && needs.publish.result == 'success'
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+ - name: Crea e pusha il tag
75
+ env:
76
+ VERSION: ${{ needs.version.outputs.version }}
77
+ run: |
78
+ git config user.name "RoBYCoNTe"
79
+ git config user.email "2301162+RoBYCoNTe@users.noreply.github.com"
80
+ git tag -a "${VERSION}" -m "Version ${VERSION}"
81
+ git push origin "${VERSION}"
@@ -0,0 +1,45 @@
1
+ # Migrazione Bitbucket → GitHub Actions
2
+
3
+ Repo migrato da `applicaguru/persona-sdk-js` (Bitbucket) a
4
+ `applica-software-guru/persona-sdk-js` (GitHub, privato) il
5
+ **2026-09-24**.
6
+
7
+ ## Fasi
8
+
9
+ 1. **Validazione locale** — lint (0 errori) + `npm test` (4/4,
10
+ build inclusa). Il pipeline BB non eseguiva test né lint sul push:
11
+ aggiunti in migrazione come miglioramento.
12
+ 2. **Repo GitHub** — creato privato; `main` (`74dc185`) + 46 tag
13
+ (serie `0.1.*` fino a `0.1.111`) + 2 rami WIP pushati tali quali:
14
+ `feature/sip-protocol` (SIP trunks/call-control, 3 commit) e
15
+ `refactor/litellm-model-config` (rimozione union `ModelName`,
16
+ 3 commit). I rami mergiati `feature/harness` e
17
+ `feature/voice-latency` non sono stati ripushati. Invariante
18
+ verificata: Bitbucket ⊆ GitHub (0 commit, 0 tag mancanti).
19
+ 3. **Pipeline** — `deploy.yml` (npm OIDC) + `ci.yml`, cutover.
20
+ 4. **Verifica** — run verde, `0.1.112` su npm, tag git.
21
+
22
+ ## Versioning
23
+
24
+ Alla migrazione le fonti erano **allineate**: npm latest = `0.1.111`
25
+ = tag git max. La formula replica l'algoritmo della pipeline BB
26
+ (patch-max sulla serie `0.1` da `npm view versions` +1; prerelease
27
+ escluse). Prima release GitHub: **`0.1.112`**. npm stesso è la guard
28
+ anti-collisione (rifiuta versioni duplicate). Il consumer principale
29
+ (`persona-cp`, dep `^0.1.110`) resta compatibile.
30
+
31
+ ## Pipeline decisionale (npm)
32
+
33
+ - **push su main** → version (riconciliazione npm) → lint/test →
34
+ **publish OIDC trusted publishing** (nessun token; configurato su
35
+ npmjs.com → package → Trusted Publisher, repo + workflow
36
+ `deploy.yml`) → tag di versione. Come il BB: ogni push su main è
37
+ una release.
38
+ - **PR** → `ci.yml`: validate (lint + test). Nuovo rispetto al BB.
39
+
40
+ ## Decisioni
41
+
42
+ - **Test**: suite esistente (`node --test`, 2 file) eseguita al
43
+ push — il BB la ignorava.
44
+ - **Segreti**: nessuno — OIDC trusted publishing.
45
+ - **Rimosso dal tree nel cutover**: `bitbucket-pipelines.yml`.
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ <div align="center">
2
+
3
+ [![Deploy](https://github.com/applica-software-guru/persona-sdk-js/actions/workflows/deploy.yml/badge.svg)](https://github.com/applica-software-guru/persona-sdk-js/actions/workflows/deploy.yml)
4
+
5
+ </div>
6
+
1
7
  # Persona SDK
2
8
 
3
9
  [![npm version](https://img.shields.io/npm/v/@applica-software-guru/persona-sdk)](https://www.npmjs.com/package/@applica-software-guru/persona-sdk)
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export declare interface Agent {
32
32
  features?: Feature[];
33
33
  toolkit?: ToolkitConfiguration;
34
34
  compaction?: CompactionConfiguration;
35
+ loopRecovery?: LoopRecoveryConfiguration;
35
36
  attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
36
37
  responseSchema?: Record<string, unknown>;
37
38
  verboseErrors?: boolean;
@@ -68,6 +69,7 @@ export declare interface AgentCreateRequest {
68
69
  features?: Feature[];
69
70
  toolkit?: ToolkitConfiguration;
70
71
  compaction?: CompactionConfiguration;
72
+ loopRecovery?: LoopRecoveryConfiguration;
71
73
  attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
72
74
  responseSchema?: Record<string, unknown>;
73
75
  verboseErrors?: boolean;
@@ -708,6 +710,22 @@ export declare interface LineItem {
708
710
  periodEnd?: string;
709
711
  }
710
712
 
713
+ export declare interface LoopRecoveryConfiguration {
714
+ /**
715
+ * Enable the completion check at the end of the turn: when the model's final
716
+ * response arrives (finish_reason stop, no tool call; tool-call iterations are
717
+ * never checked), a checker model decides whether the task is
718
+ * really finished and resumes the loop if not. Default: false.
719
+ */
720
+ enabled?: boolean;
721
+ /** Model used for the check (pick a small, fast one). Defaults to the agent's main model. */
722
+ model?: ModelConfiguration;
723
+ /** Maximum number of recoveries within a single turn. Default: 2. */
724
+ maxAttempts?: number;
725
+ /** Allow restarting the turn from the user's request; otherwise a restart is handled as a continue. Default: false. */
726
+ allowRestart?: boolean;
727
+ }
728
+
711
729
  export declare interface MarkupRule {
712
730
  id?: string;
713
731
  pattern?: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@applica-software-guru/persona-sdk",
3
3
  "description": "Official TypeScript SDK for the Persona API — manage agents, sessions, projects, knowledge bases, workflows, triggers and more.",
4
4
  "private": false,
5
- "version": "0.1.111",
5
+ "version": "0.1.113",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "dev": "vite",
@@ -349,6 +349,22 @@ export interface CompactionConfiguration {
349
349
  model?: ModelConfiguration;
350
350
  }
351
351
 
352
+ export interface LoopRecoveryConfiguration {
353
+ /**
354
+ * Enable the completion check at the end of the turn: when the model's final
355
+ * response arrives (finish_reason stop, no tool call; tool-call iterations are
356
+ * never checked), a checker model decides whether the task is
357
+ * really finished and resumes the loop if not. Default: false.
358
+ */
359
+ enabled?: boolean;
360
+ /** Model used for the check (pick a small, fast one). Defaults to the agent's main model. */
361
+ model?: ModelConfiguration;
362
+ /** Maximum number of recoveries within a single turn. Default: 2. */
363
+ maxAttempts?: number;
364
+ /** Allow restarting the turn from the user's request; otherwise a restart is handled as a continue. Default: false. */
365
+ allowRestart?: boolean;
366
+ }
367
+
352
368
  export interface Revision {
353
369
  id?: string;
354
370
  entityId?: string;
@@ -388,6 +404,7 @@ export interface Agent {
388
404
  features?: Feature[];
389
405
  toolkit?: ToolkitConfiguration;
390
406
  compaction?: CompactionConfiguration;
407
+ loopRecovery?: LoopRecoveryConfiguration;
391
408
  attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
392
409
  responseSchema?: Record<string, unknown>;
393
410
  verboseErrors?: boolean;
@@ -421,6 +438,7 @@ export interface AgentCreateRequest {
421
438
  features?: Feature[];
422
439
  toolkit?: ToolkitConfiguration;
423
440
  compaction?: CompactionConfiguration;
441
+ loopRecovery?: LoopRecoveryConfiguration;
424
442
  attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
425
443
  responseSchema?: Record<string, unknown>;
426
444
  verboseErrors?: boolean;
package/src/index.ts CHANGED
@@ -54,6 +54,7 @@ export type {
54
54
  ToolDefinition,
55
55
  ToolkitConfiguration,
56
56
  CompactionConfiguration,
57
+ LoopRecoveryConfiguration,
57
58
  Revision,
58
59
  AgentType,
59
60
  ReasoningEffort,
@@ -1,20 +0,0 @@
1
- image: node:22
2
-
3
- pipelines:
4
- branches:
5
- main:
6
- - step:
7
- name: Deploy
8
- deployment: Production
9
- script:
10
- - export VERSION_PREFIX=0.1
11
- - export PACKAGE_VERSION=$(npm view @applica-software-guru/persona-sdk versions --json | node -e "const versions = JSON.parse(require('fs').readFileSync(0, 'utf8')); const prefix = process.env.VERSION_PREFIX + '.'; const patches = versions.filter(v => v.startsWith(prefix) && !v.includes('-')).map(v => Number(v.slice(prefix.length))).filter(Number.isFinite); console.log(process.env.VERSION_PREFIX + '.' + (Math.max(...patches, 0) + 1));")
12
- - npm --no-git-tag-version version "$PACKAGE_VERSION" -m "Upgrade to new version"
13
- - npm install
14
- - npm run build
15
- - pipe: atlassian/npm-publish:0.3.2
16
- variables:
17
- NPM_TOKEN: $NPM_TOKEN
18
- EXTRA_ARGS: '--access public'
19
- - git tag -a "$PACKAGE_VERSION" -m "Version $PACKAGE_VERSION"
20
- - git push origin "$PACKAGE_VERSION"