@kmmao/happy-wire 0.11.10 → 0.11.11
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.cjs +176 -0
- package/dist/index.d.cts +40 -12
- package/dist/index.d.mts +40 -12
- package/dist/index.mjs +164 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1555,6 +1555,169 @@ const sessionSummaryStateSchema = z__namespace.object({
|
|
|
1555
1555
|
updatedAt: z__namespace.number()
|
|
1556
1556
|
});
|
|
1557
1557
|
|
|
1558
|
+
const HAPPY_MCP_TOOL_NAMES = [
|
|
1559
|
+
"change_title",
|
|
1560
|
+
"query_project_knowledge",
|
|
1561
|
+
"update_progress",
|
|
1562
|
+
"update_session_summary"
|
|
1563
|
+
];
|
|
1564
|
+
const HAPPY_MCP_TOOL_SPECS = {
|
|
1565
|
+
change_title: {
|
|
1566
|
+
title: "Change Title",
|
|
1567
|
+
description: 'Set or update the chat session title. Titles should be short (under 50 chars) and action-oriented, e.g. "Fix auth token refresh".',
|
|
1568
|
+
failureLabel: "Failed to change chat title",
|
|
1569
|
+
inputSchema: {
|
|
1570
|
+
title: z.z.string().describe("The new title for the chat session")
|
|
1571
|
+
},
|
|
1572
|
+
hideSuccessfulCall: true,
|
|
1573
|
+
autoApproveByDefault: true,
|
|
1574
|
+
permissionAction: "Waiting for approval to update chat title",
|
|
1575
|
+
dynamicAction: "Updating chat title",
|
|
1576
|
+
fallbackAction: "Update chat title",
|
|
1577
|
+
reasonPhrases: ["title update", "title updates", "change_title"]
|
|
1578
|
+
},
|
|
1579
|
+
query_project_knowledge: {
|
|
1580
|
+
title: "Project Knowledge",
|
|
1581
|
+
description: "Search the project knowledge base for relevant context, past decisions, known pitfalls, and conventions.",
|
|
1582
|
+
failureLabel: "Knowledge query failed",
|
|
1583
|
+
inputSchema: {
|
|
1584
|
+
query: z.z.string().describe("Search query describing what you want to know")
|
|
1585
|
+
},
|
|
1586
|
+
hideSuccessfulCall: false,
|
|
1587
|
+
autoApproveByDefault: false,
|
|
1588
|
+
permissionAction: "Waiting for approval to search project knowledge",
|
|
1589
|
+
dynamicAction: "Searching project knowledge",
|
|
1590
|
+
fallbackAction: "Search project knowledge",
|
|
1591
|
+
reasonPhrases: []
|
|
1592
|
+
},
|
|
1593
|
+
update_progress: {
|
|
1594
|
+
title: "Update Progress",
|
|
1595
|
+
description: 'Optional override for the App\'s Progress tab. In most cases your TodoWrite calls are auto-mirrored, so you do NOT need to call this. Use it only when you want to set extra fields the CLI hook does not capture (currentStage, blockers) or to force a new list boundary with `listId: "new"`.',
|
|
1596
|
+
failureLabel: "Failed to update progress",
|
|
1597
|
+
inputSchema: {
|
|
1598
|
+
todos: z.z.array(
|
|
1599
|
+
z.z.object({
|
|
1600
|
+
content: z.z.string().describe("Concise description of the task"),
|
|
1601
|
+
status: z.z.enum(["pending", "in_progress", "completed"]).describe("Current status of the task"),
|
|
1602
|
+
activeForm: z.z.string().optional().describe(
|
|
1603
|
+
"Imperative-present form shown when status is in_progress"
|
|
1604
|
+
),
|
|
1605
|
+
stage: z.z.string().optional().describe("Optional phase/stage label")
|
|
1606
|
+
})
|
|
1607
|
+
).describe("The full checklist \u2014 always send every item, not a delta"),
|
|
1608
|
+
currentStage: z.z.string().optional().describe("Optional overall stage name for the checklist"),
|
|
1609
|
+
blockers: z.z.array(z.z.string()).optional().describe("Optional list of things blocking progress"),
|
|
1610
|
+
listId: z.z.string().optional().describe("Target list id. Use 'new' to force a fresh list"),
|
|
1611
|
+
label: z.z.string().optional().describe("Short human-readable name for this task list")
|
|
1612
|
+
},
|
|
1613
|
+
hideSuccessfulCall: false,
|
|
1614
|
+
autoApproveByDefault: true,
|
|
1615
|
+
permissionAction: "Waiting for approval to update progress",
|
|
1616
|
+
dynamicAction: "Updating progress",
|
|
1617
|
+
fallbackAction: "Update progress",
|
|
1618
|
+
reasonPhrases: ["progress update", "progress updates", "update_progress"]
|
|
1619
|
+
},
|
|
1620
|
+
update_session_summary: {
|
|
1621
|
+
title: "Update Session Summary",
|
|
1622
|
+
description: "Write a narrative session summary the App shows above the progress checklist. Call at milestones, not per task: after first understanding the goal, when scope shifts significantly, when key decisions are made, or when moving to a new phase. Full rewrite each call.",
|
|
1623
|
+
failureLabel: "Failed to update session summary",
|
|
1624
|
+
inputSchema: {
|
|
1625
|
+
goal: z.z.string().describe("What the user ultimately wants to accomplish"),
|
|
1626
|
+
currentFocus: z.z.string().optional().describe("Brief description of the active task or phase"),
|
|
1627
|
+
keyDecisions: z.z.array(z.z.string()).optional().describe("Important choices already made this session"),
|
|
1628
|
+
openQuestions: z.z.array(z.z.string()).optional().describe("Unresolved questions or pending decisions"),
|
|
1629
|
+
impactScope: z.z.array(z.z.string()).optional().describe("Modules/files/areas affected by this session's work")
|
|
1630
|
+
},
|
|
1631
|
+
hideSuccessfulCall: false,
|
|
1632
|
+
autoApproveByDefault: true,
|
|
1633
|
+
permissionAction: "Waiting for approval to update session summary",
|
|
1634
|
+
dynamicAction: "Updating session summary",
|
|
1635
|
+
fallbackAction: "Update session summary",
|
|
1636
|
+
reasonPhrases: [
|
|
1637
|
+
"session summary",
|
|
1638
|
+
"update_session_summary",
|
|
1639
|
+
"summary update"
|
|
1640
|
+
]
|
|
1641
|
+
}
|
|
1642
|
+
};
|
|
1643
|
+
const HAPPY_MCP_TOOL_NAME_SET = new Set(HAPPY_MCP_TOOL_NAMES);
|
|
1644
|
+
const HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES = HAPPY_MCP_TOOL_NAMES.filter(
|
|
1645
|
+
(toolName) => HAPPY_MCP_TOOL_SPECS[toolName].autoApproveByDefault
|
|
1646
|
+
);
|
|
1647
|
+
const HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES = HAPPY_MCP_TOOL_NAMES.filter(
|
|
1648
|
+
(toolName) => HAPPY_MCP_TOOL_SPECS[toolName].hideSuccessfulCall
|
|
1649
|
+
);
|
|
1650
|
+
function getHappyMcpToolAliases(toolName) {
|
|
1651
|
+
return [
|
|
1652
|
+
toolName,
|
|
1653
|
+
`happy__${toolName}`,
|
|
1654
|
+
`mcp__happy__${toolName}`
|
|
1655
|
+
];
|
|
1656
|
+
}
|
|
1657
|
+
function normalizeHappyMcpToolName(toolName) {
|
|
1658
|
+
if (typeof toolName !== "string") {
|
|
1659
|
+
return null;
|
|
1660
|
+
}
|
|
1661
|
+
const trimmed = toolName.trim();
|
|
1662
|
+
if (!trimmed) {
|
|
1663
|
+
return null;
|
|
1664
|
+
}
|
|
1665
|
+
if (HAPPY_MCP_TOOL_NAME_SET.has(trimmed)) {
|
|
1666
|
+
return trimmed;
|
|
1667
|
+
}
|
|
1668
|
+
const withoutNamespace = trimmed.startsWith("mcp__happy__") ? trimmed.slice("mcp__happy__".length) : trimmed.startsWith("happy__") ? trimmed.slice("happy__".length) : null;
|
|
1669
|
+
if (withoutNamespace && HAPPY_MCP_TOOL_NAME_SET.has(withoutNamespace)) {
|
|
1670
|
+
return withoutNamespace;
|
|
1671
|
+
}
|
|
1672
|
+
return null;
|
|
1673
|
+
}
|
|
1674
|
+
function isHappyMcpToolName(toolName) {
|
|
1675
|
+
return normalizeHappyMcpToolName(toolName) !== null;
|
|
1676
|
+
}
|
|
1677
|
+
function isHappyMcpToolAlias(toolName, canonicalToolName) {
|
|
1678
|
+
return normalizeHappyMcpToolName(toolName) === canonicalToolName;
|
|
1679
|
+
}
|
|
1680
|
+
function getHappyMcpToolTitle(toolName) {
|
|
1681
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1682
|
+
return canonical ? HAPPY_MCP_TOOL_SPECS[canonical].title : null;
|
|
1683
|
+
}
|
|
1684
|
+
function getHappyMcpToolAction(toolName, mode) {
|
|
1685
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1686
|
+
if (!canonical) {
|
|
1687
|
+
return null;
|
|
1688
|
+
}
|
|
1689
|
+
const spec = HAPPY_MCP_TOOL_SPECS[canonical];
|
|
1690
|
+
if (mode === "permission") {
|
|
1691
|
+
return spec.permissionAction;
|
|
1692
|
+
}
|
|
1693
|
+
if (mode === "dynamic") {
|
|
1694
|
+
return spec.dynamicAction;
|
|
1695
|
+
}
|
|
1696
|
+
return spec.fallbackAction;
|
|
1697
|
+
}
|
|
1698
|
+
function shouldHideSuccessfulHappyMcpTool(toolName) {
|
|
1699
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1700
|
+
return canonical ? HAPPY_MCP_TOOL_SPECS[canonical].hideSuccessfulCall : false;
|
|
1701
|
+
}
|
|
1702
|
+
function shouldAutoApproveHappyMcpToolName(toolName) {
|
|
1703
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1704
|
+
return canonical ? HAPPY_MCP_TOOL_SPECS[canonical].autoApproveByDefault : false;
|
|
1705
|
+
}
|
|
1706
|
+
function shouldAutoApproveHappyMcpReason(reason) {
|
|
1707
|
+
if (typeof reason !== "string") {
|
|
1708
|
+
return false;
|
|
1709
|
+
}
|
|
1710
|
+
const normalizedReason = reason.toLowerCase();
|
|
1711
|
+
if (!normalizedReason.includes("happy")) {
|
|
1712
|
+
return false;
|
|
1713
|
+
}
|
|
1714
|
+
return HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES.some(
|
|
1715
|
+
(toolName) => HAPPY_MCP_TOOL_SPECS[toolName].reasonPhrases.some(
|
|
1716
|
+
(phrase) => normalizedReason.includes(phrase)
|
|
1717
|
+
)
|
|
1718
|
+
);
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1558
1721
|
exports.AGENT_MSG_PRIORITIES = AGENT_MSG_PRIORITIES;
|
|
1559
1722
|
exports.AGENT_MSG_STATUSES = AGENT_MSG_STATUSES;
|
|
1560
1723
|
exports.AGENT_MSG_TYPES = AGENT_MSG_TYPES;
|
|
@@ -1600,6 +1763,10 @@ exports.DaemonStateSchema = DaemonStateSchema;
|
|
|
1600
1763
|
exports.DefaultPermissionModeSchema = DefaultPermissionModeSchema;
|
|
1601
1764
|
exports.EVIDENCE_KINDS = EVIDENCE_KINDS;
|
|
1602
1765
|
exports.EnvironmentVariableSchema = EnvironmentVariableSchema;
|
|
1766
|
+
exports.HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES = HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES;
|
|
1767
|
+
exports.HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES = HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES;
|
|
1768
|
+
exports.HAPPY_MCP_TOOL_NAMES = HAPPY_MCP_TOOL_NAMES;
|
|
1769
|
+
exports.HAPPY_MCP_TOOL_SPECS = HAPPY_MCP_TOOL_SPECS;
|
|
1603
1770
|
exports.InboxCategorySchema = InboxCategorySchema;
|
|
1604
1771
|
exports.InboxItemSummarySchema = InboxItemSummarySchema;
|
|
1605
1772
|
exports.InboxNewItemSchema = InboxNewItemSchema;
|
|
@@ -1687,9 +1854,15 @@ exports.WorldAutonomyPolicySchema = WorldAutonomyPolicySchema;
|
|
|
1687
1854
|
exports.WorldSuggestionUpdatedSchema = WorldSuggestionUpdatedSchema;
|
|
1688
1855
|
exports.createEnvelope = createEnvelope;
|
|
1689
1856
|
exports.createResolvedRuntimeProfile = createResolvedRuntimeProfile;
|
|
1857
|
+
exports.getHappyMcpToolAction = getHappyMcpToolAction;
|
|
1858
|
+
exports.getHappyMcpToolAliases = getHappyMcpToolAliases;
|
|
1859
|
+
exports.getHappyMcpToolTitle = getHappyMcpToolTitle;
|
|
1690
1860
|
exports.getProfileEnvironmentVariables = getProfileEnvironmentVariables;
|
|
1691
1861
|
exports.getSuggestionPayloadSchema = getSuggestionPayloadSchema;
|
|
1862
|
+
exports.isHappyMcpToolAlias = isHappyMcpToolAlias;
|
|
1863
|
+
exports.isHappyMcpToolName = isHappyMcpToolName;
|
|
1692
1864
|
exports.isTrustedRuntimeProfile = isTrustedRuntimeProfile;
|
|
1865
|
+
exports.normalizeHappyMcpToolName = normalizeHappyMcpToolName;
|
|
1693
1866
|
exports.normalizeResolvedRuntimeProfile = normalizeResolvedRuntimeProfile;
|
|
1694
1867
|
exports.sessionContextUsageCategorySchema = sessionContextUsageCategorySchema;
|
|
1695
1868
|
exports.sessionContextUsageEventSchema = sessionContextUsageEventSchema;
|
|
@@ -1722,6 +1895,9 @@ exports.sessionTurnEndEventSchema = sessionTurnEndEventSchema;
|
|
|
1722
1895
|
exports.sessionTurnEndStatusSchema = sessionTurnEndStatusSchema;
|
|
1723
1896
|
exports.sessionTurnStartEventSchema = sessionTurnStartEventSchema;
|
|
1724
1897
|
exports.sessionUsageUpdateEventSchema = sessionUsageUpdateEventSchema;
|
|
1898
|
+
exports.shouldAutoApproveHappyMcpReason = shouldAutoApproveHappyMcpReason;
|
|
1899
|
+
exports.shouldAutoApproveHappyMcpToolName = shouldAutoApproveHappyMcpToolName;
|
|
1900
|
+
exports.shouldHideSuccessfulHappyMcpTool = shouldHideSuccessfulHappyMcpTool;
|
|
1725
1901
|
exports.terminalCloseRequestSchema = terminalCloseRequestSchema;
|
|
1726
1902
|
exports.terminalExitPayloadSchema = terminalExitPayloadSchema;
|
|
1727
1903
|
exports.terminalInputPayloadSchema = terminalInputPayloadSchema;
|
package/dist/index.d.cts
CHANGED
|
@@ -2103,8 +2103,8 @@ declare const KnowledgeEntryTypeSchema: z.ZodEnum<{
|
|
|
2103
2103
|
type KnowledgeEntryType = z.infer<typeof KnowledgeEntryTypeSchema>;
|
|
2104
2104
|
declare const KnowledgeContributorTypeSchema: z.ZodEnum<{
|
|
2105
2105
|
user: "user";
|
|
2106
|
-
supervisor: "supervisor";
|
|
2107
2106
|
session: "session";
|
|
2107
|
+
supervisor: "supervisor";
|
|
2108
2108
|
}>;
|
|
2109
2109
|
type KnowledgeContributorType = z.infer<typeof KnowledgeContributorTypeSchema>;
|
|
2110
2110
|
declare const KnowledgeActionSchema: z.ZodEnum<{
|
|
@@ -2116,8 +2116,8 @@ declare const KnowledgeActionSchema: z.ZodEnum<{
|
|
|
2116
2116
|
type KnowledgeAction = z.infer<typeof KnowledgeActionSchema>;
|
|
2117
2117
|
declare const KnowledgeStatusSchema: z.ZodEnum<{
|
|
2118
2118
|
active: "active";
|
|
2119
|
-
superseded: "superseded";
|
|
2120
2119
|
archived: "archived";
|
|
2120
|
+
superseded: "superseded";
|
|
2121
2121
|
}>;
|
|
2122
2122
|
type KnowledgeStatus = z.infer<typeof KnowledgeStatusSchema>;
|
|
2123
2123
|
declare const KnowledgeConfidenceSchema: z.ZodEnum<{
|
|
@@ -2136,8 +2136,8 @@ declare const CreateKnowledgeEntryBodySchema: z.ZodObject<{
|
|
|
2136
2136
|
}>;
|
|
2137
2137
|
contributorType: z.ZodEnum<{
|
|
2138
2138
|
user: "user";
|
|
2139
|
-
supervisor: "supervisor";
|
|
2140
2139
|
session: "session";
|
|
2140
|
+
supervisor: "supervisor";
|
|
2141
2141
|
}>;
|
|
2142
2142
|
action: z.ZodEnum<{
|
|
2143
2143
|
create: "create";
|
|
@@ -2168,8 +2168,8 @@ type CreateKnowledgeEntryBody = z.infer<typeof CreateKnowledgeEntryBodySchema>;
|
|
|
2168
2168
|
declare const UpdateKnowledgeEntryBodySchema: z.ZodObject<{
|
|
2169
2169
|
status: z.ZodOptional<z.ZodEnum<{
|
|
2170
2170
|
active: "active";
|
|
2171
|
-
superseded: "superseded";
|
|
2172
2171
|
archived: "archived";
|
|
2172
|
+
superseded: "superseded";
|
|
2173
2173
|
}>>;
|
|
2174
2174
|
pinned: z.ZodOptional<z.ZodBoolean>;
|
|
2175
2175
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -2192,8 +2192,8 @@ declare const QueryKnowledgeParamsSchema: z.ZodObject<{
|
|
|
2192
2192
|
}>>;
|
|
2193
2193
|
status: z.ZodOptional<z.ZodEnum<{
|
|
2194
2194
|
active: "active";
|
|
2195
|
-
superseded: "superseded";
|
|
2196
2195
|
archived: "archived";
|
|
2196
|
+
superseded: "superseded";
|
|
2197
2197
|
}>>;
|
|
2198
2198
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2199
2199
|
search: z.ZodOptional<z.ZodString>;
|
|
@@ -2281,8 +2281,8 @@ declare const KnowledgeChainEntrySchema: z.ZodObject<{
|
|
|
2281
2281
|
}>;
|
|
2282
2282
|
status: z.ZodEnum<{
|
|
2283
2283
|
active: "active";
|
|
2284
|
-
superseded: "superseded";
|
|
2285
2284
|
archived: "archived";
|
|
2285
|
+
superseded: "superseded";
|
|
2286
2286
|
}>;
|
|
2287
2287
|
title: z.ZodString;
|
|
2288
2288
|
content: z.ZodString;
|
|
@@ -2314,8 +2314,8 @@ declare const KnowledgeChainResponseSchema: z.ZodObject<{
|
|
|
2314
2314
|
}>;
|
|
2315
2315
|
status: z.ZodEnum<{
|
|
2316
2316
|
active: "active";
|
|
2317
|
-
superseded: "superseded";
|
|
2318
2317
|
archived: "archived";
|
|
2318
|
+
superseded: "superseded";
|
|
2319
2319
|
}>;
|
|
2320
2320
|
title: z.ZodString;
|
|
2321
2321
|
content: z.ZodString;
|
|
@@ -2614,10 +2614,10 @@ declare const SkillContentSchema: z.ZodObject<{
|
|
|
2614
2614
|
type SkillContent = z.infer<typeof SkillContentSchema>;
|
|
2615
2615
|
|
|
2616
2616
|
declare const InboxCategorySchema: z.ZodEnum<{
|
|
2617
|
+
session: "session";
|
|
2617
2618
|
supervisor: "supervisor";
|
|
2618
2619
|
task: "task";
|
|
2619
2620
|
trigger: "trigger";
|
|
2620
|
-
session: "session";
|
|
2621
2621
|
knowledge: "knowledge";
|
|
2622
2622
|
system: "system";
|
|
2623
2623
|
}>;
|
|
@@ -2631,10 +2631,10 @@ type InboxSeverity = z.infer<typeof InboxSeveritySchema>;
|
|
|
2631
2631
|
declare const InboxItemSummarySchema: z.ZodObject<{
|
|
2632
2632
|
id: z.ZodString;
|
|
2633
2633
|
category: z.ZodEnum<{
|
|
2634
|
+
session: "session";
|
|
2634
2635
|
supervisor: "supervisor";
|
|
2635
2636
|
task: "task";
|
|
2636
2637
|
trigger: "trigger";
|
|
2637
|
-
session: "session";
|
|
2638
2638
|
knowledge: "knowledge";
|
|
2639
2639
|
system: "system";
|
|
2640
2640
|
}>;
|
|
@@ -2659,10 +2659,10 @@ declare const InboxNewItemSchema: z.ZodObject<{
|
|
|
2659
2659
|
item: z.ZodObject<{
|
|
2660
2660
|
id: z.ZodString;
|
|
2661
2661
|
category: z.ZodEnum<{
|
|
2662
|
+
session: "session";
|
|
2662
2663
|
supervisor: "supervisor";
|
|
2663
2664
|
task: "task";
|
|
2664
2665
|
trigger: "trigger";
|
|
2665
|
-
session: "session";
|
|
2666
2666
|
knowledge: "knowledge";
|
|
2667
2667
|
system: "system";
|
|
2668
2668
|
}>;
|
|
@@ -3554,5 +3554,33 @@ declare const sessionSummaryStateSchema: z.ZodObject<{
|
|
|
3554
3554
|
}, z.core.$strip>;
|
|
3555
3555
|
type SessionSummaryState = z.infer<typeof sessionSummaryStateSchema>;
|
|
3556
3556
|
|
|
3557
|
-
|
|
3558
|
-
|
|
3557
|
+
declare const HAPPY_MCP_TOOL_NAMES: readonly ["change_title", "query_project_knowledge", "update_progress", "update_session_summary"];
|
|
3558
|
+
type HappyMcpCanonicalToolName = (typeof HAPPY_MCP_TOOL_NAMES)[number];
|
|
3559
|
+
type HappyMcpToolActionMode = "dynamic" | "permission" | "fallback";
|
|
3560
|
+
type HappyMcpToolSpec = {
|
|
3561
|
+
title: string;
|
|
3562
|
+
description: string;
|
|
3563
|
+
failureLabel: string;
|
|
3564
|
+
inputSchema: Record<string, z$1.ZodTypeAny>;
|
|
3565
|
+
hideSuccessfulCall: boolean;
|
|
3566
|
+
autoApproveByDefault: boolean;
|
|
3567
|
+
permissionAction: string;
|
|
3568
|
+
dynamicAction: string;
|
|
3569
|
+
fallbackAction: string;
|
|
3570
|
+
reasonPhrases: string[];
|
|
3571
|
+
};
|
|
3572
|
+
declare const HAPPY_MCP_TOOL_SPECS: Record<HappyMcpCanonicalToolName, HappyMcpToolSpec>;
|
|
3573
|
+
declare const HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES: HappyMcpCanonicalToolName[];
|
|
3574
|
+
declare const HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES: HappyMcpCanonicalToolName[];
|
|
3575
|
+
declare function getHappyMcpToolAliases(toolName: HappyMcpCanonicalToolName): readonly string[];
|
|
3576
|
+
declare function normalizeHappyMcpToolName(toolName: string | null | undefined): HappyMcpCanonicalToolName | null;
|
|
3577
|
+
declare function isHappyMcpToolName(toolName: string | null | undefined): boolean;
|
|
3578
|
+
declare function isHappyMcpToolAlias(toolName: string | null | undefined, canonicalToolName: HappyMcpCanonicalToolName): boolean;
|
|
3579
|
+
declare function getHappyMcpToolTitle(toolName: string | null | undefined): string | null;
|
|
3580
|
+
declare function getHappyMcpToolAction(toolName: string | null | undefined, mode: HappyMcpToolActionMode): string | null;
|
|
3581
|
+
declare function shouldHideSuccessfulHappyMcpTool(toolName: string | null | undefined): boolean;
|
|
3582
|
+
declare function shouldAutoApproveHappyMcpToolName(toolName: string | null | undefined): boolean;
|
|
3583
|
+
declare function shouldAutoApproveHappyMcpReason(reason: string | null | undefined): boolean;
|
|
3584
|
+
|
|
3585
|
+
export { AGENT_MSG_PRIORITIES, AGENT_MSG_STATUSES, AGENT_MSG_TYPES, AIBackendProfileSchema, AcceptBodySchema, AgentLoopSummarySchema, AgentMessageSchema, AgentMessageSummarySchema, AgentMsgTypeSchema, AnthropicConfigSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, AutoDreamProfileSummarySchema, AutomationAuditEventSummarySchema, AutomationAuditStatsSchema, AutomationCountsSchema, AutomationGuardianSummarySchema, AutomationGuardianUsageSummarySchema, AutomationJobKindSchema, AutomationJobStatusSchema, AutomationJobSummarySchema, AutomationPrioritySchema, AutomationStateSchema, AutonomyStatsRecentActionSchema, AutonomyStatsSchema, AzureOpenAIConfigSchema, BUILT_IN_AI_BACKEND_PROFILE_IDS, BootstrapProfileSummarySchema, BriefMessageSchema, BuiltInAIBackendProfileIdSchema, CodexConfigSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, CreateSkillBodySchema, CreateTaskBodySchema, CrossProjectSearchResponseSchema, CrossProjectSearchResultSchema, CustomModelSchema, DaemonStateSchema, DefaultPermissionModeSchema, EVIDENCE_KINDS, EnvironmentVariableSchema, HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES, HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES, HAPPY_MCP_TOOL_NAMES, HAPPY_MCP_TOOL_SPECS, InboxCategorySchema, InboxItemSummarySchema, InboxNewItemSchema, InboxSeveritySchema, InboxUnreadCountSchema, KnowledgeActionSchema, KnowledgeChainEntrySchema, KnowledgeChainRelationSchema, KnowledgeChainResponseSchema, KnowledgeConfidenceSchema, KnowledgeContributorTypeSchema, KnowledgeEntryTypeSchema, KnowledgeInjectionModeSchema, KnowledgeInjectionRequestSchema, KnowledgeInjectionResponseSchema, KnowledgeStatusSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, OpenAIConfigSchema, ProfileCompatibilitySchema, ProjectProfileSchema, QueryKnowledgeParamsSchema, RESOLVED_RUNTIME_PROFILE_SCHEMA_VERSION, ResolvedRuntimeProfileSchema, RuntimeProfileSourceSchema, RuntimeProfileTrustSchema, SUGGESTION_ACCEPT_AUDIT_RULES, SUGGESTION_ACCEPT_SOURCES, SUGGESTION_AUTO_ACCEPT_FAILURE_DETAILS, SUGGESTION_AUTO_ACCEPT_REASON_CODES, SUGGESTION_AUTO_ACCEPT_STATUSES, SUGGESTION_BUCKETS, SUGGESTION_STATUSES, SUGGESTION_TYPES, SUPERVISOR_MODES, SessionEventCreatedSchema, SessionEventReportSchema, SessionEventSummarySchema, SessionEventTypeSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, SkillContentSchema, SkillSummarySchema, SuggestionAcceptAuditSchema, SuggestionDecisionPayloadSchema, SuggestionEvidenceSchema, SuggestionGoalPayloadSchema, SuggestionPayloadSchema, SuggestionSkillPayloadSchema, SuggestionTaskPayloadSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, TaskOutcomeSchema, TaskPrioritySchema, TaskStatusChangedSchema, TaskStatusReportSchema, TaskStatusSchema, TaskSummarySchema, TaskTriggerDataSchema, TaskTriggerTypeSchema, TmuxConfigSchema, TogetherAIConfigSchema, TunnelEntrySchema, TunnelProviderInfoSchema, TunnelStateSchema, TurnKnowledgeExtractionSchema, UpdateBodySchema, UpdateKnowledgeEntryBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UpdateSkillBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceTokenAllowedSchema, VoiceTokenDeniedSchema, VoiceTokenResponseSchema, WorldAutonomyPolicySchema, WorldSuggestionUpdatedSchema, createEnvelope, createResolvedRuntimeProfile, getHappyMcpToolAction, getHappyMcpToolAliases, getHappyMcpToolTitle, getProfileEnvironmentVariables, getSuggestionPayloadSchema, isHappyMcpToolAlias, isHappyMcpToolName, isTrustedRuntimeProfile, normalizeHappyMcpToolName, normalizeResolvedRuntimeProfile, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionProgressListSchema, sessionProgressStateSchema, sessionProgressTodoSchema, sessionProgressTodoStatusSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionSummaryStateSchema, sessionTaskEndEventSchema, sessionTaskLogEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextDeltaEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema, shouldAutoApproveHappyMcpReason, shouldAutoApproveHappyMcpToolName, shouldHideSuccessfulHappyMcpTool, terminalCloseRequestSchema, terminalExitPayloadSchema, terminalInputPayloadSchema, terminalOutputPayloadSchema, terminalResizeRequestSchema, terminalSpawnRequestSchema, terminalSpawnResponseSchema, validateProfileForAgent };
|
|
3586
|
+
export type { AIBackendProfile, AcceptBody, AgentLoopSummary, AgentMessage, AgentMessageSummary, AgentMsgPriority, AgentMsgStatus, AgentMsgType, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, AutoDreamProfileSummary, AutomationAuditEventSummary, AutomationAuditStats, AutomationCounts, AutomationGuardianSummary, AutomationGuardianUsageSummary, AutomationJobKind, AutomationJobStatus, AutomationJobSummary, AutomationPriority, AutomationState, AutonomyStats, BootstrapProfileSummary, BriefMessage, BuiltInAIBackendProfileId, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, CreateKnowledgeEntryBody, CreateSkillBody, CreateTaskBody, CrossProjectSearchResponse, CrossProjectSearchResult, DaemonState, HappyMcpCanonicalToolName, HappyMcpToolActionMode, InboxCategory, InboxItemSummary, InboxNewItem, InboxSeverity, InboxUnreadCount, KnowledgeAction, KnowledgeChainEntry, KnowledgeChainRelation, KnowledgeChainResponse, KnowledgeConfidence, KnowledgeContributorType, KnowledgeEntryType, KnowledgeInjectionMode, KnowledgeInjectionRequest, KnowledgeInjectionResponse, KnowledgeStatus, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, ProjectProfile, QueryKnowledgeParams, ResolvedRuntimeProfile, RuntimeProfileSource, RuntimeProfileTrust, SessionContextUsageEvent, SessionEnvelope, SessionEvent, SessionEventCreated, SessionEventReport, SessionEventSummary, SessionEventType, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProgressList, SessionProgressState, SessionProgressTodo, SessionProgressTodoStatus, SessionProtocolMessage, SessionRole, SessionSummaryState, SessionTurnEndStatus, SkillContent, SkillSummary, SuggestionAcceptAudit, SuggestionAcceptAuditRule, SuggestionAcceptSource, SuggestionAutoAcceptFailureDetail, SuggestionAutoAcceptReasonCode, SuggestionAutoAcceptStatus, SuggestionBucket, SuggestionDecisionPayload, SuggestionEvidence, SuggestionGoalPayload, SuggestionPayload, SuggestionSerialized, SuggestionSkillPayload, SuggestionStatus, SuggestionSummary, SuggestionTaskPayload, SuggestionType, SupervisorMode, TailscaleInfo, TailscaleServeEntry, TaskOutcome, TaskPriority, TaskStatus, TaskStatusChanged, TaskStatusReport, TaskSummary, TaskTriggerData, TaskTriggerType, TerminalCloseRequest, TerminalExitPayload, TerminalInputPayload, TerminalOutputPayload, TerminalResizeRequest, TerminalSpawnRequest, TerminalSpawnResponse, TunnelEntry, TunnelProviderInfo, TunnelState, TurnKnowledgeExtraction, Update, UpdateBody, UpdateKnowledgeEntryBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UpdateSkillBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue, VoiceTokenResponse, WorldAutonomyPolicy, WorldSuggestionUpdated };
|
package/dist/index.d.mts
CHANGED
|
@@ -2103,8 +2103,8 @@ declare const KnowledgeEntryTypeSchema: z.ZodEnum<{
|
|
|
2103
2103
|
type KnowledgeEntryType = z.infer<typeof KnowledgeEntryTypeSchema>;
|
|
2104
2104
|
declare const KnowledgeContributorTypeSchema: z.ZodEnum<{
|
|
2105
2105
|
user: "user";
|
|
2106
|
-
supervisor: "supervisor";
|
|
2107
2106
|
session: "session";
|
|
2107
|
+
supervisor: "supervisor";
|
|
2108
2108
|
}>;
|
|
2109
2109
|
type KnowledgeContributorType = z.infer<typeof KnowledgeContributorTypeSchema>;
|
|
2110
2110
|
declare const KnowledgeActionSchema: z.ZodEnum<{
|
|
@@ -2116,8 +2116,8 @@ declare const KnowledgeActionSchema: z.ZodEnum<{
|
|
|
2116
2116
|
type KnowledgeAction = z.infer<typeof KnowledgeActionSchema>;
|
|
2117
2117
|
declare const KnowledgeStatusSchema: z.ZodEnum<{
|
|
2118
2118
|
active: "active";
|
|
2119
|
-
superseded: "superseded";
|
|
2120
2119
|
archived: "archived";
|
|
2120
|
+
superseded: "superseded";
|
|
2121
2121
|
}>;
|
|
2122
2122
|
type KnowledgeStatus = z.infer<typeof KnowledgeStatusSchema>;
|
|
2123
2123
|
declare const KnowledgeConfidenceSchema: z.ZodEnum<{
|
|
@@ -2136,8 +2136,8 @@ declare const CreateKnowledgeEntryBodySchema: z.ZodObject<{
|
|
|
2136
2136
|
}>;
|
|
2137
2137
|
contributorType: z.ZodEnum<{
|
|
2138
2138
|
user: "user";
|
|
2139
|
-
supervisor: "supervisor";
|
|
2140
2139
|
session: "session";
|
|
2140
|
+
supervisor: "supervisor";
|
|
2141
2141
|
}>;
|
|
2142
2142
|
action: z.ZodEnum<{
|
|
2143
2143
|
create: "create";
|
|
@@ -2168,8 +2168,8 @@ type CreateKnowledgeEntryBody = z.infer<typeof CreateKnowledgeEntryBodySchema>;
|
|
|
2168
2168
|
declare const UpdateKnowledgeEntryBodySchema: z.ZodObject<{
|
|
2169
2169
|
status: z.ZodOptional<z.ZodEnum<{
|
|
2170
2170
|
active: "active";
|
|
2171
|
-
superseded: "superseded";
|
|
2172
2171
|
archived: "archived";
|
|
2172
|
+
superseded: "superseded";
|
|
2173
2173
|
}>>;
|
|
2174
2174
|
pinned: z.ZodOptional<z.ZodBoolean>;
|
|
2175
2175
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -2192,8 +2192,8 @@ declare const QueryKnowledgeParamsSchema: z.ZodObject<{
|
|
|
2192
2192
|
}>>;
|
|
2193
2193
|
status: z.ZodOptional<z.ZodEnum<{
|
|
2194
2194
|
active: "active";
|
|
2195
|
-
superseded: "superseded";
|
|
2196
2195
|
archived: "archived";
|
|
2196
|
+
superseded: "superseded";
|
|
2197
2197
|
}>>;
|
|
2198
2198
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2199
2199
|
search: z.ZodOptional<z.ZodString>;
|
|
@@ -2281,8 +2281,8 @@ declare const KnowledgeChainEntrySchema: z.ZodObject<{
|
|
|
2281
2281
|
}>;
|
|
2282
2282
|
status: z.ZodEnum<{
|
|
2283
2283
|
active: "active";
|
|
2284
|
-
superseded: "superseded";
|
|
2285
2284
|
archived: "archived";
|
|
2285
|
+
superseded: "superseded";
|
|
2286
2286
|
}>;
|
|
2287
2287
|
title: z.ZodString;
|
|
2288
2288
|
content: z.ZodString;
|
|
@@ -2314,8 +2314,8 @@ declare const KnowledgeChainResponseSchema: z.ZodObject<{
|
|
|
2314
2314
|
}>;
|
|
2315
2315
|
status: z.ZodEnum<{
|
|
2316
2316
|
active: "active";
|
|
2317
|
-
superseded: "superseded";
|
|
2318
2317
|
archived: "archived";
|
|
2318
|
+
superseded: "superseded";
|
|
2319
2319
|
}>;
|
|
2320
2320
|
title: z.ZodString;
|
|
2321
2321
|
content: z.ZodString;
|
|
@@ -2614,10 +2614,10 @@ declare const SkillContentSchema: z.ZodObject<{
|
|
|
2614
2614
|
type SkillContent = z.infer<typeof SkillContentSchema>;
|
|
2615
2615
|
|
|
2616
2616
|
declare const InboxCategorySchema: z.ZodEnum<{
|
|
2617
|
+
session: "session";
|
|
2617
2618
|
supervisor: "supervisor";
|
|
2618
2619
|
task: "task";
|
|
2619
2620
|
trigger: "trigger";
|
|
2620
|
-
session: "session";
|
|
2621
2621
|
knowledge: "knowledge";
|
|
2622
2622
|
system: "system";
|
|
2623
2623
|
}>;
|
|
@@ -2631,10 +2631,10 @@ type InboxSeverity = z.infer<typeof InboxSeveritySchema>;
|
|
|
2631
2631
|
declare const InboxItemSummarySchema: z.ZodObject<{
|
|
2632
2632
|
id: z.ZodString;
|
|
2633
2633
|
category: z.ZodEnum<{
|
|
2634
|
+
session: "session";
|
|
2634
2635
|
supervisor: "supervisor";
|
|
2635
2636
|
task: "task";
|
|
2636
2637
|
trigger: "trigger";
|
|
2637
|
-
session: "session";
|
|
2638
2638
|
knowledge: "knowledge";
|
|
2639
2639
|
system: "system";
|
|
2640
2640
|
}>;
|
|
@@ -2659,10 +2659,10 @@ declare const InboxNewItemSchema: z.ZodObject<{
|
|
|
2659
2659
|
item: z.ZodObject<{
|
|
2660
2660
|
id: z.ZodString;
|
|
2661
2661
|
category: z.ZodEnum<{
|
|
2662
|
+
session: "session";
|
|
2662
2663
|
supervisor: "supervisor";
|
|
2663
2664
|
task: "task";
|
|
2664
2665
|
trigger: "trigger";
|
|
2665
|
-
session: "session";
|
|
2666
2666
|
knowledge: "knowledge";
|
|
2667
2667
|
system: "system";
|
|
2668
2668
|
}>;
|
|
@@ -3554,5 +3554,33 @@ declare const sessionSummaryStateSchema: z.ZodObject<{
|
|
|
3554
3554
|
}, z.core.$strip>;
|
|
3555
3555
|
type SessionSummaryState = z.infer<typeof sessionSummaryStateSchema>;
|
|
3556
3556
|
|
|
3557
|
-
|
|
3558
|
-
|
|
3557
|
+
declare const HAPPY_MCP_TOOL_NAMES: readonly ["change_title", "query_project_knowledge", "update_progress", "update_session_summary"];
|
|
3558
|
+
type HappyMcpCanonicalToolName = (typeof HAPPY_MCP_TOOL_NAMES)[number];
|
|
3559
|
+
type HappyMcpToolActionMode = "dynamic" | "permission" | "fallback";
|
|
3560
|
+
type HappyMcpToolSpec = {
|
|
3561
|
+
title: string;
|
|
3562
|
+
description: string;
|
|
3563
|
+
failureLabel: string;
|
|
3564
|
+
inputSchema: Record<string, z$1.ZodTypeAny>;
|
|
3565
|
+
hideSuccessfulCall: boolean;
|
|
3566
|
+
autoApproveByDefault: boolean;
|
|
3567
|
+
permissionAction: string;
|
|
3568
|
+
dynamicAction: string;
|
|
3569
|
+
fallbackAction: string;
|
|
3570
|
+
reasonPhrases: string[];
|
|
3571
|
+
};
|
|
3572
|
+
declare const HAPPY_MCP_TOOL_SPECS: Record<HappyMcpCanonicalToolName, HappyMcpToolSpec>;
|
|
3573
|
+
declare const HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES: HappyMcpCanonicalToolName[];
|
|
3574
|
+
declare const HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES: HappyMcpCanonicalToolName[];
|
|
3575
|
+
declare function getHappyMcpToolAliases(toolName: HappyMcpCanonicalToolName): readonly string[];
|
|
3576
|
+
declare function normalizeHappyMcpToolName(toolName: string | null | undefined): HappyMcpCanonicalToolName | null;
|
|
3577
|
+
declare function isHappyMcpToolName(toolName: string | null | undefined): boolean;
|
|
3578
|
+
declare function isHappyMcpToolAlias(toolName: string | null | undefined, canonicalToolName: HappyMcpCanonicalToolName): boolean;
|
|
3579
|
+
declare function getHappyMcpToolTitle(toolName: string | null | undefined): string | null;
|
|
3580
|
+
declare function getHappyMcpToolAction(toolName: string | null | undefined, mode: HappyMcpToolActionMode): string | null;
|
|
3581
|
+
declare function shouldHideSuccessfulHappyMcpTool(toolName: string | null | undefined): boolean;
|
|
3582
|
+
declare function shouldAutoApproveHappyMcpToolName(toolName: string | null | undefined): boolean;
|
|
3583
|
+
declare function shouldAutoApproveHappyMcpReason(reason: string | null | undefined): boolean;
|
|
3584
|
+
|
|
3585
|
+
export { AGENT_MSG_PRIORITIES, AGENT_MSG_STATUSES, AGENT_MSG_TYPES, AIBackendProfileSchema, AcceptBodySchema, AgentLoopSummarySchema, AgentMessageSchema, AgentMessageSummarySchema, AgentMsgTypeSchema, AnthropicConfigSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, AutoDreamProfileSummarySchema, AutomationAuditEventSummarySchema, AutomationAuditStatsSchema, AutomationCountsSchema, AutomationGuardianSummarySchema, AutomationGuardianUsageSummarySchema, AutomationJobKindSchema, AutomationJobStatusSchema, AutomationJobSummarySchema, AutomationPrioritySchema, AutomationStateSchema, AutonomyStatsRecentActionSchema, AutonomyStatsSchema, AzureOpenAIConfigSchema, BUILT_IN_AI_BACKEND_PROFILE_IDS, BootstrapProfileSummarySchema, BriefMessageSchema, BuiltInAIBackendProfileIdSchema, CodexConfigSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, CreateSkillBodySchema, CreateTaskBodySchema, CrossProjectSearchResponseSchema, CrossProjectSearchResultSchema, CustomModelSchema, DaemonStateSchema, DefaultPermissionModeSchema, EVIDENCE_KINDS, EnvironmentVariableSchema, HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES, HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES, HAPPY_MCP_TOOL_NAMES, HAPPY_MCP_TOOL_SPECS, InboxCategorySchema, InboxItemSummarySchema, InboxNewItemSchema, InboxSeveritySchema, InboxUnreadCountSchema, KnowledgeActionSchema, KnowledgeChainEntrySchema, KnowledgeChainRelationSchema, KnowledgeChainResponseSchema, KnowledgeConfidenceSchema, KnowledgeContributorTypeSchema, KnowledgeEntryTypeSchema, KnowledgeInjectionModeSchema, KnowledgeInjectionRequestSchema, KnowledgeInjectionResponseSchema, KnowledgeStatusSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, OpenAIConfigSchema, ProfileCompatibilitySchema, ProjectProfileSchema, QueryKnowledgeParamsSchema, RESOLVED_RUNTIME_PROFILE_SCHEMA_VERSION, ResolvedRuntimeProfileSchema, RuntimeProfileSourceSchema, RuntimeProfileTrustSchema, SUGGESTION_ACCEPT_AUDIT_RULES, SUGGESTION_ACCEPT_SOURCES, SUGGESTION_AUTO_ACCEPT_FAILURE_DETAILS, SUGGESTION_AUTO_ACCEPT_REASON_CODES, SUGGESTION_AUTO_ACCEPT_STATUSES, SUGGESTION_BUCKETS, SUGGESTION_STATUSES, SUGGESTION_TYPES, SUPERVISOR_MODES, SessionEventCreatedSchema, SessionEventReportSchema, SessionEventSummarySchema, SessionEventTypeSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, SkillContentSchema, SkillSummarySchema, SuggestionAcceptAuditSchema, SuggestionDecisionPayloadSchema, SuggestionEvidenceSchema, SuggestionGoalPayloadSchema, SuggestionPayloadSchema, SuggestionSkillPayloadSchema, SuggestionTaskPayloadSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, TaskOutcomeSchema, TaskPrioritySchema, TaskStatusChangedSchema, TaskStatusReportSchema, TaskStatusSchema, TaskSummarySchema, TaskTriggerDataSchema, TaskTriggerTypeSchema, TmuxConfigSchema, TogetherAIConfigSchema, TunnelEntrySchema, TunnelProviderInfoSchema, TunnelStateSchema, TurnKnowledgeExtractionSchema, UpdateBodySchema, UpdateKnowledgeEntryBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UpdateSkillBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceTokenAllowedSchema, VoiceTokenDeniedSchema, VoiceTokenResponseSchema, WorldAutonomyPolicySchema, WorldSuggestionUpdatedSchema, createEnvelope, createResolvedRuntimeProfile, getHappyMcpToolAction, getHappyMcpToolAliases, getHappyMcpToolTitle, getProfileEnvironmentVariables, getSuggestionPayloadSchema, isHappyMcpToolAlias, isHappyMcpToolName, isTrustedRuntimeProfile, normalizeHappyMcpToolName, normalizeResolvedRuntimeProfile, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionProgressListSchema, sessionProgressStateSchema, sessionProgressTodoSchema, sessionProgressTodoStatusSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionSummaryStateSchema, sessionTaskEndEventSchema, sessionTaskLogEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextDeltaEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema, shouldAutoApproveHappyMcpReason, shouldAutoApproveHappyMcpToolName, shouldHideSuccessfulHappyMcpTool, terminalCloseRequestSchema, terminalExitPayloadSchema, terminalInputPayloadSchema, terminalOutputPayloadSchema, terminalResizeRequestSchema, terminalSpawnRequestSchema, terminalSpawnResponseSchema, validateProfileForAgent };
|
|
3586
|
+
export type { AIBackendProfile, AcceptBody, AgentLoopSummary, AgentMessage, AgentMessageSummary, AgentMsgPriority, AgentMsgStatus, AgentMsgType, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, AutoDreamProfileSummary, AutomationAuditEventSummary, AutomationAuditStats, AutomationCounts, AutomationGuardianSummary, AutomationGuardianUsageSummary, AutomationJobKind, AutomationJobStatus, AutomationJobSummary, AutomationPriority, AutomationState, AutonomyStats, BootstrapProfileSummary, BriefMessage, BuiltInAIBackendProfileId, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, CreateKnowledgeEntryBody, CreateSkillBody, CreateTaskBody, CrossProjectSearchResponse, CrossProjectSearchResult, DaemonState, HappyMcpCanonicalToolName, HappyMcpToolActionMode, InboxCategory, InboxItemSummary, InboxNewItem, InboxSeverity, InboxUnreadCount, KnowledgeAction, KnowledgeChainEntry, KnowledgeChainRelation, KnowledgeChainResponse, KnowledgeConfidence, KnowledgeContributorType, KnowledgeEntryType, KnowledgeInjectionMode, KnowledgeInjectionRequest, KnowledgeInjectionResponse, KnowledgeStatus, LegacyMessageContent, MachineMetadata, MessageContent, MessageMeta, ProjectProfile, QueryKnowledgeParams, ResolvedRuntimeProfile, RuntimeProfileSource, RuntimeProfileTrust, SessionContextUsageEvent, SessionEnvelope, SessionEvent, SessionEventCreated, SessionEventReport, SessionEventSummary, SessionEventType, SessionMessage, SessionMessageContent, SessionModelUsage, SessionProgressList, SessionProgressState, SessionProgressTodo, SessionProgressTodoStatus, SessionProtocolMessage, SessionRole, SessionSummaryState, SessionTurnEndStatus, SkillContent, SkillSummary, SuggestionAcceptAudit, SuggestionAcceptAuditRule, SuggestionAcceptSource, SuggestionAutoAcceptFailureDetail, SuggestionAutoAcceptReasonCode, SuggestionAutoAcceptStatus, SuggestionBucket, SuggestionDecisionPayload, SuggestionEvidence, SuggestionGoalPayload, SuggestionPayload, SuggestionSerialized, SuggestionSkillPayload, SuggestionStatus, SuggestionSummary, SuggestionTaskPayload, SuggestionType, SupervisorMode, TailscaleInfo, TailscaleServeEntry, TaskOutcome, TaskPriority, TaskStatus, TaskStatusChanged, TaskStatusReport, TaskSummary, TaskTriggerData, TaskTriggerType, TerminalCloseRequest, TerminalExitPayload, TerminalInputPayload, TerminalOutputPayload, TerminalResizeRequest, TerminalSpawnRequest, TerminalSpawnResponse, TunnelEntry, TunnelProviderInfo, TunnelState, TurnKnowledgeExtraction, Update, UpdateBody, UpdateKnowledgeEntryBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UpdateSkillBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue, VoiceTokenResponse, WorldAutonomyPolicy, WorldSuggestionUpdated };
|
package/dist/index.mjs
CHANGED
|
@@ -1535,4 +1535,167 @@ const sessionSummaryStateSchema = z.object({
|
|
|
1535
1535
|
updatedAt: z.number()
|
|
1536
1536
|
});
|
|
1537
1537
|
|
|
1538
|
-
|
|
1538
|
+
const HAPPY_MCP_TOOL_NAMES = [
|
|
1539
|
+
"change_title",
|
|
1540
|
+
"query_project_knowledge",
|
|
1541
|
+
"update_progress",
|
|
1542
|
+
"update_session_summary"
|
|
1543
|
+
];
|
|
1544
|
+
const HAPPY_MCP_TOOL_SPECS = {
|
|
1545
|
+
change_title: {
|
|
1546
|
+
title: "Change Title",
|
|
1547
|
+
description: 'Set or update the chat session title. Titles should be short (under 50 chars) and action-oriented, e.g. "Fix auth token refresh".',
|
|
1548
|
+
failureLabel: "Failed to change chat title",
|
|
1549
|
+
inputSchema: {
|
|
1550
|
+
title: z$1.string().describe("The new title for the chat session")
|
|
1551
|
+
},
|
|
1552
|
+
hideSuccessfulCall: true,
|
|
1553
|
+
autoApproveByDefault: true,
|
|
1554
|
+
permissionAction: "Waiting for approval to update chat title",
|
|
1555
|
+
dynamicAction: "Updating chat title",
|
|
1556
|
+
fallbackAction: "Update chat title",
|
|
1557
|
+
reasonPhrases: ["title update", "title updates", "change_title"]
|
|
1558
|
+
},
|
|
1559
|
+
query_project_knowledge: {
|
|
1560
|
+
title: "Project Knowledge",
|
|
1561
|
+
description: "Search the project knowledge base for relevant context, past decisions, known pitfalls, and conventions.",
|
|
1562
|
+
failureLabel: "Knowledge query failed",
|
|
1563
|
+
inputSchema: {
|
|
1564
|
+
query: z$1.string().describe("Search query describing what you want to know")
|
|
1565
|
+
},
|
|
1566
|
+
hideSuccessfulCall: false,
|
|
1567
|
+
autoApproveByDefault: false,
|
|
1568
|
+
permissionAction: "Waiting for approval to search project knowledge",
|
|
1569
|
+
dynamicAction: "Searching project knowledge",
|
|
1570
|
+
fallbackAction: "Search project knowledge",
|
|
1571
|
+
reasonPhrases: []
|
|
1572
|
+
},
|
|
1573
|
+
update_progress: {
|
|
1574
|
+
title: "Update Progress",
|
|
1575
|
+
description: 'Optional override for the App\'s Progress tab. In most cases your TodoWrite calls are auto-mirrored, so you do NOT need to call this. Use it only when you want to set extra fields the CLI hook does not capture (currentStage, blockers) or to force a new list boundary with `listId: "new"`.',
|
|
1576
|
+
failureLabel: "Failed to update progress",
|
|
1577
|
+
inputSchema: {
|
|
1578
|
+
todos: z$1.array(
|
|
1579
|
+
z$1.object({
|
|
1580
|
+
content: z$1.string().describe("Concise description of the task"),
|
|
1581
|
+
status: z$1.enum(["pending", "in_progress", "completed"]).describe("Current status of the task"),
|
|
1582
|
+
activeForm: z$1.string().optional().describe(
|
|
1583
|
+
"Imperative-present form shown when status is in_progress"
|
|
1584
|
+
),
|
|
1585
|
+
stage: z$1.string().optional().describe("Optional phase/stage label")
|
|
1586
|
+
})
|
|
1587
|
+
).describe("The full checklist \u2014 always send every item, not a delta"),
|
|
1588
|
+
currentStage: z$1.string().optional().describe("Optional overall stage name for the checklist"),
|
|
1589
|
+
blockers: z$1.array(z$1.string()).optional().describe("Optional list of things blocking progress"),
|
|
1590
|
+
listId: z$1.string().optional().describe("Target list id. Use 'new' to force a fresh list"),
|
|
1591
|
+
label: z$1.string().optional().describe("Short human-readable name for this task list")
|
|
1592
|
+
},
|
|
1593
|
+
hideSuccessfulCall: false,
|
|
1594
|
+
autoApproveByDefault: true,
|
|
1595
|
+
permissionAction: "Waiting for approval to update progress",
|
|
1596
|
+
dynamicAction: "Updating progress",
|
|
1597
|
+
fallbackAction: "Update progress",
|
|
1598
|
+
reasonPhrases: ["progress update", "progress updates", "update_progress"]
|
|
1599
|
+
},
|
|
1600
|
+
update_session_summary: {
|
|
1601
|
+
title: "Update Session Summary",
|
|
1602
|
+
description: "Write a narrative session summary the App shows above the progress checklist. Call at milestones, not per task: after first understanding the goal, when scope shifts significantly, when key decisions are made, or when moving to a new phase. Full rewrite each call.",
|
|
1603
|
+
failureLabel: "Failed to update session summary",
|
|
1604
|
+
inputSchema: {
|
|
1605
|
+
goal: z$1.string().describe("What the user ultimately wants to accomplish"),
|
|
1606
|
+
currentFocus: z$1.string().optional().describe("Brief description of the active task or phase"),
|
|
1607
|
+
keyDecisions: z$1.array(z$1.string()).optional().describe("Important choices already made this session"),
|
|
1608
|
+
openQuestions: z$1.array(z$1.string()).optional().describe("Unresolved questions or pending decisions"),
|
|
1609
|
+
impactScope: z$1.array(z$1.string()).optional().describe("Modules/files/areas affected by this session's work")
|
|
1610
|
+
},
|
|
1611
|
+
hideSuccessfulCall: false,
|
|
1612
|
+
autoApproveByDefault: true,
|
|
1613
|
+
permissionAction: "Waiting for approval to update session summary",
|
|
1614
|
+
dynamicAction: "Updating session summary",
|
|
1615
|
+
fallbackAction: "Update session summary",
|
|
1616
|
+
reasonPhrases: [
|
|
1617
|
+
"session summary",
|
|
1618
|
+
"update_session_summary",
|
|
1619
|
+
"summary update"
|
|
1620
|
+
]
|
|
1621
|
+
}
|
|
1622
|
+
};
|
|
1623
|
+
const HAPPY_MCP_TOOL_NAME_SET = new Set(HAPPY_MCP_TOOL_NAMES);
|
|
1624
|
+
const HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES = HAPPY_MCP_TOOL_NAMES.filter(
|
|
1625
|
+
(toolName) => HAPPY_MCP_TOOL_SPECS[toolName].autoApproveByDefault
|
|
1626
|
+
);
|
|
1627
|
+
const HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES = HAPPY_MCP_TOOL_NAMES.filter(
|
|
1628
|
+
(toolName) => HAPPY_MCP_TOOL_SPECS[toolName].hideSuccessfulCall
|
|
1629
|
+
);
|
|
1630
|
+
function getHappyMcpToolAliases(toolName) {
|
|
1631
|
+
return [
|
|
1632
|
+
toolName,
|
|
1633
|
+
`happy__${toolName}`,
|
|
1634
|
+
`mcp__happy__${toolName}`
|
|
1635
|
+
];
|
|
1636
|
+
}
|
|
1637
|
+
function normalizeHappyMcpToolName(toolName) {
|
|
1638
|
+
if (typeof toolName !== "string") {
|
|
1639
|
+
return null;
|
|
1640
|
+
}
|
|
1641
|
+
const trimmed = toolName.trim();
|
|
1642
|
+
if (!trimmed) {
|
|
1643
|
+
return null;
|
|
1644
|
+
}
|
|
1645
|
+
if (HAPPY_MCP_TOOL_NAME_SET.has(trimmed)) {
|
|
1646
|
+
return trimmed;
|
|
1647
|
+
}
|
|
1648
|
+
const withoutNamespace = trimmed.startsWith("mcp__happy__") ? trimmed.slice("mcp__happy__".length) : trimmed.startsWith("happy__") ? trimmed.slice("happy__".length) : null;
|
|
1649
|
+
if (withoutNamespace && HAPPY_MCP_TOOL_NAME_SET.has(withoutNamespace)) {
|
|
1650
|
+
return withoutNamespace;
|
|
1651
|
+
}
|
|
1652
|
+
return null;
|
|
1653
|
+
}
|
|
1654
|
+
function isHappyMcpToolName(toolName) {
|
|
1655
|
+
return normalizeHappyMcpToolName(toolName) !== null;
|
|
1656
|
+
}
|
|
1657
|
+
function isHappyMcpToolAlias(toolName, canonicalToolName) {
|
|
1658
|
+
return normalizeHappyMcpToolName(toolName) === canonicalToolName;
|
|
1659
|
+
}
|
|
1660
|
+
function getHappyMcpToolTitle(toolName) {
|
|
1661
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1662
|
+
return canonical ? HAPPY_MCP_TOOL_SPECS[canonical].title : null;
|
|
1663
|
+
}
|
|
1664
|
+
function getHappyMcpToolAction(toolName, mode) {
|
|
1665
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1666
|
+
if (!canonical) {
|
|
1667
|
+
return null;
|
|
1668
|
+
}
|
|
1669
|
+
const spec = HAPPY_MCP_TOOL_SPECS[canonical];
|
|
1670
|
+
if (mode === "permission") {
|
|
1671
|
+
return spec.permissionAction;
|
|
1672
|
+
}
|
|
1673
|
+
if (mode === "dynamic") {
|
|
1674
|
+
return spec.dynamicAction;
|
|
1675
|
+
}
|
|
1676
|
+
return spec.fallbackAction;
|
|
1677
|
+
}
|
|
1678
|
+
function shouldHideSuccessfulHappyMcpTool(toolName) {
|
|
1679
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1680
|
+
return canonical ? HAPPY_MCP_TOOL_SPECS[canonical].hideSuccessfulCall : false;
|
|
1681
|
+
}
|
|
1682
|
+
function shouldAutoApproveHappyMcpToolName(toolName) {
|
|
1683
|
+
const canonical = normalizeHappyMcpToolName(toolName);
|
|
1684
|
+
return canonical ? HAPPY_MCP_TOOL_SPECS[canonical].autoApproveByDefault : false;
|
|
1685
|
+
}
|
|
1686
|
+
function shouldAutoApproveHappyMcpReason(reason) {
|
|
1687
|
+
if (typeof reason !== "string") {
|
|
1688
|
+
return false;
|
|
1689
|
+
}
|
|
1690
|
+
const normalizedReason = reason.toLowerCase();
|
|
1691
|
+
if (!normalizedReason.includes("happy")) {
|
|
1692
|
+
return false;
|
|
1693
|
+
}
|
|
1694
|
+
return HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES.some(
|
|
1695
|
+
(toolName) => HAPPY_MCP_TOOL_SPECS[toolName].reasonPhrases.some(
|
|
1696
|
+
(phrase) => normalizedReason.includes(phrase)
|
|
1697
|
+
)
|
|
1698
|
+
);
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
export { AGENT_MSG_PRIORITIES, AGENT_MSG_STATUSES, AGENT_MSG_TYPES, AIBackendProfileSchema, AcceptBodySchema, AgentLoopSummarySchema, AgentMessageSchema, AgentMessageSummarySchema, AgentMsgTypeSchema, AnthropicConfigSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, AutoDreamProfileSummarySchema, AutomationAuditEventSummarySchema, AutomationAuditStatsSchema, AutomationCountsSchema, AutomationGuardianSummarySchema, AutomationGuardianUsageSummarySchema, AutomationJobKindSchema, AutomationJobStatusSchema, AutomationJobSummarySchema, AutomationPrioritySchema, AutomationStateSchema, AutonomyStatsRecentActionSchema, AutonomyStatsSchema, AzureOpenAIConfigSchema, BUILT_IN_AI_BACKEND_PROFILE_IDS, BootstrapProfileSummarySchema, BriefMessageSchema, BuiltInAIBackendProfileIdSchema, CodexConfigSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, CreateSkillBodySchema, CreateTaskBodySchema, CrossProjectSearchResponseSchema, CrossProjectSearchResultSchema, CustomModelSchema, DaemonStateSchema, DefaultPermissionModeSchema, EVIDENCE_KINDS, EnvironmentVariableSchema, HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES, HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES, HAPPY_MCP_TOOL_NAMES, HAPPY_MCP_TOOL_SPECS, InboxCategorySchema, InboxItemSummarySchema, InboxNewItemSchema, InboxSeveritySchema, InboxUnreadCountSchema, KnowledgeActionSchema, KnowledgeChainEntrySchema, KnowledgeChainRelationSchema, KnowledgeChainResponseSchema, KnowledgeConfidenceSchema, KnowledgeContributorTypeSchema, KnowledgeEntryTypeSchema, KnowledgeInjectionModeSchema, KnowledgeInjectionRequestSchema, KnowledgeInjectionResponseSchema, KnowledgeStatusSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, OpenAIConfigSchema, ProfileCompatibilitySchema, ProjectProfileSchema, QueryKnowledgeParamsSchema, RESOLVED_RUNTIME_PROFILE_SCHEMA_VERSION, ResolvedRuntimeProfileSchema, RuntimeProfileSourceSchema, RuntimeProfileTrustSchema, SUGGESTION_ACCEPT_AUDIT_RULES, SUGGESTION_ACCEPT_SOURCES, SUGGESTION_AUTO_ACCEPT_FAILURE_DETAILS, SUGGESTION_AUTO_ACCEPT_REASON_CODES, SUGGESTION_AUTO_ACCEPT_STATUSES, SUGGESTION_BUCKETS, SUGGESTION_STATUSES, SUGGESTION_TYPES, SUPERVISOR_MODES, SessionEventCreatedSchema, SessionEventReportSchema, SessionEventSummarySchema, SessionEventTypeSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, SkillContentSchema, SkillSummarySchema, SuggestionAcceptAuditSchema, SuggestionDecisionPayloadSchema, SuggestionEvidenceSchema, SuggestionGoalPayloadSchema, SuggestionPayloadSchema, SuggestionSkillPayloadSchema, SuggestionTaskPayloadSchema, TailscaleInfoSchema, TailscaleServeEntrySchema, TaskOutcomeSchema, TaskPrioritySchema, TaskStatusChangedSchema, TaskStatusReportSchema, TaskStatusSchema, TaskSummarySchema, TaskTriggerDataSchema, TaskTriggerTypeSchema, TmuxConfigSchema, TogetherAIConfigSchema, TunnelEntrySchema, TunnelProviderInfoSchema, TunnelStateSchema, TurnKnowledgeExtractionSchema, UpdateBodySchema, UpdateKnowledgeEntryBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UpdateSkillBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceTokenAllowedSchema, VoiceTokenDeniedSchema, VoiceTokenResponseSchema, WorldAutonomyPolicySchema, WorldSuggestionUpdatedSchema, createEnvelope, createResolvedRuntimeProfile, getHappyMcpToolAction, getHappyMcpToolAliases, getHappyMcpToolTitle, getProfileEnvironmentVariables, getSuggestionPayloadSchema, isHappyMcpToolAlias, isHappyMcpToolName, isTrustedRuntimeProfile, normalizeHappyMcpToolName, normalizeResolvedRuntimeProfile, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionProgressListSchema, sessionProgressStateSchema, sessionProgressTodoSchema, sessionProgressTodoStatusSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionSummaryStateSchema, sessionTaskEndEventSchema, sessionTaskLogEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextDeltaEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema, shouldAutoApproveHappyMcpReason, shouldAutoApproveHappyMcpToolName, shouldHideSuccessfulHappyMcpTool, terminalCloseRequestSchema, terminalExitPayloadSchema, terminalInputPayloadSchema, terminalOutputPayloadSchema, terminalResizeRequestSchema, terminalSpawnRequestSchema, terminalSpawnResponseSchema, validateProfileForAgent };
|