@noodleseed/one 0.96.3 → 0.97.0

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.
Files changed (106) hide show
  1. package/README.md +2 -1
  2. package/dist/commands/author-loop.d.ts.map +1 -1
  3. package/dist/commands/author-loop.js +7 -1
  4. package/dist/commands/author-loop.js.map +1 -1
  5. package/dist/commands/catalog-data-local-authoring.d.ts.map +1 -1
  6. package/dist/commands/catalog-data-local-authoring.js +2 -2
  7. package/dist/commands/catalog-data-local-authoring.js.map +1 -1
  8. package/dist/deploy.d.ts +5 -0
  9. package/dist/deploy.d.ts.map +1 -1
  10. package/dist/deploy.js +1 -1
  11. package/dist/deploy.js.map +1 -1
  12. package/dist/dev.d.ts +13 -0
  13. package/dist/dev.d.ts.map +1 -1
  14. package/dist/dev.js +116 -7
  15. package/dist/dev.js.map +1 -1
  16. package/dist/devtools-auth-routes.d.ts +4 -0
  17. package/dist/devtools-auth-routes.d.ts.map +1 -0
  18. package/dist/devtools-auth-routes.js +205 -0
  19. package/dist/devtools-auth-routes.js.map +1 -0
  20. package/dist/devtools-auth-session-helpers.d.ts +6 -0
  21. package/dist/devtools-auth-session-helpers.d.ts.map +1 -0
  22. package/dist/devtools-auth-session-helpers.js +19 -0
  23. package/dist/devtools-auth-session-helpers.js.map +1 -0
  24. package/dist/devtools-auth-session.d.ts +35 -0
  25. package/dist/devtools-auth-session.d.ts.map +1 -0
  26. package/dist/devtools-auth-session.js +433 -0
  27. package/dist/devtools-auth-session.js.map +1 -0
  28. package/dist/devtools-auth-types.d.ts +51 -0
  29. package/dist/devtools-auth-types.d.ts.map +1 -0
  30. package/dist/devtools-auth-types.js +16 -0
  31. package/dist/devtools-auth-types.js.map +1 -0
  32. package/dist/devtools-auth-ui.d.ts +6 -0
  33. package/dist/devtools-auth-ui.d.ts.map +1 -0
  34. package/dist/devtools-auth-ui.js +127 -0
  35. package/dist/devtools-auth-ui.js.map +1 -0
  36. package/dist/devtools-delegated-credential.d.ts +10 -0
  37. package/dist/devtools-delegated-credential.d.ts.map +1 -0
  38. package/dist/devtools-delegated-credential.js +32 -0
  39. package/dist/devtools-delegated-credential.js.map +1 -0
  40. package/dist/devtools-firebase-auth.d.ts +55 -0
  41. package/dist/devtools-firebase-auth.d.ts.map +1 -0
  42. package/dist/devtools-firebase-auth.js +237 -0
  43. package/dist/devtools-firebase-auth.js.map +1 -0
  44. package/dist/devtools-harness.d.ts +5 -0
  45. package/dist/devtools-harness.d.ts.map +1 -1
  46. package/dist/devtools-harness.js +60 -21
  47. package/dist/devtools-harness.js.map +1 -1
  48. package/dist/devtools-microsoft-auth.d.ts +42 -0
  49. package/dist/devtools-microsoft-auth.d.ts.map +1 -0
  50. package/dist/devtools-microsoft-auth.js +362 -0
  51. package/dist/devtools-microsoft-auth.js.map +1 -0
  52. package/dist/devtools-microsoft-errors.d.ts +7 -0
  53. package/dist/devtools-microsoft-errors.d.ts.map +1 -0
  54. package/dist/devtools-microsoft-errors.js +60 -0
  55. package/dist/devtools-microsoft-errors.js.map +1 -0
  56. package/dist/devtools-preview.d.ts +15 -13
  57. package/dist/devtools-preview.d.ts.map +1 -1
  58. package/dist/devtools-preview.js +101 -179
  59. package/dist/devtools-preview.js.map +1 -1
  60. package/dist/devtools-rpc-forwarder.d.ts +37 -0
  61. package/dist/devtools-rpc-forwarder.d.ts.map +1 -0
  62. package/dist/devtools-rpc-forwarder.js +251 -0
  63. package/dist/devtools-rpc-forwarder.js.map +1 -0
  64. package/dist/devtools-tool-safety.d.ts +20 -0
  65. package/dist/devtools-tool-safety.d.ts.map +1 -0
  66. package/dist/devtools-tool-safety.js +43 -0
  67. package/dist/devtools-tool-safety.js.map +1 -0
  68. package/dist/preview-session.d.ts.map +1 -1
  69. package/dist/preview-session.js +5 -0
  70. package/dist/preview-session.js.map +1 -1
  71. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  72. package/node_modules/@noodle-borg/auth/dist/index.d.ts +1 -0
  73. package/node_modules/@noodle-borg/auth/dist/index.d.ts.map +1 -1
  74. package/node_modules/@noodle-borg/auth/dist/index.js +1 -0
  75. package/node_modules/@noodle-borg/auth/dist/index.js.map +1 -1
  76. package/node_modules/@noodle-borg/auth/dist/mcp-oauth-client.d.ts +56 -0
  77. package/node_modules/@noodle-borg/auth/dist/mcp-oauth-client.d.ts.map +1 -0
  78. package/node_modules/@noodle-borg/auth/dist/mcp-oauth-client.js +367 -0
  79. package/node_modules/@noodle-borg/auth/dist/mcp-oauth-client.js.map +1 -0
  80. package/node_modules/@noodle-borg/service/dist/customer-verifier-boundaries.d.ts +13 -0
  81. package/node_modules/@noodle-borg/service/dist/customer-verifier-boundaries.d.ts.map +1 -0
  82. package/node_modules/@noodle-borg/service/dist/customer-verifier-boundaries.js +71 -0
  83. package/node_modules/@noodle-borg/service/dist/customer-verifier-boundaries.js.map +1 -0
  84. package/node_modules/@noodle-borg/service/dist/customer-verifier.d.ts +1 -1
  85. package/node_modules/@noodle-borg/service/dist/customer-verifier.d.ts.map +1 -1
  86. package/node_modules/@noodle-borg/service/dist/customer-verifier.js +43 -31
  87. package/node_modules/@noodle-borg/service/dist/customer-verifier.js.map +1 -1
  88. package/node_modules/@noodle-borg/service/dist/index.d.ts +3 -1
  89. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  90. package/node_modules/@noodle-borg/service/dist/index.js +1 -0
  91. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  92. package/node_modules/@noodle-borg/service/dist/local-devtools-delegated-credentials.d.ts +20 -0
  93. package/node_modules/@noodle-borg/service/dist/local-devtools-delegated-credentials.d.ts.map +1 -0
  94. package/node_modules/@noodle-borg/service/dist/local-devtools-delegated-credentials.js +107 -0
  95. package/node_modules/@noodle-borg/service/dist/local-devtools-delegated-credentials.js.map +1 -0
  96. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.d.ts +5 -0
  97. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.d.ts.map +1 -1
  98. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.js +48 -28
  99. package/node_modules/@noodle-borg/service/dist/oauth/microsoft.js.map +1 -1
  100. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts +13 -0
  101. package/node_modules/@noodle-borg/service/dist/serve-options.d.ts.map +1 -1
  102. package/node_modules/@noodle-borg/service/dist/serve.d.ts +3 -0
  103. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  104. package/node_modules/@noodle-borg/service/dist/serve.js +49 -18
  105. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  106. package/package.json +1 -1
@@ -0,0 +1,127 @@
1
+ /** Authenticated-preview UI. All OAuth credentials remain in the loopback process. */
2
+ export const DEVTOOLS_AUTH_STYLES = `
3
+ .auth-gate{
4
+ position:absolute;
5
+ inset:64px 0 0;
6
+ z-index:20;
7
+ display:none;
8
+ align-items:center;
9
+ justify-content:center;
10
+ padding:28px;
11
+ background:rgba(8,8,10,.88);
12
+ backdrop-filter:blur(18px);
13
+ }
14
+ .auth-locked .auth-gate{display:flex}
15
+ .auth-card{
16
+ display:flex;
17
+ width:min(440px,100%);
18
+ flex-direction:column;
19
+ align-items:center;
20
+ gap:12px;
21
+ padding:30px;
22
+ border:1px solid var(--nd-border);
23
+ border-radius:24px;
24
+ background:var(--nd-panel-solid);
25
+ text-align:center;
26
+ box-shadow:0 24px 80px rgba(0,0,0,.45);
27
+ }
28
+ .auth-card h3{margin:0;font-size:22px;font-weight:610;letter-spacing:-.03em}
29
+ .auth-card p{margin:0;color:var(--nd-muted);font-size:12.5px;line-height:1.6}
30
+ .auth-issuer{font-family:var(--nd-mono);color:#d4d4d8!important;word-break:break-all}
31
+ .auth-issuer[hidden]{display:none}
32
+ .auth-provider{
33
+ display:grid;
34
+ width:min(320px,100%);
35
+ gap:6px;
36
+ text-align:left;
37
+ }
38
+ .auth-provider[hidden]{display:none}
39
+ .auth-provider label{color:var(--nd-muted);font-size:10.5px}
40
+ .auth-provider select{
41
+ width:100%;
42
+ padding:9px 30px 9px 10px;
43
+ border:1px solid var(--nd-border);
44
+ border-radius:9px;
45
+ background:var(--nd-panel);
46
+ color:var(--nd-text);
47
+ font:11px var(--nd-mono);
48
+ }
49
+ .auth-provider select:disabled{cursor:wait;opacity:.7}
50
+ .auth-detail{min-height:16px;color:var(--nd-faint)!important;font-size:10.5px!important}
51
+ .auth-detail.err{color:var(--nd-error)!important}
52
+ .auth-card .btn{
53
+ min-width:164px;
54
+ display:inline-flex;
55
+ align-items:center;
56
+ justify-content:center;
57
+ gap:8px;
58
+ }
59
+ .auth-card .btn.is-loading::before{
60
+ width:12px;
61
+ height:12px;
62
+ border:2px solid currentColor;
63
+ border-right-color:transparent;
64
+ border-radius:50%;
65
+ content:"";
66
+ animation:auth-button-spin .7s linear infinite;
67
+ }
68
+ @keyframes auth-button-spin{to{transform:rotate(360deg)}}
69
+ @media (prefers-reduced-motion:reduce){
70
+ .auth-card .btn.is-loading::before{animation-duration:1.4s}
71
+ }
72
+ .auth-session{
73
+ display:none;
74
+ align-items:center;
75
+ gap:7px;
76
+ margin-left:auto;
77
+ color:var(--nd-muted);
78
+ font-size:10.5px;
79
+ }
80
+ .auth-session.on{display:flex}
81
+ .auth-session button{
82
+ padding:5px 8px;
83
+ border:0;
84
+ background:transparent;
85
+ color:var(--nd-faint);
86
+ font-size:10px;
87
+ cursor:pointer;
88
+ }
89
+ .auth-session button:hover{color:var(--nd-text)}
90
+ .auth-session .status-dot{width:6px;height:6px}
91
+ .auth-required .brand__url{display:none}
92
+ `;
93
+ export const DEVTOOLS_AUTH_GATE_HTML = '<div id="auth-gate" class="auth-gate" aria-live="polite">' +
94
+ '<div class="auth-card">' +
95
+ '<h3>Sign in to test</h3>' +
96
+ '<p>This MCP app requires a customer account. Your token stays in this local Devtools process.</p>' +
97
+ '<p id="auth-issuer" class="auth-issuer"></p>' +
98
+ '<div id="auth-provider" class="auth-provider" hidden>' +
99
+ '<label for="auth-issuer-choice">Identity provider</label>' +
100
+ '<select id="auth-issuer-choice"></select>' +
101
+ '</div>' +
102
+ '<button id="auth-sign-in" class="btn primary-action" type="button" disabled>Sign in</button>' +
103
+ '<p id="auth-detail" class="auth-detail"></p>' +
104
+ '</div></div>';
105
+ export const DEVTOOLS_AUTH_SESSION_HTML = '<div id="auth-session" class="auth-session">' +
106
+ '<span class="status-dot" aria-hidden="true"></span>' +
107
+ '<span id="auth-session-label">Signed in</span>' +
108
+ '<button id="auth-logout" type="button">Sign out</button>' +
109
+ '</div>';
110
+ // Plain browser script; it intentionally receives only safe `/auth/status` fields.
111
+ export const DEVTOOLS_AUTH_CLIENT_JS = [
112
+ 'var authGate=document.getElementById("auth-gate"); var authSignIn=document.getElementById("auth-sign-in"); var authIssuer=document.getElementById("auth-issuer"); var authProvider=document.getElementById("auth-provider"); var authIssuerChoice=document.getElementById("auth-issuer-choice"); var authDetail=document.getElementById("auth-detail");',
113
+ 'var authSessionView=document.getElementById("auth-session"); var authSessionLabel=document.getElementById("auth-session-label"); var authLogout=document.getElementById("auth-logout");',
114
+ 'var authWasSignedIn=false; var authStarting=false;',
115
+ 'function authRequest(path,options){ var init=options||{}; init.headers=hostHeaders(Boolean(init.body)); return fetch(path,init); }',
116
+ 'function authIssuerLabel(value){ try{ return new URL(value).host; }catch(e){ return value||""; } }',
117
+ 'function authMethodLabel(status){ return status&&status.method==="firebase"?"Firebase":status&&status.method==="microsoft"?"Microsoft":""; }',
118
+ 'function syncAuthIssuers(status){ var issuers=status&&Array.isArray(status.issuers)?status.issuers.filter(function(value){return typeof value==="string";}):[]; var current=authIssuerChoice.value; var options=Array.from(authIssuerChoice.options).map(function(option){return option.value;}); var changed=options.length!==issuers.length||options.some(function(value,index){return value!==issuers[index];}); if(changed){ while(authIssuerChoice.firstChild) authIssuerChoice.removeChild(authIssuerChoice.firstChild); issuers.forEach(function(issuer){ var option=document.createElement("option"); option.value=issuer; option.textContent=authIssuerLabel(issuer); authIssuerChoice.appendChild(option); }); } var statusOwnsChoice=status&&(status.state==="authorizing"||status.state==="signed_in"||status.state==="reauthorization_required"); var selected=statusOwnsChoice&&issuers.includes(status.issuer)?status.issuer:issuers.includes(current)?current:issuers.includes(status&&status.issuer)?status.issuer:issuers[0]||""; authIssuerChoice.value=selected; authProvider.hidden=issuers.length<2; authIssuer.hidden=issuers.length>1; authIssuer.textContent=authIssuerLabel((status&&status.issuer)||issuers[0]); }',
119
+ 'function paintAuthStatus(status){ var signedIn=status&&status.state==="signed_in"; var becameSignedIn=signedIn&&!authWasSignedIn; if(status&&status.state!=="signed_out"&&status.state!=="authorizing") authStarting=false; var authBusy=Boolean(authStarting||(status&&status.state==="authorizing")); authWasSignedIn=Boolean(signedIn); document.body.classList.toggle("auth-locked",!signedIn); authSessionView.classList.toggle("on",signedIn); syncAuthIssuers(status); var scopes=(status&&status.scopes)||[]; var signedInIssuer=authIssuerLabel(status&&status.issuer); var methodLabel=authMethodLabel(status); authSessionLabel.textContent=(signedInIssuer?"Signed in · "+signedInIssuer:"Signed in")+(scopes.length?" · "+scopes.join(" "):""); authDetail.className="auth-detail"+(status&&(status.state==="error"||status.state==="unsupported")?" err":""); var statusMessage=(status&&status.message)||""; authDetail.textContent=(status&&status.errorCode?status.errorCode+": ":"")+statusMessage||(status&&status.state==="authorizing"?"Finish signing in in the new window.":status&&status.state==="reauthorization_required"?"Additional permission is required. Sign in again.":""); authSignIn.disabled=Boolean(authBusy||(status&&!status.supported)); authIssuerChoice.disabled=authBusy; authSignIn.classList.toggle("is-loading",authBusy); authSignIn.setAttribute("aria-busy",authBusy?"true":"false"); authSignIn.textContent=authBusy?(status&&status.state==="authorizing"?"Waiting for sign-in…":"Starting sign-in…"):status&&status.state==="error"?"Try sign-in again":status&&status.state==="reauthorization_required"?"Continue sign-in":methodLabel?"Sign in with "+methodLabel:"Sign in"; if(becameSignedIn&&typeof refreshTools==="function") refreshTools(); }',
120
+ 'function refreshAuthStatus(){ return authRequest("/auth/status").then(function(r){return r.json();}).then(paintAuthStatus).catch(function(){ authDetail.className="auth-detail err"; authDetail.textContent="Could not reach the local Devtools auth host."; }); }',
121
+ 'authSignIn.addEventListener("click",function(){ if(authSignIn.disabled)return; if(authStarting)return; authStarting=true; var selectedIssuer=authIssuerChoice.value; var startPath="/auth/start"+(selectedIssuer?"?issuer="+encodeURIComponent(selectedIssuer):""); var popup=window.open("","noodle-devtools-auth","popup,width=540,height=720"); authSignIn.disabled=true; authIssuerChoice.disabled=true; authSignIn.classList.add("is-loading"); authSignIn.setAttribute("aria-busy","true"); authSignIn.textContent="Starting sign-in…"; authDetail.className="auth-detail"; authDetail.textContent="Starting sign-in…"; authRequest(startPath,{method:"POST"}).then(function(r){return r.json().then(function(j){return {ok:r.ok,body:j};});}).then(function(result){ if(!result.ok||!result.body.authorizationUrl) throw new Error((result.body.error&&result.body.error.message)||"Could not start sign-in"); if(popup) popup.location.href=result.body.authorizationUrl; else window.open(result.body.authorizationUrl,"_blank","noopener"); paintAuthStatus({state:"authorizing",supported:true,issuer:result.body.issuer,issuers:result.body.issuers||[],method:result.body.method,scopes:result.body.scopes||[]}); }).catch(function(error){ authStarting=false; if(popup) popup.close(); authSignIn.disabled=false; authIssuerChoice.disabled=false; authSignIn.classList.remove("is-loading"); authSignIn.setAttribute("aria-busy","false"); authSignIn.textContent="Sign in"; authDetail.className="auth-detail err"; authDetail.textContent=error&&error.message||"Could not start sign-in."; }); });',
122
+ 'authLogout.addEventListener("click",function(){ authRequest("/auth/logout",{method:"POST"}).then(refreshAuthStatus).catch(refreshAuthStatus); });',
123
+ 'window.addEventListener("message",function(ev){ var callbackUrl; try{callbackUrl=new URL(ev.origin);}catch(e){return;} var sameLoopbackPort=callbackUrl.protocol===window.location.protocol&&callbackUrl.port===window.location.port&&callbackUrl.hostname==="localhost"&&window.location.hostname==="127.0.0.1"; if((ev.origin!==window.location.origin&&!sameLoopbackPort)||!ev.data||ev.data.type!=="noodle:auth-complete") return; refreshAuthStatus(); });',
124
+ 'refreshAuthStatus();',
125
+ 'setInterval(refreshAuthStatus,2000);',
126
+ ].join('\n');
127
+ //# sourceMappingURL=devtools-auth-ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-auth-ui.js","sourceRoot":"","sources":["../src/devtools-auth-ui.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0FnC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAClC,2DAA2D;IAC3D,yBAAyB;IACzB,0BAA0B;IAC1B,mGAAmG;IACnG,8CAA8C;IAC9C,uDAAuD;IACvD,2DAA2D;IAC3D,2CAA2C;IAC3C,QAAQ;IACR,8FAA8F;IAC9F,8CAA8C;IAC9C,cAAc,CAAC;AAEjB,MAAM,CAAC,MAAM,0BAA0B,GACrC,8CAA8C;IAC9C,qDAAqD;IACrD,gDAAgD;IAChD,0DAA0D;IAC1D,QAAQ,CAAC;AAEX,mFAAmF;AACnF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,yVAAyV;IACzV,yLAAyL;IACzL,oDAAoD;IACpD,oIAAoI;IACpI,oGAAoG;IACpG,8IAA8I;IAC9I,+qCAA+qC;IAC/qC,6sDAA6sD;IAC7sD,oQAAoQ;IACpQ,uhDAAuhD;IACvhD,mJAAmJ;IACnJ,icAAic;IACjc,sBAAsB;IACtB,sCAAsC;CACvC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { McpOAuthTokens } from '@noodle-borg/auth';
2
+ import type { LocalDevtoolsDelegatedCredentialSink } from '@noodle-borg/service';
3
+ import { type DevtoolsCustomerAuth } from './devtools-auth-types.js';
4
+ export declare function storeDevtoolsDelegatedCredential(options: {
5
+ readonly auth: DevtoolsCustomerAuth;
6
+ readonly resource: string;
7
+ readonly tokens: McpOAuthTokens;
8
+ readonly sink: LocalDevtoolsDelegatedCredentialSink | undefined;
9
+ }): Promise<void>;
10
+ //# sourceMappingURL=devtools-delegated-credential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-delegated-credential.d.ts","sourceRoot":"","sources":["../src/devtools-delegated-credential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAExF,wBAAsB,gCAAgC,CAAC,OAAO,EAAE;IAC9D,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,oCAAoC,GAAG,SAAS,CAAC;CACjE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhB"}
@@ -0,0 +1,32 @@
1
+ import { decodeJwt } from 'jose';
2
+ import { DevtoolsAuthError } from './devtools-auth-types.js';
3
+ export async function storeDevtoolsDelegatedCredential(options) {
4
+ const provider = options.auth.kind === 'firebase' || options.auth.kind === 'microsoft'
5
+ ? options.auth.kind
6
+ : undefined;
7
+ if (provider === undefined || options.sink === undefined)
8
+ return;
9
+ if (options.tokens.refreshToken === undefined) {
10
+ options.sink.clearResource(options.resource);
11
+ return;
12
+ }
13
+ let subject;
14
+ try {
15
+ const claims = decodeJwt(options.tokens.accessToken);
16
+ subject = typeof claims.sub === 'string' ? claims.sub : undefined;
17
+ }
18
+ catch {
19
+ // The loopback verifier remains authoritative. Decoding here only selects the same subject-keyed
20
+ // broker slot; an unsigned/forged value cannot produce a verified MCP caller.
21
+ }
22
+ if (subject === undefined || subject.length === 0) {
23
+ throw new DevtoolsAuthError('delegated_credential_subject_missing', `${provider === 'firebase' ? 'Firebase' : 'Microsoft'} did not return a subject-bound identity token.`);
24
+ }
25
+ await options.sink.setCredential({
26
+ resource: options.resource,
27
+ provider,
28
+ subject,
29
+ refreshToken: options.tokens.refreshToken,
30
+ });
31
+ }
32
+ //# sourceMappingURL=devtools-delegated-credential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-delegated-credential.js","sourceRoot":"","sources":["../src/devtools-delegated-credential.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAA6B,MAAM,0BAA0B,CAAC;AAExF,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,OAKtD;IACC,MAAM,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW;QACnE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACnB,CAAC,CAAC,SAAS,CAAC;IAChB,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO;IACjE,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,OAAO;IACT,CAAC;IACD,IAAI,OAA2B,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACrD,OAAO,GAAG,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,iGAAiG;QACjG,8EAA8E;IAChF,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,iBAAiB,CACzB,sCAAsC,EACtC,GAAG,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,iDAAiD,CACvG,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;QAC/B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ;QACR,OAAO;QACP,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY;KAC1C,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { McpOAuthTokens } from '@noodle-borg/auth';
2
+ export interface DevtoolsFirebaseAuthConfig {
3
+ readonly kind: 'firebase';
4
+ readonly projectId: string;
5
+ /** Firebase Web API keys are public client configuration, not service credentials. */
6
+ readonly apiKey: string;
7
+ readonly authDomain?: string;
8
+ readonly appId?: string;
9
+ readonly tenantId?: string;
10
+ /** Optional customer-owned Firebase sign-in UI. It must form-post tokens to `redirect_uri`. */
11
+ readonly authorizeUrl?: string;
12
+ /** Opaque local-only revision used to clear credentials when verification configuration changes. */
13
+ readonly configurationKey?: string;
14
+ /** Test/self-host seam. Customer-owned authorization pages must otherwise use HTTPS. */
15
+ readonly allowInsecureLocalhost?: boolean;
16
+ }
17
+ export interface DevtoolsFirebasePendingAuthorization {
18
+ readonly authorizationUrl: string;
19
+ readonly state: string;
20
+ readonly expiresAt: number;
21
+ }
22
+ export interface DevtoolsFirebaseCallback {
23
+ readonly state: string;
24
+ readonly idToken?: string;
25
+ readonly refreshToken?: string;
26
+ readonly expiresIn?: number;
27
+ readonly error?: string;
28
+ }
29
+ export interface DevtoolsFirebaseAuthorizationPage {
30
+ readonly status: number;
31
+ readonly html: string;
32
+ }
33
+ export interface DevtoolsFirebaseDriver {
34
+ beginAuthorization(): DevtoolsFirebasePendingAuthorization;
35
+ completeAuthorization(pending: DevtoolsFirebasePendingAuthorization, callback: DevtoolsFirebaseCallback): Promise<McpOAuthTokens>;
36
+ refresh(current: McpOAuthTokens): Promise<McpOAuthTokens>;
37
+ renderAuthorizationPage(url: URL, pending: DevtoolsFirebasePendingAuthorization): DevtoolsFirebaseAuthorizationPage | undefined;
38
+ }
39
+ /** Local Firebase adapter. ID/refresh tokens never leave the loopback process after callback receipt. */
40
+ export declare class FirebaseDevtoolsAuthDriver implements DevtoolsFirebaseDriver {
41
+ #private;
42
+ constructor(options: {
43
+ readonly auth: DevtoolsFirebaseAuthConfig;
44
+ readonly resource: string;
45
+ readonly redirectUri: string;
46
+ readonly fetchFn?: typeof fetch;
47
+ readonly now?: () => number;
48
+ readonly stateFactory?: () => string;
49
+ });
50
+ beginAuthorization(): DevtoolsFirebasePendingAuthorization;
51
+ completeAuthorization(pending: DevtoolsFirebasePendingAuthorization, callback: DevtoolsFirebaseCallback): Promise<McpOAuthTokens>;
52
+ refresh(current: McpOAuthTokens): Promise<McpOAuthTokens>;
53
+ renderAuthorizationPage(url: URL, pending: DevtoolsFirebasePendingAuthorization): DevtoolsFirebaseAuthorizationPage | undefined;
54
+ }
55
+ //# sourceMappingURL=devtools-firebase-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-firebase-auth.d.ts","sourceRoot":"","sources":["../src/devtools-firebase-auth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOxD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sFAAsF;IACtF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,+FAA+F;IAC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Q,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;QAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;QAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;KACtC;IAUD,kBAAkB,IAAI,oCAAoC;IAuBpD,qBAAqB,CACzB,OAAO,EAAE,oCAAoC,EAC7C,QAAQ,EAAE,wBAAwB,GACjC,OAAO,CAAC,cAAc,CAAC;IAkBpB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAuC/D,uBAAuB,CACrB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,oCAAoC,GAC5C,iCAAiC,GAAG,SAAS;CAejD"}
@@ -0,0 +1,237 @@
1
+ import { randomBytes, timingSafeEqual } from 'node:crypto';
2
+ const FIREBASE_PENDING_TTL_MS = 10 * 60 * 1_000;
3
+ const FIREBASE_MAX_TOKEN_BYTES = 64 * 1_024;
4
+ const FIREBASE_MAX_RESPONSE_BYTES = 64 * 1_024;
5
+ const FIREBASE_REFRESH_URL = 'https://securetoken.googleapis.com/v1/token';
6
+ /** Local Firebase adapter. ID/refresh tokens never leave the loopback process after callback receipt. */
7
+ export class FirebaseDevtoolsAuthDriver {
8
+ #auth;
9
+ #resource;
10
+ #redirectUri;
11
+ #localAuthorizeUrl;
12
+ #fetchFn;
13
+ #now;
14
+ #stateFactory;
15
+ constructor(options) {
16
+ this.#auth = options.auth;
17
+ this.#resource = options.resource;
18
+ this.#redirectUri = options.redirectUri;
19
+ this.#localAuthorizeUrl = new URL('/auth/firebase/authorize', options.redirectUri).href;
20
+ this.#fetchFn = options.fetchFn ?? fetch;
21
+ this.#now = options.now ?? Date.now;
22
+ this.#stateFactory = options.stateFactory ?? (() => randomBytes(32).toString('base64url'));
23
+ }
24
+ beginAuthorization() {
25
+ const state = this.#stateFactory();
26
+ if (state.length < 16 || state.length > 256)
27
+ throw new Error('Could not create Firebase state');
28
+ const configuredAuthorizeUrl = this.#auth.authorizeUrl;
29
+ if (configuredAuthorizeUrl !== undefined) {
30
+ assertTrustedAuthorizeUrl(configuredAuthorizeUrl, this.#auth.allowInsecureLocalhost === true);
31
+ }
32
+ const authorizationUrl = new URL(configuredAuthorizeUrl ?? this.#localAuthorizeUrl);
33
+ authorizationUrl.searchParams.set('state', state);
34
+ authorizationUrl.searchParams.set('redirect_uri', this.#redirectUri);
35
+ authorizationUrl.searchParams.set('resource', this.#resource);
36
+ authorizationUrl.searchParams.set('provider', 'firebase');
37
+ authorizationUrl.searchParams.set('project_id', this.#auth.projectId);
38
+ if (this.#auth.tenantId !== undefined) {
39
+ authorizationUrl.searchParams.set('tenant_id', this.#auth.tenantId);
40
+ }
41
+ return {
42
+ authorizationUrl: authorizationUrl.href,
43
+ state,
44
+ expiresAt: this.#now() + FIREBASE_PENDING_TTL_MS,
45
+ };
46
+ }
47
+ async completeAuthorization(pending, callback) {
48
+ if (pending.expiresAt <= this.#now())
49
+ throw new Error('Firebase authorization request expired');
50
+ if (!constantTimeStringEqual(callback.state, pending.state)) {
51
+ throw new Error('Firebase callback does not match the active sign-in');
52
+ }
53
+ if (callback.error !== undefined)
54
+ throw new Error('Firebase sign-in was cancelled or denied');
55
+ const idToken = requireBoundedToken(callback.idToken, 'Firebase ID token');
56
+ const refreshToken = optionalBoundedToken(callback.refreshToken, 'Firebase refresh token');
57
+ const expiresIn = positiveExpiresIn(callback.expiresIn);
58
+ return {
59
+ accessToken: idToken,
60
+ ...(refreshToken === undefined ? {} : { refreshToken }),
61
+ tokenType: 'Bearer',
62
+ ...(expiresIn === undefined ? {} : { expiresAt: this.#now() + expiresIn * 1_000 }),
63
+ scope: [],
64
+ };
65
+ }
66
+ async refresh(current) {
67
+ const refreshToken = requireBoundedToken(current.refreshToken, 'Firebase refresh token');
68
+ const params = new URLSearchParams({
69
+ grant_type: 'refresh_token',
70
+ refresh_token: refreshToken,
71
+ });
72
+ const endpoint = new URL(FIREBASE_REFRESH_URL);
73
+ endpoint.searchParams.set('key', this.#auth.apiKey);
74
+ const response = await this.#fetchFn(endpoint.href, {
75
+ method: 'POST',
76
+ redirect: 'error',
77
+ headers: {
78
+ accept: 'application/json',
79
+ 'content-type': 'application/x-www-form-urlencoded',
80
+ 'user-agent': 'noodleseed-devtools/firebase',
81
+ },
82
+ body: params.toString(),
83
+ signal: AbortSignal.timeout(10_000),
84
+ });
85
+ const text = await boundedResponseText(response, FIREBASE_MAX_RESPONSE_BYTES);
86
+ if (!response.ok)
87
+ throw new Error(`Firebase refresh failed with status ${response.status}`);
88
+ const body = parseJsonRecord(text);
89
+ const idToken = requireBoundedToken(body.id_token, 'Firebase refresh ID token');
90
+ const rotatedRefresh = requireBoundedToken(body.refresh_token, 'Firebase rotated refresh token');
91
+ const expiresIn = positiveExpiresIn(typeof body.expires_in === 'string' ? Number(body.expires_in) : body.expires_in);
92
+ return {
93
+ accessToken: idToken,
94
+ refreshToken: rotatedRefresh,
95
+ tokenType: 'Bearer',
96
+ expiresAt: this.#now() + (expiresIn ?? 3_600) * 1_000,
97
+ scope: [],
98
+ };
99
+ }
100
+ renderAuthorizationPage(url, pending) {
101
+ if (this.#auth.authorizeUrl !== undefined)
102
+ return undefined;
103
+ const expected = new URL(this.#localAuthorizeUrl);
104
+ if (url.origin !== expected.origin || url.pathname !== expected.pathname)
105
+ return undefined;
106
+ const valid = pending.expiresAt > this.#now() &&
107
+ constantTimeStringEqual(url.searchParams.get('state') ?? '', pending.state) &&
108
+ url.searchParams.get('redirect_uri') === this.#redirectUri &&
109
+ url.searchParams.get('resource') === this.#resource &&
110
+ url.searchParams.get('provider') === 'firebase' &&
111
+ url.searchParams.get('project_id') === this.#auth.projectId;
112
+ return valid
113
+ ? { status: 200, html: renderFirebasePage(this.#auth, pending.state, this.#redirectUri) }
114
+ : { status: 400, html: renderFirebaseErrorPage() };
115
+ }
116
+ }
117
+ function renderFirebasePage(auth, state, redirectUri) {
118
+ const nonce = randomBytes(18).toString('base64url');
119
+ const config = {
120
+ apiKey: auth.apiKey,
121
+ authDomain: auth.authDomain ?? `${auth.projectId}.firebaseapp.com`,
122
+ projectId: auth.projectId,
123
+ ...(auth.appId === undefined ? {} : { appId: auth.appId }),
124
+ };
125
+ const authOrigin = firebaseAuthOrigin(config.authDomain);
126
+ const redirectOrigin = new URL(redirectUri).origin;
127
+ const contentSecurityPolicy = [
128
+ "default-src 'none'",
129
+ `script-src 'nonce-${nonce}' https://www.gstatic.com https://apis.google.com`,
130
+ `style-src 'nonce-${nonce}'`,
131
+ `connect-src https://identitytoolkit.googleapis.com https://securetoken.googleapis.com https://www.googleapis.com https://accounts.google.com ${authOrigin}`,
132
+ `frame-src ${authOrigin} https://accounts.google.com`,
133
+ `form-action ${redirectOrigin}`,
134
+ "base-uri 'none'",
135
+ "object-src 'none'",
136
+ ].join('; ');
137
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="robots" content="noindex"><meta http-equiv="Content-Security-Policy" content="${escapeHtml(contentSecurityPolicy)}"><title>Firebase sign-in · Noodle Seed Devtools</title><style nonce="${nonce}">${FIREBASE_PAGE_STYLES}</style></head><body><main><p class="eyebrow">Local Devtools</p><h1>Sign in to your app</h1><p id="status">Continue with the Firebase account you use for this app. The resulting token stays in this local process.</p><form id="firebase-form" method="post" action="${escapeHtml(redirectUri)}"><input type="hidden" name="state" value="${escapeHtml(state)}"><input type="hidden" id="id-token" name="id_token"><input type="hidden" id="refresh-token" name="refresh_token"><input type="hidden" id="expires-in" name="expires_in"><button id="firebase-sign-in" type="button">Continue with Google</button></form><p class="note">Using another Firebase sign-in method? Configure <code>authorizeUrl</code> with your app's existing auth UI.</p></main><script nonce="${nonce}" type="module">const firebaseConfig=${safeScriptJson(config)};const tenantId=${safeScriptJson(auth.tenantId ?? null)};const status=document.getElementById("status");const button=document.getElementById("firebase-sign-in");const form=document.getElementById("firebase-form");try{const [{initializeApp},{getAuth,GoogleAuthProvider,signInWithPopup}]=await Promise.all([import("https://www.gstatic.com/firebasejs/10.14.1/firebase-app.js"),import("https://www.gstatic.com/firebasejs/10.14.1/firebase-auth.js")]);const firebaseAuth=getAuth(initializeApp(firebaseConfig));if(tenantId)firebaseAuth.tenantId=tenantId;button.addEventListener("click",async()=>{button.disabled=true;button.textContent="Waiting for sign-in…";status.textContent="Finish signing in in the new window.";try{const credential=await signInWithPopup(firebaseAuth,new GoogleAuthProvider());document.getElementById("id-token").value=await credential.user.getIdToken();document.getElementById("refresh-token").value=credential.user.refreshToken||"";const result=await credential.user.getIdTokenResult();document.getElementById("expires-in").value=String(Math.max(1,Math.floor((Date.parse(result.expirationTime)-Date.now())/1000)));form.submit();}catch(error){status.textContent="Firebase sign-in failed. Please try again.";button.disabled=false;button.textContent="Continue with Google";}});}catch(error){status.textContent="Could not load Firebase sign-in. Check your network and Firebase Web configuration.";button.disabled=true;}</script></body></html>`;
138
+ }
139
+ function renderFirebaseErrorPage() {
140
+ return ('<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="robots" content="noindex"><title>Authorization expired</title><style>' +
141
+ FIREBASE_PAGE_STYLES +
142
+ '</style></head><body><main><h1>Authorization request expired</h1><p>Return to Devtools and start a fresh sign-in.</p></main></body></html>');
143
+ }
144
+ const FIREBASE_PAGE_STYLES = ':root{color-scheme:dark}*{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center;padding:24px;background:#09090b;color:#fafafa;font:14px system-ui,sans-serif}main{width:min(420px,100%);padding:30px;border:1px solid #27272a;border-radius:22px;background:#111113;box-shadow:0 24px 80px #0008}h1{margin:4px 0 10px;font-size:24px}p{color:#a1a1aa;line-height:1.6}.eyebrow{margin:0;color:#f97316;font-size:11px;text-transform:uppercase;letter-spacing:.14em}button{width:100%;margin-top:18px;padding:12px 16px;border:0;border-radius:999px;background:#fafafa;color:#09090b;font:600 14px system-ui;cursor:pointer}button:disabled{cursor:wait;opacity:.65}.note{margin:18px 0 0;padding-top:16px;border-top:1px solid #27272a;font-size:12px}code{color:#d4d4d8}';
145
+ function firebaseAuthOrigin(value) {
146
+ const url = new URL(value.includes('://') ? value : `https://${value}`);
147
+ if (url.protocol !== 'https:' ||
148
+ url.username !== '' ||
149
+ url.password !== '' ||
150
+ url.pathname !== '/' ||
151
+ url.search !== '' ||
152
+ url.hash !== '') {
153
+ throw new Error('Firebase authDomain must be an HTTPS origin or hostname');
154
+ }
155
+ return url.origin;
156
+ }
157
+ function assertTrustedAuthorizeUrl(value, allowInsecureLocalhost) {
158
+ const url = new URL(value);
159
+ if (url.protocol === 'https:')
160
+ return;
161
+ if (url.protocol === 'http:' && allowInsecureLocalhost && isLoopbackHostname(url.hostname))
162
+ return;
163
+ throw new Error('Firebase authorizeUrl must use HTTPS');
164
+ }
165
+ function isLoopbackHostname(hostname) {
166
+ return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '[::1]';
167
+ }
168
+ function requireBoundedToken(value, name) {
169
+ if (typeof value !== 'string' || value.length === 0)
170
+ throw new Error(`${name} is missing`);
171
+ if (Buffer.byteLength(value, 'utf8') > FIREBASE_MAX_TOKEN_BYTES) {
172
+ throw new Error(`${name} is too large`);
173
+ }
174
+ return value;
175
+ }
176
+ function optionalBoundedToken(value, name) {
177
+ return value === undefined || value === '' ? undefined : requireBoundedToken(value, name);
178
+ }
179
+ function positiveExpiresIn(value) {
180
+ if (value === undefined)
181
+ return undefined;
182
+ if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || value > 86_400) {
183
+ throw new Error('Firebase token lifetime is invalid');
184
+ }
185
+ return Math.floor(value);
186
+ }
187
+ async function boundedResponseText(response, maxBytes) {
188
+ const declared = Number(response.headers.get('content-length'));
189
+ if (Number.isFinite(declared) && declared > maxBytes)
190
+ throw new Error('Firebase response is too large');
191
+ if (response.body === null)
192
+ return '';
193
+ const reader = response.body.getReader();
194
+ const chunks = [];
195
+ let size = 0;
196
+ while (true) {
197
+ const next = await reader.read();
198
+ if (next.done)
199
+ break;
200
+ size += next.value.byteLength;
201
+ if (size > maxBytes) {
202
+ await reader.cancel();
203
+ throw new Error('Firebase response is too large');
204
+ }
205
+ chunks.push(next.value);
206
+ }
207
+ return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk))).toString('utf8');
208
+ }
209
+ function parseJsonRecord(value) {
210
+ try {
211
+ const parsed = JSON.parse(value);
212
+ if (typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)) {
213
+ return parsed;
214
+ }
215
+ }
216
+ catch {
217
+ // Fall through to a stable, credential-free error.
218
+ }
219
+ throw new Error('Firebase returned an invalid refresh response');
220
+ }
221
+ function constantTimeStringEqual(left, right) {
222
+ const leftBytes = Buffer.from(left);
223
+ const rightBytes = Buffer.from(right);
224
+ return leftBytes.length === rightBytes.length && timingSafeEqual(leftBytes, rightBytes);
225
+ }
226
+ function escapeHtml(value) {
227
+ return value
228
+ .replaceAll('&', '&amp;')
229
+ .replaceAll('<', '&lt;')
230
+ .replaceAll('>', '&gt;')
231
+ .replaceAll('"', '&quot;')
232
+ .replaceAll("'", '&#39;');
233
+ }
234
+ function safeScriptJson(value) {
235
+ return JSON.stringify(value).replaceAll('<', '\\u003c');
236
+ }
237
+ //# sourceMappingURL=devtools-firebase-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-firebase-auth.js","sourceRoot":"","sources":["../src/devtools-firebase-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG3D,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAChD,MAAM,wBAAwB,GAAG,EAAE,GAAG,KAAK,CAAC;AAC5C,MAAM,2BAA2B,GAAG,EAAE,GAAG,KAAK,CAAC;AAC/C,MAAM,oBAAoB,GAAG,6CAA6C,CAAC;AAkD3E,yGAAyG;AACzG,MAAM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declare function openAiShimScript(init: {
17
17
  readonly toolResponseMetadata?: unknown;
18
18
  readonly toolResult?: unknown;
19
19
  readonly theme?: 'light' | 'dark';
20
+ /** Route calls through the credential-owning parent rather than allowing the widget to call loopback. */
21
+ readonly hostMediated?: boolean;
20
22
  }): string;
21
23
  /** Insert the reset + shim into the widget document so they run before the (deferred) bridge module script. */
22
24
  export declare function wrapWidgetHtml(html: string, shimScript: string): string;
@@ -25,5 +27,8 @@ export declare function harnessHtml(options: {
25
27
  readonly mcpUrl: string;
26
28
  readonly theme: PreviewTheme;
27
29
  readonly device: PreviewDevice;
30
+ readonly rpcCapability?: string;
31
+ readonly secureWidgets?: boolean;
32
+ readonly authRequired?: boolean;
28
33
  }): string;
29
34
  //# sourceMappingURL=devtools-harness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"devtools-harness.d.ts","sourceRoot":"","sources":["../src/devtools-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1D,8FAA8F;AAC9F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGtF;AAgBD,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CACnC,GAAG,MAAM,CA8BT;AAUD,+GAA+G;AAC/G,wBAA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