@taiga-ai/mcp-server 0.16.0-dev.433 → 0.16.0-dev.435
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/index.js
CHANGED
|
@@ -1395,6 +1395,193 @@ function createdInitiativesOf(result) {
|
|
|
1395
1395
|
return parsed.success ? parsed.data.createdInitiatives : null;
|
|
1396
1396
|
}
|
|
1397
1397
|
//#endregion
|
|
1398
|
+
//#region ../../packages/types/dist/chat-stream-events.js
|
|
1399
|
+
/**
|
|
1400
|
+
* The longest generated document, in UTF-16 units: a long brief of a dozen
|
|
1401
|
+
* pages. A document past it is refused by the agent rather than clipped, since
|
|
1402
|
+
* a document with its tail cut off reads as finished.
|
|
1403
|
+
*/
|
|
1404
|
+
const MAX_GENERATED_DOCUMENT_CHARS = 4e4;
|
|
1405
|
+
/** A JSON object whose keys a reader walks itself. */
|
|
1406
|
+
const jsonObject = z.record(z.string(), z.unknown());
|
|
1407
|
+
/** The raw Strands block a tool call starts in. */
|
|
1408
|
+
const contentBlockStart = z.object({ start: lenient(z.object({ toolUse: lenient(jsonObject) })) });
|
|
1409
|
+
/** A raw Strands delta: answer text, or a fragment of a tool's input. */
|
|
1410
|
+
const contentBlockDelta = z.object({ delta: lenient(z.object({
|
|
1411
|
+
text: lenient(z.string()),
|
|
1412
|
+
toolUse: lenient(jsonObject)
|
|
1413
|
+
})) });
|
|
1414
|
+
/**
|
|
1415
|
+
* A frame's `event`, with the keys a reader dispatches on named. The raw
|
|
1416
|
+
* Strands blocks are read here; each synthesized payload is left as it came
|
|
1417
|
+
* and parsed by the reader that acts on it. Every other key passes through.
|
|
1418
|
+
*/
|
|
1419
|
+
const chatStreamFrameEvent = z.looseObject({
|
|
1420
|
+
contentBlockStart: lenient(contentBlockStart),
|
|
1421
|
+
contentBlockDelta: lenient(contentBlockDelta),
|
|
1422
|
+
toolStatus: z.unknown().optional(),
|
|
1423
|
+
retry: z.unknown().optional(),
|
|
1424
|
+
citations: z.unknown().optional(),
|
|
1425
|
+
citationCheck: z.unknown().optional(),
|
|
1426
|
+
usage: z.unknown().optional(),
|
|
1427
|
+
thought: z.unknown().optional(),
|
|
1428
|
+
plan: z.unknown().optional(),
|
|
1429
|
+
readPause: z.unknown().optional(),
|
|
1430
|
+
initiativeProposal: z.unknown().optional(),
|
|
1431
|
+
initiativeEditProposal: z.unknown().optional(),
|
|
1432
|
+
generatedDocument: z.unknown().optional(),
|
|
1433
|
+
documentSections: z.unknown().optional(),
|
|
1434
|
+
specUpdate: z.unknown().optional(),
|
|
1435
|
+
flowSections: z.unknown().optional()
|
|
1436
|
+
});
|
|
1437
|
+
z.object({
|
|
1438
|
+
status: z.unknown().optional(),
|
|
1439
|
+
error: lenient(z.string()),
|
|
1440
|
+
code: lenient(z.string()),
|
|
1441
|
+
message: lenient(z.object({
|
|
1442
|
+
role: z.unknown().optional(),
|
|
1443
|
+
content: lenient(z.array(z.unknown()))
|
|
1444
|
+
})),
|
|
1445
|
+
event: lenient(chatStreamFrameEvent)
|
|
1446
|
+
});
|
|
1447
|
+
//#endregion
|
|
1448
|
+
//#region ../../packages/types/dist/chat-stream-payloads.js
|
|
1449
|
+
/**
|
|
1450
|
+
* The synthesized chat stream payloads that the API persists and the browser
|
|
1451
|
+
* renders, each read by ONE set of rules (PRO-2735).
|
|
1452
|
+
*
|
|
1453
|
+
* The API reads a payload before it saves it with the answer, and the browser
|
|
1454
|
+
* reads it again, live and from the saved message. The two copies of these
|
|
1455
|
+
* readers used to be kept in step by hand (`chat/routes/stream.ts`,
|
|
1456
|
+
* `product-chat/live-turn.ts`); one shared reader means the card a live
|
|
1457
|
+
* stream draws is the card the reloaded transcript draws.
|
|
1458
|
+
*
|
|
1459
|
+
* Each reader takes the payload (the value under its key in `event`, or in the
|
|
1460
|
+
* message metadata) and returns the checked value or null. A payload that
|
|
1461
|
+
* fails is dropped whole, never stored half understood: every one of them is
|
|
1462
|
+
* rendered from the metadata, and the proposals' buttons perform a write.
|
|
1463
|
+
*/
|
|
1464
|
+
/**
|
|
1465
|
+
* The bounds `createBacklogItemBody` enforces on a proposed initiative
|
|
1466
|
+
* (PRO-1879). A proposal outside them would draw a card whose button opens a
|
|
1467
|
+
* dialog the create refuses; the agent applies them too, so a value outside
|
|
1468
|
+
* them is a malformed frame rather than a long brief to trim.
|
|
1469
|
+
*/
|
|
1470
|
+
const MAX_PROPOSAL_TITLE_CHARS = 500;
|
|
1471
|
+
const MAX_PROPOSAL_DESCRIPTION_CHARS = 2e4;
|
|
1472
|
+
/** `updateBacklogItemBody`'s own bound on a description. */
|
|
1473
|
+
const MAX_EDIT_DESCRIPTION_CHARS = 2e4;
|
|
1474
|
+
/** Text that is not empty once trimmed and fits `max` as written. */
|
|
1475
|
+
function contentWithin(max) {
|
|
1476
|
+
return z.string().refine((text) => text.trim().length > 0 && text.length <= max);
|
|
1477
|
+
}
|
|
1478
|
+
/** `revision` counts only as the literal `true`; anything else leaves it off. */
|
|
1479
|
+
function revisionOf(revision) {
|
|
1480
|
+
return revision === true ? { revision: true } : {};
|
|
1481
|
+
}
|
|
1482
|
+
z.object({
|
|
1483
|
+
title: z.string().trim().min(1).max(MAX_PROPOSAL_TITLE_CHARS),
|
|
1484
|
+
description: z.string().trim().min(1).max(MAX_PROPOSAL_DESCRIPTION_CHARS),
|
|
1485
|
+
productId: z.string().trim().min(1),
|
|
1486
|
+
revision: z.unknown().optional()
|
|
1487
|
+
}).transform(({ revision, ...proposal }) => ({
|
|
1488
|
+
...proposal,
|
|
1489
|
+
...revisionOf(revision)
|
|
1490
|
+
}));
|
|
1491
|
+
z.object({
|
|
1492
|
+
initiativeId: z.string().trim().min(1),
|
|
1493
|
+
description: contentWithin(MAX_EDIT_DESCRIPTION_CHARS),
|
|
1494
|
+
basedOn: z.object({
|
|
1495
|
+
updatedAt: z.string().trim().min(1),
|
|
1496
|
+
descriptionHash: z.string().regex(/^[0-9a-f]{64}$/)
|
|
1497
|
+
})
|
|
1498
|
+
});
|
|
1499
|
+
z.object({
|
|
1500
|
+
title: z.string().trim().min(1).max(200),
|
|
1501
|
+
kind: z.string().trim().min(1).max(80),
|
|
1502
|
+
markdown: contentWithin(MAX_GENERATED_DOCUMENT_CHARS),
|
|
1503
|
+
revision: z.unknown().optional()
|
|
1504
|
+
}).transform(({ revision, ...document }) => ({
|
|
1505
|
+
...document,
|
|
1506
|
+
...revisionOf(revision)
|
|
1507
|
+
}));
|
|
1508
|
+
const UNSUPPORTED_REASONS = [
|
|
1509
|
+
"no_quote",
|
|
1510
|
+
"unsupplied_document",
|
|
1511
|
+
"not_in_document"
|
|
1512
|
+
];
|
|
1513
|
+
const OUTCOMES = [
|
|
1514
|
+
"verified",
|
|
1515
|
+
"paraphrase_supported",
|
|
1516
|
+
"repointed",
|
|
1517
|
+
"unsupported"
|
|
1518
|
+
];
|
|
1519
|
+
/**
|
|
1520
|
+
* A reason a newer agent sends, or the `quote_not_found` an agent before
|
|
1521
|
+
* PRO-1752 sent, still names an unsupported statement; either reads as the
|
|
1522
|
+
* least specific reason.
|
|
1523
|
+
*/
|
|
1524
|
+
function unsupportedReason(value) {
|
|
1525
|
+
return UNSUPPORTED_REASONS.find((reason) => reason === value) ?? "not_in_document";
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Which document timeline an entry names (PRO-1731). Absent from an agent
|
|
1529
|
+
* older than PRO-1731, and absent means plan; left off rather than written in,
|
|
1530
|
+
* so "did not say" stays distinguishable from "said plan". A timeline this
|
|
1531
|
+
* contract does not know fails the entry: the origin decides which document a
|
|
1532
|
+
* chip opens, and reading an unknown one as plan links to words that are not
|
|
1533
|
+
* there.
|
|
1534
|
+
*/
|
|
1535
|
+
const origin = z.enum(PRODUCT_DOCUMENT_ORIGINS).optional();
|
|
1536
|
+
/** One statement the check could not support; a missing reason is malformed. */
|
|
1537
|
+
const unverifiedCitation = z.object({
|
|
1538
|
+
documentType: z.string(),
|
|
1539
|
+
version: z.number(),
|
|
1540
|
+
origin,
|
|
1541
|
+
section: lenient(z.string()),
|
|
1542
|
+
reason: z.string()
|
|
1543
|
+
}).transform((u) => ({
|
|
1544
|
+
documentType: u.documentType,
|
|
1545
|
+
version: u.version,
|
|
1546
|
+
...u.origin === void 0 ? {} : { origin: u.origin },
|
|
1547
|
+
...u.section === void 0 ? {} : { section: u.section },
|
|
1548
|
+
reason: unsupportedReason(u.reason)
|
|
1549
|
+
}));
|
|
1550
|
+
/**
|
|
1551
|
+
* One marker's outcome, strictly: an entry with no 1-based marker index, no
|
|
1552
|
+
* source, or an outcome this contract does not name is dropped rather than
|
|
1553
|
+
* guessed at, because the outcome decides whether the claim renders as a
|
|
1554
|
+
* reference at all.
|
|
1555
|
+
*/
|
|
1556
|
+
const citationOutcome = z.object({
|
|
1557
|
+
markerIndex: z.number().refine((n) => Number.isInteger(n) && n >= 1),
|
|
1558
|
+
documentType: z.string(),
|
|
1559
|
+
version: z.number(),
|
|
1560
|
+
origin,
|
|
1561
|
+
section: lenient(z.string()),
|
|
1562
|
+
outcome: z.enum(OUTCOMES),
|
|
1563
|
+
reason: z.unknown().optional(),
|
|
1564
|
+
resolvedSection: lenient(z.string())
|
|
1565
|
+
}).transform((o) => ({
|
|
1566
|
+
markerIndex: o.markerIndex,
|
|
1567
|
+
documentType: o.documentType,
|
|
1568
|
+
version: o.version,
|
|
1569
|
+
...o.origin === void 0 ? {} : { origin: o.origin },
|
|
1570
|
+
...o.section === void 0 ? {} : { section: o.section },
|
|
1571
|
+
outcome: o.outcome,
|
|
1572
|
+
...o.outcome === "unsupported" ? { reason: unsupportedReason(o.reason) } : {},
|
|
1573
|
+
...o.resolvedSection === void 0 ? {} : { resolvedSection: o.resolvedSection }
|
|
1574
|
+
}));
|
|
1575
|
+
z.object({
|
|
1576
|
+
verified: z.number(),
|
|
1577
|
+
unverified: lenientList(unverifiedCitation),
|
|
1578
|
+
outcomes: lenientList(citationOutcome).catch([]).optional()
|
|
1579
|
+
}).transform(({ verified, unverified, outcomes }) => ({
|
|
1580
|
+
verified: Math.max(0, Math.trunc(verified)),
|
|
1581
|
+
unverified,
|
|
1582
|
+
...outcomes === void 0 ? {} : { outcomes }
|
|
1583
|
+
}));
|
|
1584
|
+
//#endregion
|
|
1398
1585
|
//#region ../../packages/types/dist/environments.js
|
|
1399
1586
|
const ENVIRONMENT_TYPES = [
|
|
1400
1587
|
"development",
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|