@alexsun-top/opencode-chat-room 0.8.4 → 0.8.6
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/CHANGELOG.md +17 -3
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/cli.ts +20 -1
- package/dist/cli.js +3785 -1462
- package/package.json +19 -11
- package/packages/chat-room-channeld/README.md +16 -10
- package/packages/chat-room-channeld/src/delivery.ts +0 -4
- package/packages/chat-room-channeld/src/host.ts +48 -37
- package/packages/chat-room-channeld/src/inbound.ts +3 -6
- package/packages/chat-room-channeld/src/pg/database.ts +141 -49
- package/packages/chat-room-channeld/src/pg/sql.mjs +157 -142
- package/packages/chat-room-channeld/src/pg/sql.mts +175 -0
- package/packages/chat-room-channeld/src/pg/worker.mjs +148 -99
- package/packages/chat-room-channeld/src/pg/worker.mts +201 -0
- package/packages/chat-room-channeld/src/state-rows.ts +132 -0
- package/packages/chat-room-channeld/src/state.ts +129 -157
- package/plugin.ts +21 -5
- package/server/app.ts +9 -0
- package/server/assets/base.css +22 -2
- package/server/assets/chat/admin.js +17 -1
- package/server/assets/chat/announcements.js +79 -34
- package/server/assets/chat/attachments.js +3 -3
- package/server/assets/chat/clipboard.js +1 -1
- package/server/assets/chat/confirm-dialog.js +3 -0
- package/server/assets/chat/copy-action.js +1 -1
- package/server/assets/chat/create-room-dialog.js +7 -0
- package/server/assets/chat/diagram-viewer.js +4 -8
- package/server/assets/chat/doc-preview.js +71 -31
- package/server/assets/chat/editor.js +49 -10
- package/server/assets/chat/events.js +13 -6
- package/server/assets/chat/files.js +33 -27
- package/server/assets/chat/history-loader.js +31 -15
- package/server/assets/chat/integration-editor.js +27 -1
- package/server/assets/chat/integrations.js +108 -16
- package/server/assets/chat/join-requests.js +40 -2
- package/server/assets/chat/locales/de.js +5 -3
- package/server/assets/chat/locales/es.js +5 -3
- package/server/assets/chat/locales/fr.js +5 -3
- package/server/assets/chat/locales/it.js +5 -3
- package/server/assets/chat/locales/ja.js +5 -3
- package/server/assets/chat/locales/ko.js +5 -3
- package/server/assets/chat/markdown-footnotes.js +27 -15
- package/server/assets/chat/markdown.js +6 -12
- package/server/assets/chat/members.js +34 -22
- package/server/assets/chat/mentions.js +8 -5
- package/server/assets/chat/message-cache.js +9 -3
- package/server/assets/chat/message-polling.js +10 -4
- package/server/assets/chat/message-window.js +58 -1
- package/server/assets/chat/messages.js +90 -37
- package/server/assets/chat/office-preview.js +3 -3
- package/server/assets/chat/operator.js +624 -0
- package/server/assets/chat/palette.js +7 -10
- package/server/assets/chat/panels.js +42 -0
- package/server/assets/chat/questions.js +75 -58
- package/server/assets/chat/recall.js +14 -5
- package/server/assets/chat/receipts.js +63 -7
- package/server/assets/chat/refresh-timing.js +6 -0
- package/server/assets/chat/reminders.js +47 -13
- package/server/assets/chat/replies.js +39 -25
- package/server/assets/chat/resource-format.js +6 -3
- package/server/assets/chat/room-list.js +202 -3
- package/server/assets/chat/room-watcher.js +3 -1
- package/server/assets/chat/rooms.js +29 -7
- package/server/assets/chat/settings.js +37 -6
- package/server/assets/chat/shortcuts.js +3 -1
- package/server/assets/chat/side-pane.js +1 -1
- package/server/assets/chat/state.js +51 -18
- package/server/assets/chat/system-events.js +3 -2
- package/server/assets/chat/system-messages.js +15 -15
- package/server/assets/chat/tasks.js +37 -14
- package/server/assets/chat/window-controls.js +25 -15
- package/server/assets/code-highlight.css +0 -13
- package/server/assets/conversation.css +45 -5
- package/server/assets/doc-preview.css +9 -0
- package/server/assets/files.css +4 -0
- package/server/assets/monaco/integration-rules.js +1 -1
- package/server/assets/office/THIRD-PARTY-NOTICES.txt +23 -1
- package/server/assets/office/licenses/docx-preview-HEADER.txt +6 -0
- package/server/assets/office/licenses/echarts-LICENSE-d3.txt +27 -0
- package/server/assets/office/licenses/echarts-NOTICE.txt +5 -0
- package/server/assets/office/licenses/immediate-LICENSE.txt +20 -0
- package/server/assets/office/licenses/lie-LICENSE.txt +7 -0
- package/server/assets/office/licenses/pako-LICENSE.txt +21 -0
- package/server/assets/office/licenses/pako-ZLIB.txt +18 -0
- package/server/assets/office/licenses/setimmediate-LICENSE.txt +20 -0
- package/server/assets/responsive.css +12 -2
- package/server/assets/settings.css +3 -1
- package/server/assets/tasks.css +6 -1
- package/server/assets/window-controls.css +3 -1
- package/server/channels.ts +3 -2
- package/server/chat.html +7 -2
- package/server/inbox.ts +3 -1
- package/server/join-requests.ts +8 -1
- package/server/member-routes.ts +16 -2
- package/server/newrooms.ts +2 -13
- package/server/operator-auth.ts +21 -0
- package/server/operator-routes.ts +150 -0
- package/server/operator-state.ts +64 -0
- package/server/operator.css +139 -0
- package/server/room-owner.ts +17 -0
- package/server/routes/inbox.ts +15 -5
- package/server/routes/pages.ts +12 -2
- package/server/routes/room-actions.ts +4 -3
- package/server/sw.js +3 -1
- package/server/system.html +109 -0
- package/server/wake.ts +1 -1
- package/skills/chatroom/SKILL.md +9 -0
- package/src/README.md +1 -1
- package/src/acp/client.ts +254 -0
- package/src/acp/protocol.ts +300 -0
- package/src/acp/watch.ts +498 -0
- package/src/agent/agent-receipts.ts +98 -8
- package/src/center/center-client.ts +6 -1
- package/src/center/center-inbox.ts +54 -7
- package/src/center/center-wake.ts +57 -3
- package/src/center/forward-client.ts +48 -0
- package/src/center/mentions.ts +16 -3
- package/src/center/notification-delay.ts +139 -0
- package/src/center/queue.ts +3 -0
- package/src/config/file-config.ts +25 -0
- package/src/mcp/server.ts +389 -0
- package/src/protocol/config.ts +7 -0
- package/src/runtime/plugin-notifications.ts +43 -9
- package/src/runtime/v2-plugin.ts +14 -3
- package/src/runtime/v2-receiver.ts +10 -2
- package/src/runtime/watch.ts +5 -1
- package/src/state/pg-database.ts +133 -49
- package/src/state/pg-sql.mjs +157 -142
- package/src/state/pg-sql.mts +175 -0
- package/src/state/pg-worker.mjs +148 -99
- package/src/state/pg-worker.mts +201 -0
- package/src/state/receiver-state.ts +47 -0
- package/src/state/sqlite-database.ts +6 -2
- package/src/state/sqlite-members.ts +48 -4
- package/src/state/sqlite-messages.ts +25 -12
- package/src/state/sqlite-schema.ts +4 -1
- package/src/state/sqlite-state.ts +1 -1
- package/src/state/store.ts +31 -11
- package/src/tui/app-types.mjs +1 -0
- package/src/tui/app-types.mts +175 -0
- package/src/tui/app.mjs +473 -423
- package/src/tui/app.mts +543 -0
- package/src/tui/config.mjs +166 -158
- package/src/tui/config.mts +247 -0
- package/src/tui/http.mjs +239 -206
- package/src/tui/http.mts +412 -0
- package/src/tui/i18n.mjs +17 -20
- package/src/tui/i18n.mts +42 -0
- package/src/tui/info-app.mjs +431 -427
- package/src/tui/info-app.mts +500 -0
- package/src/tui/info-content.mjs +205 -199
- package/src/tui/info-content.mts +341 -0
- package/src/tui/join-app.mjs +75 -64
- package/src/tui/join-app.mts +99 -0
- package/src/tui/locales/en.mjs +302 -320
- package/src/tui/locales/en.mts +349 -0
- package/src/tui/locales/zh-CN.mjs +302 -320
- package/src/tui/locales/zh-CN.mts +349 -0
- package/src/tui/main.mjs +219 -213
- package/src/tui/main.mts +255 -0
- package/src/tui/markdown.mjs +128 -272
- package/src/tui/markdown.mts +152 -0
- package/src/tui/mentions.mjs +181 -184
- package/src/tui/mentions.mts +251 -0
- package/src/tui/message-app.mjs +181 -173
- package/src/tui/message-app.mts +213 -0
- package/src/tui/message-view.mjs +90 -111
- package/src/tui/message-view.mts +151 -0
- package/src/tui/messages.mjs +55 -49
- package/src/tui/messages.mts +106 -0
- package/src/tui/palette-app.mjs +364 -344
- package/src/tui/palette-app.mts +388 -0
- package/src/tui/palette.mjs +100 -98
- package/src/tui/palette.mts +176 -0
- package/src/tui/prefs.mjs +56 -63
- package/src/tui/prefs.mts +126 -0
- package/src/tui/reminder-app.mjs +191 -181
- package/src/tui/reminder-app.mts +228 -0
- package/src/tui/room-settings-app.mjs +275 -242
- package/src/tui/room-settings-app.mts +318 -0
- package/src/tui/session.mjs +30 -29
- package/src/tui/session.mts +51 -0
- package/src/tui/settings-app.mjs +151 -138
- package/src/tui/settings-app.mts +179 -0
- package/src/tui/ui-content.mjs +426 -421
- package/src/tui/ui-content.mts +499 -0
- package/src/tui/ui-help.mjs +58 -67
- package/src/tui/ui-help.mts +87 -0
- package/src/tui/ui-mentions.mjs +34 -36
- package/src/tui/ui-mentions.mts +60 -0
- package/src/tui/ui-overlay-view.mjs +259 -267
- package/src/tui/ui-overlay-view.mts +322 -0
- package/src/tui/ui-suggest-view.mjs +54 -57
- package/src/tui/ui-suggest-view.mts +78 -0
- package/src/tui/ui-suggest.mjs +164 -167
- package/src/tui/ui-suggest.mts +248 -0
- package/src/tui/ui-theme.mjs +52 -57
- package/src/tui/ui-theme.mts +98 -0
- package/src/tui/ui-view.mjs +267 -275
- package/src/tui/ui-view.mts +308 -0
- package/src/tui/ui.mjs +372 -359
- package/src/tui/ui.mts +440 -0
- package/src/tui/wire.mjs +215 -0
- package/src/tui/wire.mts +383 -0
- package/src/web/integration-rules-editor.ts +25 -2
|
@@ -1602,4 +1602,4 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
1602
1602
|
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let i="end"in t.value?t.value.end:void 0;if((Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment")i?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){C$(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",o=[];if(n&&t.sep&&!t.value){let s=[];for(let r=0;r<t.sep.length;++r){let a=t.sep[r];switch(a.type){case"newline":s.push(r);break;case"space":break;case"comment":if(a.indent>e.indent)s.length=0;break;default:s.length=0}}if(s.length>=2)o=t.sep.splice(s[1])}switch(this.type){case"anchor":case"tag":if(n||t.value)o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(n||t.value)o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(gy(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let s=ZT(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gy(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Oqe(t.key)&&!gy(t.sep,"newline")){let s=ZT(t.start),{key:r,sep:a}=t;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:r,sep:a}]})}else if(o.length>0)t.sep=t.sep.concat(o,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||n)e.items.push({start:o,key:null,sep:[this.sourceToken]});else if(gy(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);if(n||t.value)e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(s);else Object.assign(t,{key:s,sep:[]}),this.onKeyLine=!0;return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!t.explicitKey&&t.sep&&!gy(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(i)e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let i="end"in t.value?t.value.end:void 0;if((Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment")i?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){C$(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||gy(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:n,sep:[]});else if(t.sep)this.stack.push(n);else Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);if(i)this.stack.push(i);else yield*this.pop(),yield*this.step()}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=w$(i),o=ZT(n);Mqe(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
1603
1603
|
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
1604
1604
|
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=w$(e),i=ZT(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=w$(e),i=ZT(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((i)=>i.type==="newline"||i.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}function N_t(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new v$||null,prettyErrors:t}}function XT(e,t={}){let{lineCounter:i,prettyErrors:n}=N_t(t),o=new y$(i?.addNewLine),s=new g$(t),r=null;for(let a of s.compose(o.parse(e),!0,e.length))if(!r)r=a;else if(r.options.logLevel!=="silent"){r.errors.push(new Op(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(n&&i)r.errors.forEach(pue(e,i)),r.warnings.forEach(pue(e,i));return r}function Tue(e,t,i){let n=null;if(typeof t==="function"||Array.isArray(t))n=t;else if(i===void 0&&t)i=t;if(typeof i==="string")i=i.length;if(typeof i==="number"){let o=Math.round(i);i=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){let{keepUndefined:o}=i??t??{};if(!o)return}if(Mm(e)&&!n)return e.toString(i);return new iv(e,n,i).toString(i)}var Fqe=(e)=>Boolean(e)&&typeof e==="object"&&!Array.isArray(e),Bqe=(e)=>({type:"string",enum:e.map((t)=>t.id),errorMessage:e.length?"Account does not exist. Add it under Accounts first.":"Add an account under Accounts first."}),Wqe=(e)=>({type:"string",enum:[...new Set(e.map((t)=>t.platform))],errorMessage:"Use the platform of the selected account."});function A_t(e){return{type:"object",additionalProperties:!1,required:["platform","account","room"],properties:{platform:Wqe(e),account:Bqe(e),room:{type:"string",minLength:1,description:"Target room ID."}},allOf:e.map((t)=>({if:{required:["account"],properties:{account:{const:t.id}}},then:{properties:{platform:{const:t.platform,errorMessage:`Account "${t.id}" uses platform "${t.platform}".`}}}}))}}var M_t={anyOf:[{type:"object",additionalProperties:!1,required:["op"],properties:{op:{const:"prefix-source"}}},{type:"object",additionalProperties:!1,required:["op"],properties:{op:{const:"trim"}}},{type:"object",additionalProperties:!1,required:["op"],properties:{op:{const:"quote-preview"}}},{type:"object",additionalProperties:!1,required:["op","max"],properties:{op:{const:"truncate"},max:{type:"integer",minimum:1}}}]};function Due(e){return{$schema:"http://json-schema.org/draft-07/schema#",title:"Integration rules",type:"array",items:{type:"object",additionalProperties:!1,required:["id","version","from","to"],properties:{id:{type:"string",minLength:1,description:"Rule name, unique with its version."},version:{type:"integer",minimum:1,description:"Bump the version to replace this rule."},from:{type:"object",description:"Where the rule reads events from.",additionalProperties:!1,required:["platform","account","room"],properties:{platform:{const:"chatroom",description:"Source platform; room messages always use chatroom.",errorMessage:"The source platform must be chatroom."},account:{const:"center",description:"Source account; room messages always use center.",errorMessage:"The source account must be center."},room:{type:"string",minLength:1,description:"Room ID to watch."},event:{enum:["message.created","message.forward_requested"],description:"Event to match; all supported events when omitted."}}},transforms:{type:"array",description:"Transformations applied to the message before delivery.",items:M_t},to:{type:"array",description:"External accounts and rooms that receive matching messages.",minItems:1,items:A_t(e)},onMissingParent:{enum:["quote_or_unthreaded","drop"],description:"What to do when the replied-to parent message is unavailable on the target."},onUnsupported:{enum:["text_with_notice","drop"],description:"What to do when the target cannot render the message content."}}}}}function Nue(e){return{$schema:"http://json-schema.org/draft-07/schema#",title:"Inbound routes",type:"array",items:{type:"object",required:["from","to"],properties:{from:{type:"object",required:["platform","account","room"],properties:{platform:Wqe(e),account:Bqe(e),room:{type:"string",minLength:1,description:"Room ID on the external platform."},event:{type:"string",description:"Optional external event filter."}},allOf:e.map((t)=>({if:{required:["account"],properties:{account:{const:t.id}}},then:{properties:{platform:{const:t.platform,errorMessage:`Account "${t.id}" uses platform "${t.platform}".`}}}}))},to:{type:"object",required:["room"],properties:{room:{type:"string",minLength:1,description:"Chat room ID that receives the message."}}}}}}}function O_t(e,t){switch(t){case void 0:return!0;case"object":return Fqe(e);case"array":return Array.isArray(e);case"string":return typeof e==="string";case"integer":return typeof e==="number"&&Number.isInteger(e);case"number":return typeof e==="number"&&Number.isFinite(e);case"boolean":return typeof e==="boolean"}}function Pqe(e,t){return Object.is(e,t)}function py(e,t,i=[],n=[]){let o=(s,r,a=i)=>{n.push({path:a,message:t.errorMessage||s,keyword:r})};if(!O_t(e,t.type))return o(`Expected ${t.type??"a supported value"}.`,"type"),n;if(t.const!==void 0&&!Pqe(e,t.const))o(`Must be ${JSON.stringify(t.const)}.`,"const");if(t.enum&&!t.enum.some((s)=>Pqe(s,e)))o(`Must be one of: ${t.enum.map((s)=>JSON.stringify(s)).join(", ")}.`,"enum");if(typeof e==="string"&&t.minLength!==void 0&&e.length<t.minLength)o("Must not be empty.","minLength");if(typeof e==="number"&&t.minimum!==void 0&&e<t.minimum)o(`Must be at least ${t.minimum}.`,"minimum");if(Array.isArray(e)){if(t.minItems!==void 0&&e.length<t.minItems)o(`Add at least ${t.minItems} item.`,"minItems");if(t.items)e.forEach((s,r)=>py(s,t.items,[...i,r],n))}if(Fqe(e)){for(let s of t.required??[])if(!Object.hasOwn(e,s))o(`Missing required field "${s}".`,"required",[...i,s]);for(let[s,r]of Object.entries(e)){let a=t.properties?.[s];if(a)py(r,a,[...i,s],n);else if(t.additionalProperties===!1)o(`Unknown field "${s}".`,"additionalProperties",[...i,s])}}for(let s of t.allOf??[])py(e,s,i,n);if(t.if&&t.then&&py(e,t.if,i,[]).length===0)py(e,t.then,i,n);for(let s of["anyOf","oneOf"]){let r=t[s];if(!r?.length)continue;let a=r.map((c)=>py(e,c,i,[])),l=a.filter((c)=>c.length===0).length;if(s==="anyOf"?l===0:l!==1)if(s==="oneOf"&&l>1)o("Matches more than one allowed shape.",s);else{let c=a.filter((d)=>d.length>0).sort((d,h)=>d.length-h.length)[0];if(c)n.push(...c);else o("Does not match any allowed shape.",s)}}return n}function Hqe(e,t){let i=e;for(let n of t)i+=typeof n==="number"?`[${n}]`:`.${n}`;return i}var TP=new Map,Vqe=!1,zqe=!1,Rue=null,Uqe=null,P_t=0,F_t=globalThis;F_t.MonacoEnvironment={getWorker(e,t){return new Worker(`/assets/monaco/${t==="json"?"json":"editor"}.worker.js`)}};function Pue(){let e=document.documentElement.dataset.theme;if(e==="custom")return document.documentElement.dataset.customDark==="true";if(e==="dark")return!0;return e!=="light"&&e!=="forest"&&e!=="sand"&&matchMedia("(prefers-color-scheme: dark)").matches}function Aue(){let e=(t,i)=>{let n=document.createElement("span");n.style.position="absolute",n.style.visibility="hidden",n.style.background=`var(${t})`,document.documentElement.append(n);let o=getComputedStyle(n).backgroundColor;n.remove();let s=document.createElement("canvas").getContext("2d");if(!s||!o)return i;return s.fillStyle="#000000",s.fillStyle=o,/^#[0-9a-f]{6}$/i.test(s.fillStyle)?s.fillStyle:i};Us.defineTheme("chatroom-light",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":e("--surface","#fffefa"),"editorGutter.background":e("--surface","#fffefa"),"editor.lineHighlightBackground":e("--surface-2","#f2f0e8"),"editorLineNumber.foreground":e("--ink-3","#63716b"),"menu.background":e("--surface","#fffefa"),"menu.foreground":e("--ink","#1e2c29"),"menu.selectionBackground":e("--surface-2","#f2f0e8"),"menu.selectionForeground":e("--ink","#1e2c29"),"menu.border":e("--line","#dcded4"),"editorWidget.background":e("--surface","#fffefa"),"editorWidget.foreground":e("--ink","#1e2c29"),"editorWidget.border":e("--line","#dcded4")}}),Us.defineTheme("chatroom-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":e("--surface","#182522"),"menu.background":e("--surface","#182522"),"menu.foreground":e("--ink","#e6efe9"),"menu.selectionBackground":e("--surface-2","#22322e"),"menu.selectionForeground":e("--ink","#e6efe9"),"menu.border":e("--line","#31433d"),"editorWidget.background":e("--surface","#182522"),"editorWidget.foreground":e("--ink","#e6efe9"),"editorWidget.border":e("--line","#31433d")}}),Us.setTheme(Pue()?"chatroom-dark":"chatroom-light")}function jqe(){if(Aue(),Rue)return;Rue=new MutationObserver(Aue),Rue.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-custom-dark"]}),Uqe=matchMedia("(prefers-color-scheme: dark)"),Uqe.addEventListener("change",Aue)}function Mue(){Qhe.setDiagnosticsOptions({validate:!1,allowComments:!1,enableSchemaRequest:!1,schemas:[...TP.values()].map((e)=>({uri:e.uri,fileMatch:[`*integration-${e.kind}*`],schema:e.schema}))})}function S$(e,t,i){let n=e;for(let o of t){if(!n)return;if(typeof o==="number")n=n.items;else n=n.properties?.[o]}return i?n?.properties?.[i]:n}function Gqe(e,t){let i=e;for(let n of t){if(!i)return i;if(typeof n==="number"){if(!xh(i))return i;i=i.items[n]}else{if(!kd(i))return i;let o=i.items.find((s)=>ji(s.key)&&s.key.value===n);if(!o)return i;i=o.value}}return i}function x$(e,t,i=[]){let n=e?.range;if(!Array.isArray(n)||t<n[0]||t>n[2])return null;if(xh(e))for(let o=0;o<e.items.length;o++){let s=x$(e.items[o],t,[...i,o]);if(s)return s}else if(kd(e))for(let o of e.items){if(!ji(o.key)||typeof o.key.value!=="string")continue;let s=x$(o.value,t,[...i,o.key.value]);if(s)return s}return i}function B_t(e,t,i){let n=e.const!==void 0?[e.const]:e.enum;if(!n)return[];let o=t.getWordUntilPosition(i),s=ux.fromPositions(new QA(i.lineNumber,o.startColumn),new QA(i.lineNumber,o.endColumn));return n.map((r)=>({label:String(r),kind:Lt.CompletionItemKind.Value,insertText:String(r),range:s,detail:e.description}))}function W_t(){if(Vqe)return;Vqe=!0,Lt.registerCompletionItemProvider("yaml",{triggerCharacters:[":"," ","-"],provideCompletionItems(e,t){let i=[...TP.values()].find((g)=>g.modelUri===e.uri.toString());if(!i)return{suggestions:[]};let n;try{n=XT(e.getValue())}catch{return{suggestions:[]}}let o=n.contents,s=e.getOffsetAt(t),r=x$(o,s)??[],a=e.getLineContent(t.lineNumber).slice(0,t.column-1),l=/^\s*(?:-\s*)?["']?([A-Za-z0-9_.-]+)["']?\s*:\s*(.*)$/.exec(a);if(l){let g=l[1],_=r[r.length-1]===g?r.slice(0,-1):r,b=S$(i.schema,_,g);return{suggestions:b?B_t(b,e,t):[]}}let d=S$(i.schema,r)?.properties;if(!d)return{suggestions:[]};let h=new Set,u=Gqe(o,r);if(kd(u)){for(let g of u.items)if(ji(g.key)&&typeof g.key.value==="string")h.add(g.key.value)}let f=e.getWordUntilPosition(t),m=ux.fromPositions(new QA(t.lineNumber,f.startColumn),new QA(t.lineNumber,f.endColumn));return{suggestions:Object.entries(d).filter(([g])=>!h.has(g)).map(([g,_])=>({label:g,kind:Lt.CompletionItemKind.Property,insertText:`${g}: `,range:m,detail:_.type,documentation:_.description}))}}})}function H_t(){if(zqe)return;zqe=!0,Lt.registerHoverProvider("yaml",{provideHover(e,t){let i=[...TP.values()].find((f)=>f.modelUri===e.uri.toString());if(!i)return null;let n;try{n=XT(e.getValue())}catch{return null}let o=n.contents,s=x$(o,e.getOffsetAt(t));if(!s)return null;let r=e.getLineContent(t.lineNumber),a=/^\s*(?:-\s*)?["']?([A-Za-z0-9_.-]+)["']?\s*:/.exec(r),l,c="";if(a){let f=a[1],m=s[s.length-1]===f?s.slice(0,-1):s;l=S$(i.schema,m,f),c=f}else l=S$(i.schema,s),c=String(s[s.length-1]??"");if(!l?.description)return null;let d=e.getWordAtPosition(t),h=d?new ux(t.lineNumber,d.startColumn,t.lineNumber,d.endColumn):void 0,u=l.type?` (${String(l.type)})`:"";return{range:h,contents:[{value:`**${c}**`},{value:`${u.trim()}${u?" ":""}${l.description}`}]}}})}function Fue(e){let t=[0];for(let i=0;i<e.length;i++)if(e[i]===`
|
|
1605
|
-
`)t.push(i+1);return t}function Bue(e,t){let i=0,n=e.length-1;while(i<n){let o=Math.ceil((i+n)/2);if((e[o]??0)<=t)i=o;else n=o-1}return{line:i+1,column:t-(e[i]??0)+1}}function Yqe(e){return e.replace(/ in JSON at position \d+.*$/i,"").replace(/\s*\(line \d+ column \d+\)$/i,"").replace(/\s+at line \d+, column \d+.*$/i,"").trim()}function $qe(e){if(!e.trim())return{failure:{line:1,column:1,message:"Rules cannot be empty."}};try{let t=JSON.parse(e),i;try{i=XT(e)}catch{i=void 0}return{value:t,doc:i}}catch(t){let i=String(t.message||t),n=Fue(e),o=Number(/position (\d+)/.exec(i)?.[1]??0);return{failure:{...Bue(n,o),message:Yqe(i)||"Invalid JSON."}}}}function qqe(e){if(!e.trim())return{failure:{line:1,column:1,message:"Rules cannot be empty."}};let t=XT(e,{prettyErrors:!0});if(t.errors.length){let i=t.errors[0],n=Fue(e),o=Number(i.pos?.[0]??0),s=Bue(n,o),r=i.linePos?.[0]?.line??s.line,a=i.linePos?.[0]?.col??s.column;return{failure:{line:r,column:a,message:Yqe(i.message)||"Invalid YAML."}}}try{return{value:t.toJS(),doc:t}}catch(i){return{failure:{line:1,column:1,message:String(i.message||i)}}}}function V_t(e,t,i,n){let o=Hqe(n==="inbound"?"inbound":"rules",e.path);if(t){let r=Gqe(t.contents,e.path)?.range;if(Array.isArray(r)){let a=Fue(i);return{...Bue(a,r[0]),path:o,message:e.message}}}return{line:1,column:1,path:o,message:e.message}}function Oue(e,t){if(t==="yaml")return Tue(e,{indent:2,lineWidth:0});return JSON.stringify(e,null,2)}function Kqe(e){return e==="yaml"?"YAML":"JSON"}function z_t(e){let t=e.kind,i=e.format??"yaml",n=e.accounts,o=t==="inbound"?Nue(n):Due(n),s={kind:t,uri:`inmemory://chat/integration-${t}.schema.json`,schema:o,modelUri:`inmemory://chat/integration-${t}.json`};TP.set(t,s),Mue(),W_t(),H_t(),jqe();let r=Oue(e.value??[],i),a=Us.createModel(r,Kqe(i).toLowerCase(),eE.parse(s.modelUri)),l=Us.create(e.container,{model:a,theme:Pue()?"chatroom-dark":"chatroom-light",automaticLayout:!0,ariaLabel:t==="inbound"?"Inbound routes":"Integration rules",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineNumbersMinChars:3,tabSize:2,insertSpaces:!0,autoIndent:"none",autoClosingBrackets:"never",autoClosingQuotes:"never",wordWrap:"on",fixedOverflowWidgets:!0,renderLineHighlight:"line",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},suggest:{showWords:!1}}),c=(_)=>{if(_.ctrlKey||_.metaKey||_.altKey||_.shiftKey)return;let b=Math.max(0,l.getScrollHeight()-l.getLayoutInfo().height),v=l.getScrollTop(),y=_.deltaY<0&&v<=0,C=_.deltaY>0&&v>=b-1;if(!y&&!C)return;let x=e.container.parentElement;while(x){let S=getComputedStyle(x);if(/(auto|scroll)/.test(S.overflowY)&&x.scrollHeight>x.clientHeight+1){x.scrollTop+=_.deltaY,_.preventDefault(),_.stopPropagation();return}x=x.parentElement}};e.container.addEventListener("wheel",c,{capture:!0,passive:!1});let d=()=>{let _=a.getValue(),b=i==="yaml"?qqe(_):$qe(_),v=[];if(b.failure)v.push({line:b.failure.line,column:b.failure.column,path:"",message:b.failure.message});else for(let y of py(b.value,o))v.push(V_t(y,b.doc,_,t));return v.sort((y,C)=>y.line-C.line||y.column-C.column),Us.setModelMarkers(a,"integration-rules",v.map((y)=>{let C=a.getLineMaxColumn(Math.min(y.line,a.getLineCount()));return{severity:SC.Error,message:y.message,startLineNumber:y.line,startColumn:y.column,endLineNumber:y.line,endColumn:Math.max(y.column+1,Math.min(C,y.column+80))}})),{kind:t,format:i,text:_,value:b.value,valid:v.length===0,errors:v}},h=()=>{let _=d();return e.onChange?.(_),_},u=(_)=>{let b=Oue(_??[],i);if(b===a.getValue())h();else a.setValue(b)},f=(_)=>{if(_===i)return;let b=i==="yaml"?qqe(a.getValue()):$qe(a.getValue());if(i=_,Us.setModelLanguage(a,Kqe(i).toLowerCase()),!b.failure){let v=Oue(b.value,i);if(v!==a.getValue())a.setValue(v);else h()}else h()},m=(_)=>{n=_,o=t==="inbound"?Nue(n):Due(n),s.schema=o,Mue(),h()},g=a.onDidChangeContent(()=>{h()});return{getKind:()=>t,getFormat:()=>i,setFormat:f,setValue:u,setAccounts:m,validate:d,reveal:(_,b)=>{let v={lineNumber:Math.max(1,_),column:Math.max(1,b)};l.revealPositionInCenter(v),l.setPosition(v),l.focus()},setReadOnly:(_)=>l.updateOptions({readOnly:_}),focus:()=>l.focus(),dispose:()=>{e.container.removeEventListener("wheel",c,!0),g.dispose(),l.dispose(),a.dispose(),TP.delete(t),Mue()}}}function U_t(e){jqe();let t=e.language||"plaintext",i=Us.createModel(e.value,t,eE.parse(`inmemory://chat/code-preview-${++P_t}.${t}`)),n=Us.create(e.container,{model:i,theme:Pue()?"chatroom-dark":"chatroom-light",readOnly:!0,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineNumbers:"on",wordWrap:"off",renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,folding:!0,padding:{top:10,bottom:10},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1},contextmenu:!0,ariaLabel:"Code preview"});return{dispose:()=>{n.dispose(),i.dispose()}}}export{U_t as createCodePreviewEditor,z_t as createIntegrationRulesEditor};
|
|
1605
|
+
`)t.push(i+1);return t}function Bue(e,t){let i=0,n=e.length-1;while(i<n){let o=Math.ceil((i+n)/2);if((e[o]??0)<=t)i=o;else n=o-1}return{line:i+1,column:t-(e[i]??0)+1}}function Yqe(e){return e.replace(/ in JSON at position \d+.*$/i,"").replace(/\s*\(line \d+ column \d+\)$/i,"").replace(/\s+at line \d+, column \d+.*$/i,"").trim()}function $qe(e){if(!e.trim())return{failure:{line:1,column:1,message:"Rules cannot be empty."}};try{let t=JSON.parse(e),i;try{i=XT(e)}catch{i=void 0}return{value:t,doc:i}}catch(t){let i=String(t.message||t),n=Fue(e),o=Number(/position (\d+)/.exec(i)?.[1]??0);return{failure:{...Bue(n,o),message:Yqe(i)||"Invalid JSON."}}}}function qqe(e){if(!e.trim())return{failure:{line:1,column:1,message:"Rules cannot be empty."}};let t=XT(e,{prettyErrors:!0});if(t.errors.length){let i=t.errors[0],n=Fue(e),o=Number(i.pos?.[0]??0),s=Bue(n,o),r=i.linePos?.[0]?.line??s.line,a=i.linePos?.[0]?.col??s.column;return{failure:{line:r,column:a,message:Yqe(i.message)||"Invalid YAML."}}}try{return{value:t.toJS(),doc:t}}catch(i){return{failure:{line:1,column:1,message:String(i.message||i)}}}}function V_t(e,t,i,n){let o=Hqe(n==="inbound"?"inbound":"rules",e.path);if(t){let r=Gqe(t.contents,e.path)?.range;if(Array.isArray(r)){let a=Fue(i);return{...Bue(a,r[0]),path:o,message:e.message}}}return{line:1,column:1,path:o,message:e.message}}function Oue(e,t){if(t==="yaml")return Tue(e,{indent:2,lineWidth:0});return JSON.stringify(e,null,2)}function Kqe(e){return e==="yaml"?"YAML":"JSON"}function z_t(e){let t=e.kind,i=e.format??"yaml",n=e.accounts,o=t==="inbound"?Nue(n):Due(n),s={kind:t,uri:`inmemory://chat/integration-${t}.schema.json`,schema:o,modelUri:`inmemory://chat/integration-${t}.json`};TP.set(t,s),Mue(),W_t(),H_t(),jqe();let r=Oue(e.value??[],i),a=Us.createModel(r,Kqe(i).toLowerCase(),eE.parse(s.modelUri)),l=Us.create(e.container,{model:a,theme:Pue()?"chatroom-dark":"chatroom-light",automaticLayout:!0,ariaLabel:t==="inbound"?"Inbound routes":"Integration rules",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineNumbersMinChars:3,tabSize:2,insertSpaces:!0,autoIndent:"none",autoClosingBrackets:"never",autoClosingQuotes:"never",wordWrap:"on",fixedOverflowWidgets:!0,useShadowDOM:!1,renderLineHighlight:"line",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},suggest:{showWords:!1}}),c=(_)=>{if(_.ctrlKey||_.metaKey||_.altKey||_.shiftKey)return;let b=Math.max(0,l.getScrollHeight()-l.getLayoutInfo().height),v=l.getScrollTop(),y=_.deltaY<0&&v<=0,C=_.deltaY>0&&v>=b-1;if(!y&&!C)return;let x=e.container.parentElement;while(x){let S=getComputedStyle(x);if(/(auto|scroll)/.test(S.overflowY)&&x.scrollHeight>x.clientHeight+1){x.scrollTop+=_.deltaY,_.preventDefault(),_.stopPropagation();return}x=x.parentElement}};e.container.addEventListener("wheel",c,{capture:!0,passive:!1});let d=()=>{let _=a.getValue(),b=i==="yaml"?qqe(_):$qe(_),v=[];if(b.failure)v.push({line:b.failure.line,column:b.failure.column,path:"",message:b.failure.message});else for(let y of py(b.value,o))v.push(V_t(y,b.doc,_,t));return v.sort((y,C)=>y.line-C.line||y.column-C.column),Us.setModelMarkers(a,"integration-rules",v.map((y)=>{let C=a.getLineMaxColumn(Math.min(y.line,a.getLineCount()));return{severity:SC.Error,message:y.message,startLineNumber:y.line,startColumn:y.column,endLineNumber:y.line,endColumn:Math.max(y.column+1,Math.min(C,y.column+80))}})),{kind:t,format:i,text:_,value:b.value,valid:v.length===0,errors:v}},h=()=>{let _=d();return e.onChange?.(_),_},u=(_)=>{let b=Oue(_??[],i);if(b===a.getValue())h();else a.setValue(b)},f=(_)=>{if(_===i)return;let b=i==="yaml"?qqe(a.getValue()):$qe(a.getValue());if(i=_,Us.setModelLanguage(a,Kqe(i).toLowerCase()),!b.failure){let v=Oue(b.value,i);if(v!==a.getValue())a.setValue(v);else h()}else h()},m=(_)=>{n=_,o=t==="inbound"?Nue(n):Due(n),s.schema=o,Mue(),h()},g=a.onDidChangeContent(()=>{h()});return{getKind:()=>t,getFormat:()=>i,setFormat:f,setValue:u,setAccounts:m,validate:d,reveal:(_,b)=>{let v={lineNumber:Math.max(1,_),column:Math.max(1,b)};l.revealPositionInCenter(v),l.setPosition(v),l.focus()},setReadOnly:(_)=>l.updateOptions({readOnly:_}),focus:()=>l.focus(),dispose:()=>{e.container.removeEventListener("wheel",c,!0),g.dispose(),l.dispose(),a.dispose(),TP.delete(t),Mue()}}}function U_t(e){jqe();let t=e.language||"plaintext",i=Us.createModel(e.value,t,eE.parse(`inmemory://chat/code-preview-${++P_t}.${t}`)),n=Us.create(e.container,{model:i,theme:Pue()?"chatroom-dark":"chatroom-light",readOnly:!0,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineNumbers:"on",wordWrap:"off",renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,folding:!0,padding:{top:10,bottom:10},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1},contextmenu:!0,useShadowDOM:!1,ariaLabel:"Code preview"}),o=!1,s=(r)=>{if(!r.altKey||r.ctrlKey||r.metaKey||r.shiftKey||r.code!=="KeyZ")return;if(r.preventDefault(),r.stopPropagation(),r.repeat)return;o=!o,n.updateOptions({wordWrap:o?"on":"off"})};return e.container.addEventListener("keydown",s,!0),{dispose:()=>{e.container.removeEventListener("keydown",s,!0),n.dispose(),i.dispose()}}}export{U_t as createCodePreviewEditor,z_t as createIntegrationRulesEditor};
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
Third-party packages bundled into the Office previews.
|
|
2
2
|
|
|
3
3
|
docx-preview 0.4.1 (Apache-2.0) -> licenses/docx-preview-LICENSE.txt
|
|
4
|
+
note: dist @license header (Copyright Volodymyr Baydalka) preserved verbatim from the bundled dist
|
|
5
|
+
additional: licenses/docx-preview-HEADER.txt
|
|
4
6
|
echarts 6.1.0 (Apache-2.0) -> licenses/echarts-LICENSE.txt
|
|
7
|
+
additional: licenses/echarts-LICENSE-d3.txt, licenses/echarts-NOTICE.txt
|
|
8
|
+
immediate (MIT) -> licenses/immediate-LICENSE.txt
|
|
9
|
+
bundled inside: jszip 3.10.2 (node_modules/jszip/dist/jszip.min.js)
|
|
10
|
+
version: not asserted; lie declares ~3.0.5
|
|
11
|
+
license: verbatim from installed immediate 3.0.6
|
|
5
12
|
jszip 3.10.2 ((MIT OR GPL-3.0-or-later)) -> licenses/jszip-LICENSE.txt
|
|
13
|
+
lie (MIT) -> licenses/lie-LICENSE.txt
|
|
14
|
+
bundled inside: jszip 3.10.2 (node_modules/jszip/dist/jszip.min.js)
|
|
15
|
+
version: not asserted; jszip declares ~3.3.0
|
|
16
|
+
license: verbatim from installed lie 3.3.0
|
|
6
17
|
lodash 4.18.1 (MIT) -> licenses/lodash-LICENSE.txt
|
|
18
|
+
pako ((MIT AND Zlib)) -> licenses/pako-LICENSE.txt
|
|
19
|
+
bundled inside: jszip 3.10.2 (node_modules/jszip/dist/jszip.min.js)
|
|
20
|
+
version: not asserted; jszip declares ~1.0.2
|
|
21
|
+
license: verbatim from installed pako 1.0.11
|
|
22
|
+
additional: licenses/pako-ZLIB.txt
|
|
7
23
|
pptx-preview 1.0.7 (ISC declared; upstream custom terms) -> licenses/pptx-preview-LICENSE.txt
|
|
8
|
-
|
|
24
|
+
setimmediate (MIT) -> licenses/setimmediate-LICENSE.txt
|
|
25
|
+
bundled inside: jszip 3.10.2 (node_modules/jszip/dist/jszip.min.js)
|
|
26
|
+
version: not asserted; jszip declares ^1.0.5
|
|
27
|
+
license: verbatim from installed setimmediate 1.0.5
|
|
28
|
+
tslib 2.3.0, 2.8.1 (0BSD) -> licenses/tslib-LICENSE.txt
|
|
29
|
+
instances: 2.3.0 (node_modules/echarts/node_modules/tslib), 2.8.1 (node_modules/tslib), 2.3.0 (node_modules/zrender/node_modules/tslib)
|
|
9
30
|
uuid 11.1.1 (MIT) -> licenses/uuid-LICENSE.txt
|
|
10
31
|
xlsx 0.20.3 (Apache-2.0) -> licenses/xlsx-LICENSE.txt
|
|
32
|
+
note: SheetJS Community Edition tarball; inlined ssf/cfb/crc32 sections carry SheetJS copyright under the same license
|
|
11
33
|
zrender 6.1.0 (BSD-3-Clause) -> licenses/zrender-LICENSE.txt
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright 2010-2016 Mike Bostock
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
5
|
+
are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
* Neither the name of the author nor the names of contributors may be used to
|
|
15
|
+
endorse or promote products derived from this software without specific prior
|
|
16
|
+
written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
19
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
22
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
24
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
25
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
27
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, Domenic Denicola, Brian Cavalier
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#Copyright (c) 2014-2018 Calvin Metcalf, Jordan Harband
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
|
2
|
+
Copyright (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
|
|
3
|
+
|
|
4
|
+
This software is provided 'as-is', without any express or implied
|
|
5
|
+
warranty. In no event will the authors be held liable for any damages
|
|
6
|
+
arising from the use of this software.
|
|
7
|
+
|
|
8
|
+
Permission is granted to anyone to use this software for any purpose,
|
|
9
|
+
including commercial applications, and to alter it and redistribute it
|
|
10
|
+
freely, subject to the following restrictions:
|
|
11
|
+
|
|
12
|
+
1. The origin of this software must not be misrepresented; you must not
|
|
13
|
+
claim that you wrote the original software. If you use this software
|
|
14
|
+
in a product, an acknowledgment in the product documentation would be
|
|
15
|
+
appreciated but is not required.
|
|
16
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
|
17
|
+
misrepresented as being the original software.
|
|
18
|
+
3. This notice may not be removed or altered from any source distribution.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -140,7 +140,9 @@
|
|
|
140
140
|
.rail-composer .field { margin-bottom: 8px; }
|
|
141
141
|
.rail-composer .btn { width: 100%; }
|
|
142
142
|
.mobile-locale { display: none; }
|
|
143
|
-
|
|
143
|
+
/* The scroller reaches the rail divider so its scrollbar hugs the edge; the
|
|
144
|
+
padding keeps the rows on the rail's 14px inset. */
|
|
145
|
+
.rail-rooms { flex: 1; min-height: 0; overflow: auto; list-style: none; margin: 0 -14px 0 0; padding: 0 14px 0 0; }
|
|
144
146
|
#roomListChat .room-row { padding: 11px 12px; border-color: transparent; border-radius: 12px; }
|
|
145
147
|
#roomListChat .room-row::before {
|
|
146
148
|
content: "";
|
|
@@ -171,8 +173,10 @@
|
|
|
171
173
|
.r-kind { color: var(--accent); font-size: 11px; font-weight: 700; }
|
|
172
174
|
.r-status { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
|
|
173
175
|
.r-preview { overflow: hidden; color: var(--ink-3); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
|
|
174
|
-
.r-
|
|
176
|
+
.r-badges { position: absolute; top: 8px; right: 9px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
|
|
177
|
+
.r-badge { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; }
|
|
175
178
|
.r-badge-question { background: var(--warning); color: var(--warning-ink); font-size: 12px; }
|
|
179
|
+
.r-badge-requests { background: var(--warning); color: var(--warning-ink); font-size: 12px; }
|
|
176
180
|
/* The rail footer keeps the empty composer's height so the divider lines meet when
|
|
177
181
|
idle. Files or wrapped lines grow only the composer, never this footer. */
|
|
178
182
|
.rail-foot { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 8px; margin-top: auto; min-height: var(--composer-block, 104px); padding: 12px 4px 14px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); font-size: 12px; color: var(--ink-3); }
|
|
@@ -183,6 +187,12 @@
|
|
|
183
187
|
#roomRail .rail-label { margin-bottom: 6px; }
|
|
184
188
|
#roomListChat .room-row { gap: 1px; padding: 5px 9px; }
|
|
185
189
|
#roomListChat .r-kind:empty, #roomListChat .r-meta, #roomListChat .r-preview { display: none; }
|
|
190
|
+
/* Collapsed rows are too short for two stacked badges; sit them side by side
|
|
191
|
+
and reserve their width so the name truncates instead of running under them. */
|
|
192
|
+
.r-badges { top: 5px; flex-direction: row-reverse; gap: 1px; }
|
|
193
|
+
#roomListChat .room-row:has(.r-badges) { padding-right: 44px; }
|
|
194
|
+
.r-badge { min-width: 16px; height: 16px; padding: 0 4px; font-size: 9px; }
|
|
195
|
+
.r-badge-question, .r-badge-requests { font-size: 10px; }
|
|
186
196
|
}
|
|
187
197
|
@media (max-height: 400px) {
|
|
188
198
|
#chatView { margin: 10px auto; height: calc(100% - 20px); }
|
|
@@ -258,7 +258,9 @@
|
|
|
258
258
|
.integration-rule-error:hover { text-decoration: underline; }
|
|
259
259
|
.integration-rule-error:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
260
260
|
.integration-field-error { margin: 0; color: var(--danger); font-size: 12px; line-height: 1.45; white-space: pre-wrap; }
|
|
261
|
-
|
|
261
|
+
/* No trailing panel padding: it would un-stick the save row for its last pixels of scroll. */
|
|
262
|
+
.settings-panel.integration-panel { padding-bottom: 0; }
|
|
263
|
+
.integration-actions { position: sticky; bottom: 0; z-index: 1; display: flex; justify-content: flex-end; padding: 10px 0 14px; border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent); background: var(--surface); }
|
|
262
264
|
.integration-dialog { width: min(620px, calc(100vw - 24px)); max-height: min(820px, 90dvh); }
|
|
263
265
|
.integration-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
|
|
264
266
|
.integration-form { display: grid; gap: 10px; min-height: 0; padding: 0 20px 20px; overflow-y: auto; }
|
package/server/assets/tasks.css
CHANGED
|
@@ -127,7 +127,11 @@
|
|
|
127
127
|
padding: 4px 28px 4px 9px;
|
|
128
128
|
font-size: 12px;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
/* The fixed line box keeps an empty summary from shrinking the toolbar. */
|
|
131
|
+
.tasks-summary { min-height: 1.4em; margin: 0 0 0 auto; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; }
|
|
132
|
+
/* A reload spins the reload glyph in place, so the rows and the toolbar hold
|
|
133
|
+
their geometry while the request is in flight. */
|
|
134
|
+
#btnRefreshTasks.is-refreshing svg { animation: spin .8s linear infinite; }
|
|
131
135
|
|
|
132
136
|
.tasks-error {
|
|
133
137
|
display: flex;
|
|
@@ -466,4 +470,5 @@
|
|
|
466
470
|
|
|
467
471
|
@media (prefers-reduced-motion: reduce) {
|
|
468
472
|
#tasksDialog[open], #taskEditDialog[open], .task-row { animation: none; }
|
|
473
|
+
#btnRefreshTasks.is-refreshing svg { animation: none; opacity: .7; }
|
|
469
474
|
}
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
html[data-wco="true"] body {
|
|
5
5
|
display: grid;
|
|
6
6
|
grid-template-rows: calc(env(titlebar-area-y, var(--wco-top, 0px)) + env(titlebar-area-height, var(--wco-height, 0px))) minmax(0, 1fr);
|
|
7
|
-
|
|
7
|
+
/* Chrome reads a step deeper than the page backdrop, so the strip and the
|
|
8
|
+
room header under it stay apart in both schemes. */
|
|
9
|
+
background: color-mix(in srgb, var(--bg) 94%, #000);
|
|
8
10
|
}
|
|
9
11
|
html[data-wco="true"] #app {
|
|
10
12
|
grid-row: 2;
|
package/server/channels.ts
CHANGED
|
@@ -522,7 +522,8 @@ export async function channelRoutes(
|
|
|
522
522
|
|
|
523
523
|
const message = await readForwardableMessage(roomId, messageId, sessionID);
|
|
524
524
|
if (!message) return json({ error: "message not found" }, 404);
|
|
525
|
-
if (runtime
|
|
525
|
+
if (!forwardTargets(runtime, roomId).some((candidate) =>
|
|
526
|
+
candidate.platform === target.platform && candidate.account === target.account && candidate.room === target.room)) {
|
|
526
527
|
return json({ error: "forward target is unavailable" }, 409);
|
|
527
528
|
}
|
|
528
529
|
|
|
@@ -564,4 +565,4 @@ export async function channelRoutes(
|
|
|
564
565
|
if (!sessionID || sessionID.length > MAX_SESSION) return json({ error: "sessionID is required" }, 400);
|
|
565
566
|
if (!await isRoomMember(roomId, sessionID)) return json({ error: "room not found" }, 404);
|
|
566
567
|
return json({ targets: forwardTargets(runtime, roomId) });
|
|
567
|
-
}
|
|
568
|
+
}
|
package/server/chat.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<section id="joinView" class="view" hidden>
|
|
67
67
|
<div class="join-shell">
|
|
68
68
|
<header class="join-head">
|
|
69
|
-
<div class="wordmark-row"><span class="brand-mark" aria-hidden="true">OC</span><p class="wordmark" data-i18n="brand">OC Chat</p><span class="version-tag"
|
|
69
|
+
<div class="wordmark-row"><span class="brand-mark" aria-hidden="true">OC</span><p class="wordmark" data-i18n="brand">OC Chat</p><span class="version-tag" title="{{version}}">{{versionLabel}}</span></div>
|
|
70
70
|
<button id="btnJoinSettings" class="join-settings" type="button" aria-haspopup="dialog" aria-controls="chatSettings" aria-expanded="false">
|
|
71
71
|
<svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-options-24"></use></svg>
|
|
72
72
|
<span data-i18n="settings">Settings</span>
|
|
@@ -425,7 +425,7 @@
|
|
|
425
425
|
<!-- Shared room workspace. -->
|
|
426
426
|
<section id="chatView" class="view" hidden>
|
|
427
427
|
<aside id="roomRail" class="room-rail" aria-label="Rooms" data-i18n-aria-label="roomsLabel">
|
|
428
|
-
<div class="rail-brand"><span class="brand-mark">OC</span><span data-i18n="brand">OC Chat</span><span class="version-tag"
|
|
428
|
+
<div class="rail-brand"><span class="brand-mark">OC</span><span class="brand-name" data-i18n="brand">OC Chat</span><span class="version-tag" title="{{version}}">{{versionLabel}}</span></div>
|
|
429
429
|
<div class="rail-label"><span data-i18n="existingRooms">Rooms</span><span class="rail-tools"><button id="btnNewRoom" class="icon-btn" type="button" aria-label="Create a room" data-i18n-aria-label="newRoom" aria-haspopup="dialog" aria-controls="createRoomDialog" aria-expanded="false"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-add-24"></use></svg></button><button id="btnRefreshRooms" class="icon-btn" type="button" aria-label="Refresh rooms" data-i18n-aria-label="refreshRooms"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_sync-24"></use></svg></button></span></div>
|
|
430
430
|
<ul id="roomListChat" class="rail-rooms"></ul>
|
|
431
431
|
<p id="roomListChatEmpty" class="hint" data-i18n="noRooms" hidden></p>
|
|
@@ -781,6 +781,10 @@
|
|
|
781
781
|
<button type="button" id="btnCloseReaders" class="reader-close" data-i18n-aria-label="close" aria-label="Close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
|
|
782
782
|
</div>
|
|
783
783
|
<ul id="readerList" class="receipt-reader-list" aria-label="Message readers" data-i18n-aria-label="readerPanelTitle"></ul>
|
|
784
|
+
<section id="deliveredGroup" class="reader-delivered" hidden>
|
|
785
|
+
<p id="deliveredCount" class="hint"></p>
|
|
786
|
+
<ul id="deliveredList" class="receipt-reader-list"></ul>
|
|
787
|
+
</section>
|
|
784
788
|
</aside>
|
|
785
789
|
|
|
786
790
|
<footer class="composer">
|
|
@@ -936,6 +940,7 @@
|
|
|
936
940
|
<ul class="keys-list">
|
|
937
941
|
<li><span class="keys-combo"><kbd class="keys-key shortcut-mod">Alt</kbd><span class="keys-sep">+</span><kbd class="keys-key">↑</kbd><span class="keys-sep">/</span><kbd class="keys-key">↓</kbd></span><span data-i18n="shortcutsSwitchRoom">Switch to the previous or next room</span></li>
|
|
938
942
|
<li><span class="keys-combo"><kbd class="keys-key shortcut-mod">Alt</kbd><span class="keys-sep">+</span><kbd class="keys-key">1–9</kbd></span><span data-i18n="shortcutsNumberRoom">Switch to a joined room by number</span></li>
|
|
943
|
+
<li><span class="keys-combo"><kbd class="keys-key shortcut-mod">Alt</kbd><span class="keys-sep">+</span><kbd class="keys-key">Shift</kbd><span class="keys-sep">+</span><kbd class="keys-key">↑</kbd><span class="keys-sep">/</span><kbd class="keys-key">↓</kbd></span><span data-i18n="shortcutsMoveRoom">Move the focused room up or down</span></li>
|
|
939
944
|
</ul>
|
|
940
945
|
</section>
|
|
941
946
|
<section class="keys-section">
|
package/server/inbox.ts
CHANGED
|
@@ -5,8 +5,10 @@ export type InboxItem = Pick<Message, "id" | "roomId" | "senderId" | "senderSess
|
|
|
5
5
|
roomName: string;
|
|
6
6
|
roomKind?: "group" | "direct";
|
|
7
7
|
answerQuestionExcerpt?: string;
|
|
8
|
+
// Only on the sender's own message in an incremental, room-scoped poll.
|
|
9
|
+
clientMessageID?: string;
|
|
8
10
|
};
|
|
9
|
-
export type InboxResult = { member: boolean; items: InboxItem[]; queuedTs: Record<string, number>; hasMore: boolean; recallVersion: number };
|
|
11
|
+
export type InboxResult = { member: boolean; items: InboxItem[]; queuedTs: Record<string, number>; hasMore: boolean; recallVersion: number; membershipID?: string };
|
|
10
12
|
|
|
11
13
|
export async function readInbox(sessionID: string, roomFilter: string | null, excludeSelf: boolean, afterTs?: number): Promise<InboxResult> {
|
|
12
14
|
return readInboxMessages(sessionID, roomFilter, excludeSelf, excludeSelf ? 20 : 100, afterTs);
|
package/server/join-requests.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { databasePath, listJoinRequests, readJoinRequest, readState } from "../src/state/store.ts";
|
|
2
2
|
import { findJoinRequest, removeJoinRequest, writeSqliteStateWithDatabase } from "../src/state/sqlite-state.ts";
|
|
3
|
+
import { pendingJoinRequestRoomIDs } from "../src/state/sqlite-members.ts";
|
|
3
4
|
import { binding, tx, validCurrent } from "./admin-state.ts";
|
|
4
5
|
import { hasAdminCapability } from "./admin-auth.ts";
|
|
5
6
|
import { isRoomAdmin } from "./room-owner.ts";
|
|
@@ -28,6 +29,12 @@ function bounded(value: unknown): value is string {
|
|
|
28
29
|
// Approval-protected joins: requests stay in SQLite until a reviewer consumes
|
|
29
30
|
// them; denial removes the row so the requester can try again.
|
|
30
31
|
export async function joinRequestRoutes(req: Request, url: URL): Promise<Response | undefined> {
|
|
32
|
+
if (url.pathname === "/rooms/pending-join-requests") {
|
|
33
|
+
if (req.method !== "GET") return json({ error: "method not allowed" }, 405);
|
|
34
|
+
const sessionID = url.searchParams.get("sessionID");
|
|
35
|
+
if (!bounded(sessionID)) return json({ error: "sessionID is required" }, 400);
|
|
36
|
+
return json({ roomIDs: await pendingJoinRequestRoomIDs(databasePath(), sessionID) });
|
|
37
|
+
}
|
|
31
38
|
const status = url.pathname.match(/^\/rooms\/([^/]+)\/join-requests\/status$/);
|
|
32
39
|
const list = url.pathname.match(/^\/rooms\/([^/]+)\/join-requests$/);
|
|
33
40
|
const action = url.pathname.match(/^\/rooms\/([^/]+)\/join-requests\/([^/]+)\/(approve|deny)$/);
|
|
@@ -115,4 +122,4 @@ export async function joinRequestRoutes(req: Request, url: URL): Promise<Respons
|
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
return json({ error: "method not allowed" }, 405);
|
|
118
|
-
}
|
|
125
|
+
}
|
package/server/member-routes.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memberActivity, type WorkState } from "../src/state/member-state.ts";
|
|
2
|
-
import { acknowledgeRead, acknowledgeReadWithReceipts, readReceipts, readState, recordMessageReceipts, reportPresence, type ReceiptEvidence, type ReceiptIdentity } from "../src/state/store.ts";
|
|
2
|
+
import { acknowledgeRead, acknowledgeReadWithReceipts, readReceipts, readState, recordMessageDeliveries, recordMessageReceipts, reportPresence, type ReceiptEvidence, type ReceiptIdentity } from "../src/state/store.ts";
|
|
3
3
|
import { isReceiverOwnerID } from "../src/state/receiver-owner.ts";
|
|
4
4
|
import { clearPendingAdmission } from "../src/center/queue.ts";
|
|
5
5
|
import { touchActive } from "./wake.ts";
|
|
@@ -79,6 +79,20 @@ export async function memberRoutes(req: Request, url: URL): Promise<Response | u
|
|
|
79
79
|
if (result.status === "messageIDs") return json({ error: "message IDs do not belong to this room" }, 400);
|
|
80
80
|
return json({ acceptedIDs: result.acceptedIDs });
|
|
81
81
|
}
|
|
82
|
+
const deliveryRoute = url.pathname.match(/^\/rooms\/([^/]+)\/deliveries$/);
|
|
83
|
+
if (req.method === "POST" && deliveryRoute) {
|
|
84
|
+
const body: unknown = await req.json();
|
|
85
|
+
if (!object(body)) return json({ error: "JSON object body is required" }, 400);
|
|
86
|
+
const sessionID = body.sessionID, membershipID = body.membershipID, ownerID = body.receiverOwnerID, ids = body.messageIDs;
|
|
87
|
+
if (typeof sessionID !== "string" || !sessionID || sessionID.length > 128 ||
|
|
88
|
+
typeof membershipID !== "string" || !membershipID || membershipID.length > 128 ||
|
|
89
|
+
!Array.isArray(ids) || !ids.length || ids.length > 500 || ids.some((id) => typeof id !== "string" || !id || id.length > 128) ||
|
|
90
|
+
!isReceiverOwnerID(ownerID)) return json({ error: "invalid message delivery" }, 400);
|
|
91
|
+
const result = await recordMessageDeliveries(decodeURIComponent(deliveryRoute[1]!), sessionID, ids as string[], { membershipID, receiverOwnerID: ownerID });
|
|
92
|
+
if (result.status === "membership") return json({ error: "membership generation mismatch" }, 409);
|
|
93
|
+
if (result.status === "messageIDs") return json({ error: "message IDs do not belong to this room" }, 400);
|
|
94
|
+
return json({ acceptedIDs: result.acceptedIDs });
|
|
95
|
+
}
|
|
82
96
|
const match = url.pathname.match(/^\/rooms\/([^/]+)\/(members|receipts)$/);
|
|
83
97
|
if (req.method === "GET" && match) {
|
|
84
98
|
const roomID = decodeURIComponent(match[1]!);
|
|
@@ -97,7 +111,7 @@ export async function memberRoutes(req: Request, url: URL): Promise<Response | u
|
|
|
97
111
|
if (ids && (!ids.length || ids.length > 500 || ids.some((id) => !id || id.length > 128))) return json({ error: "invalid message IDs" }, 400);
|
|
98
112
|
const receipts = await readReceipts(roomID, ids);
|
|
99
113
|
if (!receipts) return json({ error: "message IDs do not belong to this room" }, 400);
|
|
100
|
-
return json({ receipts: receipts.map((item) => ({ messageID: item.messageID, readers: item.readers.map((reader) => ({ ...reader, currentMember: Boolean(registry[reader.sessionID]) })) })), semantics: "per-message" });
|
|
114
|
+
return json({ receipts: receipts.map((item) => ({ messageID: item.messageID, readers: item.readers.map((reader) => ({ ...reader, currentMember: Boolean(registry[reader.sessionID]) })), ...(item.deliveredTo?.length ? { deliveredTo: item.deliveredTo } : {}) })), semantics: "per-message" });
|
|
101
115
|
}
|
|
102
116
|
if (req.method !== "POST" || url.pathname !== "/presence") return undefined;
|
|
103
117
|
const body: unknown = await req.json();
|
package/server/newrooms.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { hasAdminCapability } from "./admin-auth.ts";
|
|
|
6
6
|
import { roomPayload } from "./room-payload.ts";
|
|
7
7
|
import { clearPendingAdmission } from "../src/center/queue.ts";
|
|
8
8
|
import { removeRoomResources } from "../src/rooms/resources.ts";
|
|
9
|
-
import { isOwnerEntry, isRoomAdmin, isUser } from "./room-owner.ts";
|
|
9
|
+
import { applyOwnerTransfer, isOwnerEntry, isRoomAdmin, isUser } from "./room-owner.ts";
|
|
10
10
|
|
|
11
11
|
const json = (body: unknown, status = 200) => Response.json(body, { status });
|
|
12
12
|
const mutate = <T>(fn: (service: RoomService, registry: import("../src/state/store.ts").Registry) => T) => writeState(fn);
|
|
@@ -178,18 +178,7 @@ export async function roomManagement(req: Request, url: URL): Promise<Response |
|
|
|
178
178
|
const target = Object.values(registry[roomId] ?? {}).find((entry) => entry.name === nextOwner && isUser(entry));
|
|
179
179
|
if (!target) return { status: 409 as const, error: "the new owner must be a person in this room" };
|
|
180
180
|
changes.push(`${actor.name} handed the room to ${nextOwner}`);
|
|
181
|
-
room
|
|
182
|
-
if (target.membershipID) room.ownerMembershipID = target.membershipID; else delete room.ownerMembershipID;
|
|
183
|
-
delete room.successorId;
|
|
184
|
-
delete room.successorMembershipID;
|
|
185
|
-
if (room.adminIds) {
|
|
186
|
-
const remaining = room.adminIds.filter((name) => name !== nextOwner);
|
|
187
|
-
if (remaining.length) room.adminIds = remaining; else delete room.adminIds;
|
|
188
|
-
}
|
|
189
|
-
if (target.membershipID && room.adminMembershipIDs?.length) {
|
|
190
|
-
const remaining = room.adminMembershipIDs.filter((id) => id !== target.membershipID);
|
|
191
|
-
if (remaining.length) room.adminMembershipIDs = remaining; else delete room.adminMembershipIDs;
|
|
192
|
-
}
|
|
181
|
+
applyOwnerTransfer(room, target);
|
|
193
182
|
}
|
|
194
183
|
if (changes.length) svc.addEvent(roomId, changes.join("; "));
|
|
195
184
|
return { room };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { safeEqual } from "./admin-state.ts";
|
|
2
|
+
|
|
3
|
+
// The operator panel is opt-in and separate from the shared room bearer. A
|
|
4
|
+
// short or malformed value, or the same value as the shared bearer, disables it.
|
|
5
|
+
const OPERATOR_TOKEN = /^[A-Za-z0-9_-]{43,128}$/;
|
|
6
|
+
|
|
7
|
+
// Resolve once per app. A future identity provider only replaces this function.
|
|
8
|
+
export function resolveOperatorToken(option: string | undefined, sharedToken: string | undefined): string | undefined {
|
|
9
|
+
const token = option ?? process.env.CHAT_ROOM_OPERATOR_TOKEN;
|
|
10
|
+
if (!token || !OPERATOR_TOKEN.test(token)) return undefined;
|
|
11
|
+
if (sharedToken && token === sharedToken) return undefined;
|
|
12
|
+
return token;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// One place to verify the operator bearer; request paths and DB never run first.
|
|
16
|
+
export function operatorAuthorized(request: Request, token: string | undefined): boolean {
|
|
17
|
+
if (!token) return false;
|
|
18
|
+
const header = request.headers.get("authorization");
|
|
19
|
+
if (!header?.startsWith("Bearer ")) return false;
|
|
20
|
+
return safeEqual(header.slice("Bearer ".length), token);
|
|
21
|
+
}
|