@burdenoff/microfe-timecampus 2026.1028.2 → 2026.1030.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageContext.d.ts","sourceRoot":"","sources":["../../src/utils/pageContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,UAAU,wBAAwB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,WAAW;IAG1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CAiB/C;AAMD,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,wBAAwB,
|
|
1
|
+
{"version":3,"file":"pageContext.d.ts","sourceRoot":"","sources":["../../src/utils/pageContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,UAAU,wBAAwB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,WAAW;IAG1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CAiB/C;AAMD,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,wBAAwB,CAyF1B"}
|
|
@@ -14,11 +14,17 @@ function t(e, t) {
|
|
|
14
14
|
return t.match(e);
|
|
15
15
|
}
|
|
16
16
|
function n(e, n) {
|
|
17
|
-
let r = new URLSearchParams(n);
|
|
17
|
+
let r = new URLSearchParams(n), i = t(/^\/?timecampus\/projects\/(?!new\/?$)([^/]+)(?:\/(tasks))?\/?$/, e);
|
|
18
|
+
if (i) return {
|
|
19
|
+
entityType: "TIMECAMPUS_PROJECT",
|
|
20
|
+
entityId: i[1],
|
|
21
|
+
...i[2] ? { activeTab: i[2] } : {},
|
|
22
|
+
projectId: i[1],
|
|
23
|
+
metadata: { routePattern: "timecampus/projects/:projectId" }
|
|
24
|
+
};
|
|
18
25
|
for (let [n, r] of [
|
|
19
|
-
[/^\/?timecampus\/time\/projects\/([^/]+)$/, "TIMECAMPUS_PROJECT"],
|
|
20
26
|
[/^\/?timecampus\/time\/tasks\/([^/]+)$/, "TIMECAMPUS_TASK"],
|
|
21
|
-
[/^\/?timecampus\/meetings\/([^/]+)$/, "TIMECAMPUS_MEETING"],
|
|
27
|
+
[/^\/?timecampus\/meetings\/(?!(?:new|analytics)$)([^/]+)$/, "TIMECAMPUS_MEETING"],
|
|
22
28
|
[/^\/?timecampus\/pomodoro\/sessions\/([^/]+)$/, "TIMECAMPUS_POMODORO_SESSION"],
|
|
23
29
|
[/^\/?timecampus\/lifetime\/goals\/([^/]+)$/, "TIMECAMPUS_LIFE_GOAL"],
|
|
24
30
|
[/^\/?timecampus\/resource-planning\/plans\/([^/]+)$/, "TIMECAMPUS_RESOURCE_PLAN"]
|
|
@@ -42,15 +48,15 @@ function n(e, n) {
|
|
|
42
48
|
entityType: r,
|
|
43
49
|
metadata: { routePattern: n.source }
|
|
44
50
|
};
|
|
45
|
-
let
|
|
51
|
+
let a = r.get("tab") ?? (() => {
|
|
46
52
|
let t = e.split("/").filter(Boolean);
|
|
47
53
|
return t.length > 2 ? t[t.length - 1] : void 0;
|
|
48
54
|
})();
|
|
49
55
|
return {
|
|
50
|
-
activeTab:
|
|
56
|
+
activeTab: a ?? void 0,
|
|
51
57
|
projectId: r.get("projectId") ?? void 0,
|
|
52
58
|
metadata: {
|
|
53
|
-
...
|
|
59
|
+
...a ? { activeTab: a } : {},
|
|
54
60
|
...r.get("projectId") ? { projectId: r.get("projectId") } : {},
|
|
55
61
|
...r.get("date") ? { date: r.get("date") } : {}
|
|
56
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context\n * to be sent alongside every assistant prompt for better AI awareness.\n *\n * Only emit keys the agent's ALLOWED_CONTEXT_KEYS allow-list actually\n * forwards (`~/products/wspace/sandbox/ai-assistant/src/context-loader.ts`):\n * currentUrl, currentPage, entityType, entityId, entityName, pageTitle,\n * pageType, activeTab, activeTool, selectedText, workspaceId, workspaceName,\n * projectId, projectName (+ legacy per-product back-compat keys). `platform`\n * and `version` are silently dropped server-side (the agent already knows\n * the product from `AI_ASSISTANT_PRODUCT` at boot), and `userAgent` is sent\n * over the wire but dropped agent-side — a needless fingerprinting leak for\n * a privacy-first product. None of the five are emitted here.\n */\n\ninterface ConversationContextShape {\n entityType?: string;\n entityId?: string;\n activeTab?: string;\n projectId?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface PageContext {\n // `currentUrl` (NOT `activeUrl`) — must match the agent's allowed-context-key\n // contract, otherwise the agent filters it out.\n currentUrl: string;\n currentPage: string;\n // The entity the user is currently looking at, resolved from the route. Lets\n // the assistant act on \"this / current / here\" without asking for an id.\n entityType?: string;\n entityId?: string;\n // Surfaced separately from `metadata` so the allow-listed `activeTab` /\n // `projectId` keys actually reach the agent instead of being discarded.\n activeTab?: string;\n projectId?: string;\n}\n\nexport function gatherPageContext(): PageContext {\n const url = window.location.href;\n const pathSegments = window.location.pathname.split(\"/\").filter(Boolean);\n const currentPage = pathSegments.slice(0, 3).join(\"/\") || \"home\";\n const entity = resolveTimeCampusConversationContext(\n window.location.pathname,\n window.location.search,\n );\n\n return {\n currentUrl: url,\n currentPage,\n entityType: entity.entityType,\n entityId: entity.entityId,\n activeTab: entity.activeTab,\n projectId: entity.projectId,\n };\n}\n\nfunction matchPath(pattern: RegExp, pathname: string): RegExpMatchArray | null {\n return pathname.match(pattern);\n}\n\nexport function resolveTimeCampusConversationContext(\n pathname: string,\n search: string,\n): ConversationContextShape {\n const params = new URLSearchParams(search);\n\n
|
|
1
|
+
{"version":3,"file":"pageContext.js","names":[],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering — captures the user's current browser context\n * to be sent alongside every assistant prompt for better AI awareness.\n *\n * Only emit keys the agent's ALLOWED_CONTEXT_KEYS allow-list actually\n * forwards (`~/products/wspace/sandbox/ai-assistant/src/context-loader.ts`):\n * currentUrl, currentPage, entityType, entityId, entityName, pageTitle,\n * pageType, activeTab, activeTool, selectedText, workspaceId, workspaceName,\n * projectId, projectName (+ legacy per-product back-compat keys). `platform`\n * and `version` are silently dropped server-side (the agent already knows\n * the product from `AI_ASSISTANT_PRODUCT` at boot), and `userAgent` is sent\n * over the wire but dropped agent-side — a needless fingerprinting leak for\n * a privacy-first product. None of the five are emitted here.\n */\n\ninterface ConversationContextShape {\n entityType?: string;\n entityId?: string;\n activeTab?: string;\n projectId?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface PageContext {\n // `currentUrl` (NOT `activeUrl`) — must match the agent's allowed-context-key\n // contract, otherwise the agent filters it out.\n currentUrl: string;\n currentPage: string;\n // The entity the user is currently looking at, resolved from the route. Lets\n // the assistant act on \"this / current / here\" without asking for an id.\n entityType?: string;\n entityId?: string;\n // Surfaced separately from `metadata` so the allow-listed `activeTab` /\n // `projectId` keys actually reach the agent instead of being discarded.\n activeTab?: string;\n projectId?: string;\n}\n\nexport function gatherPageContext(): PageContext {\n const url = window.location.href;\n const pathSegments = window.location.pathname.split(\"/\").filter(Boolean);\n const currentPage = pathSegments.slice(0, 3).join(\"/\") || \"home\";\n const entity = resolveTimeCampusConversationContext(\n window.location.pathname,\n window.location.search,\n );\n\n return {\n currentUrl: url,\n currentPage,\n entityType: entity.entityType,\n entityId: entity.entityId,\n activeTab: entity.activeTab,\n projectId: entity.projectId,\n };\n}\n\nfunction matchPath(pattern: RegExp, pathname: string): RegExpMatchArray | null {\n return pathname.match(pattern);\n}\n\nexport function resolveTimeCampusConversationContext(\n pathname: string,\n search: string,\n): ConversationContextShape {\n const params = new URLSearchParams(search);\n\n // A project page lives at `/timecampus/projects/:projectId` (and its task\n // board at `.../tasks`) per TimeCampusRoutes.tsx; `projects/new` is the\n // create form, not a project.\n const projectMatch = matchPath(\n /^\\/?timecampus\\/projects\\/(?!new\\/?$)([^/]+)(?:\\/(tasks))?\\/?$/,\n pathname,\n );\n if (projectMatch) {\n return {\n entityType: \"TIMECAMPUS_PROJECT\",\n entityId: projectMatch[1],\n ...(projectMatch[2] ? { activeTab: projectMatch[2] } : {}),\n projectId: projectMatch[1],\n metadata: { routePattern: \"timecampus/projects/:projectId\" },\n };\n }\n\n const directMatches: Array<[RegExp, string]> = [\n [/^\\/?timecampus\\/time\\/tasks\\/([^/]+)$/, \"TIMECAMPUS_TASK\"],\n // `meetings/new` and `meetings/analytics` are pages, not meetings.\n [\n /^\\/?timecampus\\/meetings\\/(?!(?:new|analytics)$)([^/]+)$/,\n \"TIMECAMPUS_MEETING\",\n ],\n [\n /^\\/?timecampus\\/pomodoro\\/sessions\\/([^/]+)$/,\n \"TIMECAMPUS_POMODORO_SESSION\",\n ],\n [/^\\/?timecampus\\/lifetime\\/goals\\/([^/]+)$/, \"TIMECAMPUS_LIFE_GOAL\"],\n [\n /^\\/?timecampus\\/resource-planning\\/plans\\/([^/]+)$/,\n \"TIMECAMPUS_RESOURCE_PLAN\",\n ],\n ];\n\n for (const [pattern, entityType] of directMatches) {\n const match = matchPath(pattern, pathname);\n if (match) {\n return {\n entityType,\n entityId: match[1],\n metadata: { routePattern: pattern.source },\n };\n }\n }\n\n // Page-level matches: these TimeCampus modules are flat list/dashboard\n // pages with no per-entity detail route (confirmed against\n // TimeCampusRoutes.tsx), so there is no id to capture — but the assistant\n // still benefits from knowing which module the user is looking at, so it\n // can scope \"show me my expenses\" / \"approve this\" style prompts without\n // asking which module the user means.\n const pageLevelMatches: Array<[RegExp, string]> = [\n [/^\\/?timecampus\\/timeline\\/?$/, \"TIMECAMPUS_TIMELINE\"],\n [/^\\/?timecampus\\/time\\/entries\\/?$/, \"TIMECAMPUS_TIME_ENTRY\"],\n [/^\\/?timecampus\\/expense-tracking\\/?$/, \"TIMECAMPUS_EXPENSE\"],\n [/^\\/?timecampus\\/invoicing\\/?$/, \"TIMECAMPUS_INVOICING\"],\n [/^\\/?timecampus\\/time-approval\\/?$/, \"TIMECAMPUS_APPROVAL\"],\n [/^\\/?timecampus\\/client-portal\\/?$/, \"TIMECAMPUS_CLIENT_PORTAL\"],\n [/^\\/?timecampus\\/application-usage\\/?$/, \"TIMECAMPUS_APP_USAGE\"],\n ];\n\n for (const [pattern, entityType] of pageLevelMatches) {\n if (matchPath(pattern, pathname)) {\n return { entityType, metadata: { routePattern: pattern.source } };\n }\n }\n\n const activeTab =\n params.get(\"tab\") ??\n (() => {\n const segments = pathname.split(\"/\").filter(Boolean);\n return segments.length > 2 ? segments[segments.length - 1] : undefined;\n })();\n\n return {\n activeTab: activeTab ?? undefined,\n projectId: params.get(\"projectId\") ?? undefined,\n metadata: {\n ...(activeTab ? { activeTab } : {}),\n ...(params.get(\"projectId\")\n ? { projectId: params.get(\"projectId\") }\n : {}),\n ...(params.get(\"date\") ? { date: params.get(\"date\") } : {}),\n },\n };\n}\n"],"mappings":";AAsCA,SAAgB,IAAiC;CAC/C,IAAM,IAAM,OAAO,SAAS,MAEtB,IADe,OAAO,SAAS,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAC5C,CAAA,CAAa,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,QACpD,IAAS,EACb,OAAO,SAAS,UAChB,OAAO,SAAS,MAClB;CAEA,OAAO;EACL,YAAY;EACZ;EACA,YAAY,EAAO;EACnB,UAAU,EAAO;EACjB,WAAW,EAAO;EAClB,WAAW,EAAO;CACpB;AACF;AAEA,SAAS,EAAU,GAAiB,GAA2C;CAC7E,OAAO,EAAS,MAAM,CAAO;AAC/B;AAEA,SAAgB,EACd,GACA,GAC0B;CAC1B,IAAM,IAAS,IAAI,gBAAgB,CAAM,GAKnC,IAAe,EACnB,kEACA,CACF;CACA,IAAI,GACF,OAAO;EACL,YAAY;EACZ,UAAU,EAAa;EACvB,GAAI,EAAa,KAAK,EAAE,WAAW,EAAa,GAAG,IAAI,CAAC;EACxD,WAAW,EAAa;EACxB,UAAU,EAAE,cAAc,iCAAiC;CAC7D;CAqBF,KAAK,IAAM,CAAC,GAAS,MAAe;EAjBlC,CAAC,yCAAyC,iBAAiB;EAE3D,CACE,4DACA,oBACF;EACA,CACE,gDACA,6BACF;EACA,CAAC,6CAA6C,sBAAsB;EACpE,CACE,sDACA,0BACF;CAGkC,GAAe;EACjD,IAAM,IAAQ,EAAU,GAAS,CAAQ;EACzC,IAAI,GACF,OAAO;GACL;GACA,UAAU,EAAM;GAChB,UAAU,EAAE,cAAc,EAAQ,OAAO;EAC3C;CAEJ;CAkBA,KAAK,IAAM,CAAC,GAAS,MAAe;EATlC,CAAC,gCAAgC,qBAAqB;EACtD,CAAC,qCAAqC,uBAAuB;EAC7D,CAAC,wCAAwC,oBAAoB;EAC7D,CAAC,iCAAiC,sBAAsB;EACxD,CAAC,qCAAqC,qBAAqB;EAC3D,CAAC,qCAAqC,0BAA0B;EAChE,CAAC,yCAAyC,sBAAsB;CAG9B,GAClC,IAAI,EAAU,GAAS,CAAQ,GAC7B,OAAO;EAAE;EAAY,UAAU,EAAE,cAAc,EAAQ,OAAO;CAAE;CAIpE,IAAM,IACJ,EAAO,IAAI,KAAK,YACT;EACL,IAAM,IAAW,EAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;EACnD,OAAO,EAAS,SAAS,IAAI,EAAS,EAAS,SAAS,KAAK,KAAA;CAC/D,EAAA,CAAG;CAEL,OAAO;EACL,WAAW,KAAa,KAAA;EACxB,WAAW,EAAO,IAAI,WAAW,KAAK,KAAA;EACtC,UAAU;GACR,GAAI,IAAY,EAAE,aAAU,IAAI,CAAC;GACjC,GAAI,EAAO,IAAI,WAAW,IACtB,EAAE,WAAW,EAAO,IAAI,WAAW,EAAE,IACrC,CAAC;GACL,GAAI,EAAO,IAAI,MAAM,IAAI,EAAE,MAAM,EAAO,IAAI,MAAM,EAAE,IAAI,CAAC;EAC3D;CACF;AACF"}
|
package/package.json
CHANGED