@ai-workbench/connect 0.7.26 → 0.7.28
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/README.md +11 -3
- package/client/index.cjs +9 -12
- package/lib/api.d.ts +1 -1
- package/lib/defaults.d.ts +0 -3
- package/lib/defaults.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +8 -7
- package/lib/integration.js +0 -1
- package/lib/login.d.ts +0 -8
- package/lib/native-workspace.d.ts +1 -0
- package/lib/needs.js +3 -3
- package/lib/network.d.ts +0 -4
- package/lib/network.js +4 -88
- package/lib/profile-activation.d.ts +0 -3
- package/lib/profile-activation.js +8 -2
- package/lib/profile-runtime.d.ts +1 -1
- package/lib/profile-runtime.js +7 -4
- package/lib/provider.d.ts +1 -15
- package/lib/provider.js +2 -18
- package/lib/startup.js +3 -3
- package/lib/workspace-directory-picker.js +5 -27
- package/lib/workspace-locations.js +9 -0
- package/package.json +1 -1
- package/node_modules/argparse/CHANGELOG.md +0 -216
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
安装:在官方 DSH「插件 → 添加插件」中选择编排已核验的 tgz 绝对路径。已由编排发布的版本也可按其提供的精确包版本安装;本轮0.7.
|
|
1
|
+
安装:在官方 DSH「插件 → 添加插件」中选择编排已核验的 tgz 绝对路径。已由编排发布的版本也可按其提供的精确包版本安装;本轮0.7.27只提供固定tgz,本项目不自行 publish。
|
|
2
2
|
|
|
3
3
|
# 远程主机连接插件(L)
|
|
4
4
|
|
|
@@ -43,7 +43,7 @@ N消费端保持公开activate/getActivationState/onActivationState握手;L登
|
|
|
43
43
|
|
|
44
44
|
D13已通过[PR15](https://github.com/yzsnstotz/ai-workbench-connect/pull/15)合推main7915df5,移除前为909eabb;五项被拒产物及清单引用已撤除。不再生成新的聚合整包或验收ZIP,交付物为插件本身。
|
|
45
45
|
|
|
46
|
-
**插件版本0.7.
|
|
46
|
+
**插件版本0.7.27,API版本保持0.7.0,旧native-local-v1能力标识已删除。** 本轮沿用现有N/X公开API,真实组合由编排验证。L导入动作固定使用官方系统目录窗口:自动能力为native时直接消费其pick;SSH等启动上下文提供browse时,明确调用同一官方原生包的公开pickNativeDirectory,不修改全局选择器。失败原因与临时登录路径只在本节技术详情准确投影。js-yaml/yauzl及其传递运行依赖随tgz打包,官方宿主peer由已安装官方程序提供,员工不另装npm依赖。真实中文GUI/授权及leo E门分别留证。旧140测试/46图只属于前任draft.3;本轮证据独立记录于[第2轮证据](docs/evidence/2026-10-21-L-round2-draft4/)。不得拿旧0.6.3 tgz当native-local-v1的输入。
|
|
47
47
|
|
|
48
48
|
开发使用Node24.13.1,依赖/缓存/构建和临时HOME放自有外接APFS。工程检查为`npm test`、`npm run check`、`npm run build`;它们不替代真实产品路径。安装走官方插件管理,本包自身只声明一个官方bundle条目,不使用wrapper或员工启动器。工人GUI按[SELFTEST](docs/SELFTEST.md)的PID和三项获准偏离执行,不操作owner实例。
|
|
49
49
|
|
|
@@ -53,7 +53,7 @@ L0.7.4按owner最新纠正分开供给和授权:Electron组件从自身官方
|
|
|
53
53
|
|
|
54
54
|
官方Electron内置Node会把.asar视作虚拟目录;组件缓存/解压专用physical-fs在Electron中使用original-fs核验物理归档,不修改全局process.noAsar。真实官方运行时新建及跨Node复用缓存均有回归。
|
|
55
55
|
|
|
56
|
-
0.7.5仅调整公开 npm 发布元数据和包内容:运行依赖继续随包,合同、源码、测试与证据不进包;无安装脚本。源码与合同见[项目仓库](https://github.com/yzsnstotz/ai-workbench-connect)。发布前可用官方插件页安装已核验的tgz绝对路径。0.7.
|
|
56
|
+
0.7.5仅调整公开 npm 发布元数据和包内容:运行依赖继续随包,合同、源码、测试与证据不进包;无安装脚本。源码与合同见[项目仓库](https://github.com/yzsnstotz/ai-workbench-connect)。发布前可用官方插件页安装已核验的tgz绝对路径。0.7.27本轮提供固定tgz,由编排决定发布;L不执行publish。
|
|
57
57
|
|
|
58
58
|
0.7.26:登录组件固定从 npmmirror 下载,保留 Electron44.0.0 及原 SHA256 校验。删除下载源切换按钮、切换接口与保存偏好,旧 component-source.json 不再读取、不自动改写。helper.componentDownloadSource 和 helper.source 的选源设置删除;无自动测速/竞速/失败换源。helper.componentObservationIntervalMs 仍只刷新无进展秒数。
|
|
59
59
|
|
|
@@ -96,3 +96,11 @@ RFC8628的 `verification_uri_complete` 是可选字段;固定0.163.0 CLI只提
|
|
|
96
96
|
本机通过官方 desktop.pick(与 DSH 添加工作区相同)或官方 uiWorkspace.pickDirectory 打开系统目录框,不再渲染本机目录列表。编排已裁定:本机起始目录由系统记忆,官方 API 不支持指定。不为指定起始目录另写界面或绕过官方 API。远程仍读取上次主机目录,无历史从员工主目录开始。browse 包仅导出插件 apply/inject,内部浏览组件不公开,故插件保留远程数据浏览并沿用 DSH 的面包屑、目录列表、新建文件夹、打开/取消文案;只在显式创建时建一层,不自动建目录或执行 Git。不替换 desktop directoryPicker、不改 DSH core。
|
|
97
97
|
|
|
98
98
|
安装仅用官方插件管理或应用自带 dsh plugin --profile desktop add;装后核 profile 的 node_modules/@deepseek-ai 不存在,且 .plugin-manager/logs 有本次记录。禁止 profile 直接 npm install。
|
|
99
|
+
|
|
100
|
+
## 0.7.27 · N0.4.9 精简消费
|
|
101
|
+
|
|
102
|
+
仅 N 明确返回 ENROLLMENT_KEY_REJECTED 时显示“开通链接已失效,请向管理员领取新的。”;ENROLLMENT_REJECTED 表示已存设备身份失效,普通网络故障不冒充密钥作废。N 自己处理入网恢复;L 删除结果未知死映射、经主机下载/登录代理声明与适配。
|
|
103
|
+
|
|
104
|
+
不再生成 network.downloadMaxRedirects、network.proxyListen、network.httpMaxResponseHeaderBytes。读取已开通旧员工记录时仅在内存比较中忽略对应退役字段,不覆盖原记录/私有配置、不改变 N 使用的摘要;有效连接目标和设置仍须匹配。没有新增设置。
|
|
105
|
+
|
|
106
|
+
显式选本机直接打开官方系统选择框;首次打开仅通过既有 browse 读取上次设备目标,本机分支不列目录、不读上次本机路径。系统返回路径后才取得选择令牌并登记。本机起始目录由系统记忆,官方 API 不支持指定。远程保持上次位置→员工主目录。删掉目录响应额外核验层,失败按普通操作失败显示;下载进行中只留一句进度。
|
package/client/index.cjs
CHANGED
|
@@ -9,7 +9,6 @@ window.__ModuleLoader__.load({id:'@ai-workbench/connect',factory:(require)=>{
|
|
|
9
9
|
"enrollmentKeyMissing": "These connection files are missing setup credentials. Ask your administrator to complete them.",
|
|
10
10
|
"imported": "Connection files imported. Network readiness must still be confirmed.",
|
|
11
11
|
"importHelp": "Ask your administrator for your private connection files folder, then choose it here.",
|
|
12
|
-
"enrollmentUnknown": "The previous setup result is unknown. Contact your administrator; connection files will not be submitted again.",
|
|
13
12
|
"enrollmentRejected": "The device setup is no longer valid. Contact your administrator; submission has stopped.",
|
|
14
13
|
"importInvalid": "These connection files could not be verified. Ask your administrator for a valid folder.",
|
|
15
14
|
"workspaceBlocked": "Remote workspaces could not be loaded. Contact your administrator.",
|
|
@@ -47,8 +46,8 @@ window.__ModuleLoader__.load({id:'@ai-workbench/connect',factory:(require)=>{
|
|
|
47
46
|
"enrollmentKeyMissing": "这份连接资料缺少开通凭据,请联系管理员补齐。",
|
|
48
47
|
"imported": "连接资料已导入,仍需确认网络是否就绪。",
|
|
49
48
|
"importHelp": "请向管理员领取你的私密连接资料文件夹,然后选择该文件夹。",
|
|
50
|
-
"
|
|
51
|
-
"enrollmentRejected": "
|
|
49
|
+
"enrollmentKeyRejected": "开通链接已失效,请向管理员领取新的。",
|
|
50
|
+
"enrollmentRejected": "已存设备身份已失效,请联系管理员处理。",
|
|
52
51
|
"importInvalid": "这份连接资料无法通过检查,请向管理员领取有效的文件夹。",
|
|
53
52
|
"workspaceBlocked": "远程工作区暂时无法载入,请查看技术详情。",
|
|
54
53
|
"workspaceSyncing": "正在更新远程工作区…",
|
|
@@ -78,7 +77,7 @@ window.__ModuleLoader__.load({id:'@ai-workbench/connect',factory:(require)=>{
|
|
|
78
77
|
"actionFailed": "操作未能完成,请查看技术详情。"
|
|
79
78
|
}
|
|
80
79
|
};
|
|
81
|
-
const needKey=code=>code==='
|
|
80
|
+
const needKey=code=>code==='ENROLLMENT_KEY_REJECTED'?'enrollmentKeyRejected':code==='ENROLLMENT_REJECTED'?'enrollmentRejected':code==='CONNECTION_UNKNOWN'?'unknown':code==='ENROLLMENT_INVALID'?'importInvalid':code==='DEPENDENCY_REQUIRED'?'notReady':['ENROLLMENT_REQUIRED','NETWORK_KEY_INVALID'].includes(code)?'enrollment':code==='SETTINGS_REQUIRED'?'settings':code==='LOGIN_FAILED'?'loginFailed':code==='POLICY_DENIED'?'denied':code==='LOGIN_PROMPT_INVALID'?'stale':code==='ACTION_FAILED'?'actionFailed':'unavailable';
|
|
82
81
|
function messageKey(s){if(!s||s.phase==='checking')return 'checking';if(s.phase==='blocked'||s.phase==='disposed')return needKey(s.technicalDetails?.code);if(s.phase==='login-required')return 'loginRequired';if(s.phase==='authorizing')return 'authorizing';return Object.keys(s.providerNeeds??{}).length?'loginUnknown':'complete';}
|
|
83
82
|
function createWorkbenchController(call,subscribe){
|
|
84
83
|
let state={value:undefined,error:'',reconfirming:false},disposed=false,started=false,off,revision=-1,instance,eventVersion=0;let download,componentSource,workspaceLocations;const retiredLocations=new Set();const retiredSources=new Set(),retiredDownloads=new Set(),retired=new Set(),listeners=new Set();
|
|
@@ -99,7 +98,7 @@ window.__ModuleLoader__.load({id:'@ai-workbench/connect',factory:(require)=>{
|
|
|
99
98
|
function isLoginQuestion(state){const s=state?.startup;return s?.phase==='login-required'&&s.requestId&&s.provider&&s.logins?.[s.provider]===false&&!s.checkingProviders?.includes(s.provider)&&!s.providerNeeds?.[s.provider];}
|
|
100
99
|
function Details({state,error,t}){return h('details',null,h('summary',null,t('details')),h('pre',null,JSON.stringify({actionErrorCode:error||state?.actionErrorCode,enrollment:state?.enrollment,actionError:state?.actionError,inventory:state?.inventory,network:state?.network,connection:state?.connection,connectionMessageSettings:state?.connectionMessageSettings,connect:state?.connect,workspaces:state?.workspaces,checks:state?.startup?.technicalDetails,providerNeeds:state?.startup?.providerNeeds,queuedProviders:state?.startup?.queuedProviders,checkingProviders:state?.startup?.checkingProviders,loginComponent:state?.loginComponent},null,2)));}
|
|
101
100
|
function Choices({state,action,t}){if(!isLoginQuestion(state))return null;const brand=state.startup.provider==='claude'?'Claude':'Codex';return h('div',null,h('button',{type:'button',onClick:()=>void action('/respond/'+state.startup.requestId+'/authorize')},t('signIn',{brand})),h('button',{type:'button',onClick:()=>void action('/respond/'+state.startup.requestId+'/defer')},t('later')));}
|
|
102
|
-
function Enrollment({state,action,t}){const value=state?.enrollment;if(!value)return null;return h('div',null,h('p',null,t('importHelp')),value.phase==='imported'?h('p',null,t('imported')):h('button',{type:'button',disabled:value.phase==='importing'||['
|
|
101
|
+
function Enrollment({state,action,t}){const value=state?.enrollment;if(!value)return null;return h('div',null,h('p',null,t('importHelp')),value.phase==='imported'?h('p',null,t('imported')):h('button',{type:'button',disabled:value.phase==='importing'||['ENROLLMENT_KEY_REJECTED','ENROLLMENT_REJECTED'].includes(value.need?.code),onClick:()=>void action('/enrollment/import')},t(value.phase==='importing'?'importing':'import')));}
|
|
103
102
|
function DirectoryPermissions({permissions}){return h('p',null,...['read','write','execute'].map((key,index)=>(index?';':'')+({read:'读取',write:'写入',execute:'进入'}[key])+':'+(permissions?.[key]===true?'允许':permissions?.[key]===false?'不允许':'未知')),permissions?.reason?'('+permissions.reason+')':'');}
|
|
104
103
|
const sameLocationContext=(state,context)=>state?.instanceId===context.instanceId&&state?.epoch===context.epoch&&state.items?.some(item=>item.workspaceId===context.workspaceId&&item.bindingId===context.expectedBindingId);
|
|
105
104
|
function WorkspaceLocationRow({item,locations,workbench}){
|
|
@@ -135,7 +134,6 @@ window.__ModuleLoader__.load({id:'@ai-workbench/connect',factory:(require)=>{
|
|
|
135
134
|
if(lastOpen.current!==open){lastOpen.current=open;generation.current++;active.current=!!open;locked.current=false;savingRef.current=false;}
|
|
136
135
|
React.useEffect(()=>{live.current=true;return()=>{live.current=false;active.current=false;generation.current++;};},[]);
|
|
137
136
|
const current=at=>live.current&&active.current&&lastOpen.current&&at===generation.current;
|
|
138
|
-
const validPage=value=>value&&['local','host'].includes(value.target)&&typeof value.path==='string'&&Array.isArray(value.entries)&&typeof value.selectionToken==='string';
|
|
139
137
|
const commit=async(value,at)=>{savingRef.current=true;setSaving(true);const result=await workbench.selectWorkspaceDirectory({selectionToken:value.selectionToken});if(!current(at))return;
|
|
140
138
|
if(!result?.ok){setError(pickerNeedText(result?.error,'工作区未能添加,请重新选择。'));return;}
|
|
141
139
|
if(typeof result.value?.path!=='string'||!result.value.path||result.value.source!==value.target||typeof result.value.workspaceId!=='string'){setError('工作区选择结果无法核实,请重新选择。');return;}
|
|
@@ -146,22 +144,21 @@ window.__ModuleLoader__.load({id:'@ai-workbench/connect',factory:(require)=>{
|
|
|
146
144
|
if(!current(at)||chosen===null)return;
|
|
147
145
|
const result=await workbench.browseWorkspaceDirectories({target:'local',path:chosen});if(!current(at))return;
|
|
148
146
|
if(!result?.ok){setError(pickerNeedText(result?.error,'本机目录无法使用,请重新选择。'));return;}
|
|
149
|
-
if(!validPage(result.value)||result.value.target!=='local'){setError('本机目录响应无法核实,请重新选择。');return;}
|
|
150
147
|
await commit(result.value,at);
|
|
151
148
|
};
|
|
152
149
|
const browse=async(request={},append=false)=>{
|
|
153
150
|
if(!active.current||locked.current)return;locked.current=true;const at=generation.current,previous=page;setBusy(true);setError('');if(request.target){setTarget(request.target);setPage(null);}
|
|
154
|
-
try{const result=await workbench.browseWorkspaceDirectories(request);if(!current(at))return;if(!result?.ok){setError(pickerNeedText(result?.error,'目录无法读取,请检查连接。'));return;}const value=result.value;
|
|
151
|
+
try{if(request.target==='local'){await pickLocal(at);return;}const result=await workbench.browseWorkspaceDirectories(request);if(!current(at))return;if(!result?.ok){setError(pickerNeedText(result?.error,'目录无法读取,请检查连接。'));return;}const value=result.value;setTarget(value.target);
|
|
155
152
|
if(value.target==='local'){setPage(null);await pickLocal(at);}else setPage(append&&previous?.target==='host'&&previous.path===value.path?{...value,entries:[...previous.entries,...value.entries.filter(entry=>!previous.entries.some(old=>old.path===entry.path))]}:value);
|
|
156
153
|
}catch{if(current(at))setError(savingRef.current?'工作区添加结果无法确认,请查看工作区列表。':'目录无法读取,请检查连接。');}finally{if(current(at)){locked.current=false;savingRef.current=false;setSaving(false);setBusy(false);}}
|
|
157
154
|
};
|
|
158
|
-
React.useEffect(()=>{savingRef.current=false;setSaving(false);if(open){active.current=true;generation.current++;locked.current=false;setTarget(null);setPage(null);setError('');
|
|
155
|
+
React.useEffect(()=>{savingRef.current=false;setSaving(false);if(open){active.current=true;generation.current++;locked.current=false;setTarget(null);setPage(null);setError('');setBusy(false);}else{setPage(null);setError('');setBusy(false);}},[open]);
|
|
159
156
|
const cancel=()=>{if(!active.current||savingRef.current)return;active.current=false;generation.current++;locked.current=false;setPage(null);setBusy(false);outcome.current.onCancel();};
|
|
160
157
|
const select=async()=>{if(!active.current||locked.current||!page)return;locked.current=true;setBusy(true);setError('');const at=generation.current;try{await commit(page,at);}catch{if(current(at))setError('工作区添加结果无法确认,请查看工作区列表。');}finally{if(current(at)){locked.current=false;savingRef.current=false;setSaving(false);setBusy(false);}}};
|
|
161
|
-
const createFolder=async(name)=>{if(!active.current||locked.current||!page)return false;locked.current=true;savingRef.current=true;setBusy(true);setError('');const at=generation.current;try{const result=await workbench.createWorkspaceDirectory({selectionToken:page.selectionToken,name});if(!current(at))return false;if(!result?.ok){setError(pickerNeedText(result?.error,'文件夹未能创建,请查看当前目录。'));return false;}
|
|
158
|
+
const createFolder=async(name)=>{if(!active.current||locked.current||!page)return false;locked.current=true;savingRef.current=true;setBusy(true);setError('');const at=generation.current;try{const result=await workbench.createWorkspaceDirectory({selectionToken:page.selectionToken,name});if(!current(at))return false;if(!result?.ok){setError(pickerNeedText(result?.error,'文件夹未能创建,请查看当前目录。'));return false;}setPage(result.value);return true;}catch{if(current(at))setError('创建结果无法确认,请查看目录后再试。');return false;}finally{if(current(at)){locked.current=false;savingRef.current=false;setBusy(false);}}};
|
|
162
159
|
if(!open)return null;
|
|
163
160
|
return h('section',{role:'dialog','aria-modal':true,'aria-label':'选择工作区目录',style:{position:'fixed',inset:0,zIndex:100,background:'rgba(0,0,0,.25)',display:'flex',alignItems:'center',justifyContent:'center'}},h('div',{style:{background:'var(--background, Canvas)',color:'var(--foreground, CanvasText)',border:'1px solid var(--border, #ddd)',borderRadius:12,padding:24,width:'min(720px,90vw)',maxHeight:'85vh',overflow:'auto',boxShadow:'0 12px 40px rgba(0,0,0,.2)'}},h('h2',null,'选择工作区目录'),h('div',{'aria-label':'目录所在设备',style:{display:'flex',gap:8}},...['local','host'].map(value=>h('button',{key:value,type:'button',disabled:busy||creating,'aria-pressed':target===value,onClick:()=>browse({target:value})},value==='local'?'本机':'远程主机'))),
|
|
164
|
-
target==='host'?h(RemoteWorkspaceBrowser,{page,busy,error,browse,select,cancel,createFolder,saving,onCreateOpenChange:setCreating}):h(React.Fragment,null,h('p',{role:'status'},busy?saving?'正在添加工作区…':'请在系统窗口选择文件夹。':'本机文件夹使用系统目录选择框。'),error?h('p',{role:'alert'},error):null,h('button',{type:'button',disabled:busy,onClick:()=>browse({target:'local'})},'选择文件夹'),h('button',{type:'button',disabled:saving,onClick:cancel},'取消'))));
|
|
161
|
+
target===null?h(React.Fragment,null,h('p',null,'请选择目录所在设备。'),h('button',{type:'button',onClick:cancel},'取消')):target==='host'?h(RemoteWorkspaceBrowser,{page,busy,error,browse,select,cancel,createFolder,saving,onCreateOpenChange:setCreating}):h(React.Fragment,null,h('p',{role:'status'},busy?saving?'正在添加工作区…':'请在系统窗口选择文件夹。':'本机文件夹使用系统目录选择框。'),error?h('p',{role:'alert'},error):null,h('button',{type:'button',disabled:busy,onClick:()=>browse({target:'local'})},'选择文件夹'),h('button',{type:'button',disabled:saving,onClick:cancel},'取消'))));
|
|
165
162
|
}
|
|
166
163
|
function createWorkspaceDirectoryPickerRegistration(ctx,workbench){
|
|
167
164
|
const pickDirectory=()=>{const desktop=globalThis.__DSH_DIRECTORY_PICKER__;return desktop===undefined?ctx.uiWorkspace.pickDirectory():desktop.pick();};
|
|
@@ -184,7 +181,7 @@ window.__ModuleLoader__.load({id:'@ai-workbench/connect',factory:(require)=>{
|
|
|
184
181
|
return h('details',null,h('summary',null,'工作区文件来源'),h('p',null,'通过默认添加工作区,在同一个目录选择器中切换本机或远程主机并选定文件夹;远程目录无需另选本机文件夹。本节管理和刷新相同来源账本,不自动改绑已有工作区。'),h('p',null,'每轮开始核实所选目录;断线只使本轮失败,恢复后下一轮重新核实。文件和命令只在所选位置执行,换来源需新会话;权限跟随当前档位,凭据只保留在主机。技术日志尽力记录,写入失败不影响运行。'),h('button',{type:'button',disabled:refreshing,onClick:refresh},'刷新原生工作区列表'),error?h('p',{role:'alert'},error):null,locations.phase!=='ready'?h('p',{role:'status'},locations.need?.message||'工作区位置尚未核实。'):locations.items.length?locations.items.map(item=>h(WorkspaceLocationRow,{key:JSON.stringify([locations.instanceId,locations.epoch,item.workspaceId,item.bindingId,item.source,item.localPath]),item,locations,workbench})):h('p',null,'当前没有原生工作区,请先通过默认添加工作区选择文件夹。'));
|
|
185
182
|
}
|
|
186
183
|
function ComponentSource(){return h('p',null,'登录组件固定从 npmmirror 下载。');}
|
|
187
|
-
function DownloadProgress({state,action}){const d=state?.loginComponent?.download;const [,refresh]=React.useState(0),interval=state?.loginComponent?.observationIntervalMs,observing=d?.phase==='downloading'&&Number.isFinite(d.lastProgressAt);React.useEffect(()=>{if(!observing||!Number.isSafeInteger(interval)||interval<1||interval>2147483647)return;const timer=setInterval(()=>refresh(x=>x+1),interval);return()=>clearInterval(timer);},[observing,interval,d?.attemptId]);if(!d)return null;const seconds=Number.isFinite(d.lastProgressAt)?Math.max(0,Math.floor((Date.now()-d.lastProgressAt)/1000)):null;const text=d.phase==='downloading'?'正在从'+(d.sourceLabel||'所选地址')+'下载登录组件:已下载 '+d.receivedBytes+' 字节'+(d.totalBytes===null?'(总大小未知)':',共 '+d.totalBytes+' 字节')+
|
|
184
|
+
function DownloadProgress({state,action}){const d=state?.loginComponent?.download;const [,refresh]=React.useState(0),interval=state?.loginComponent?.observationIntervalMs,observing=d?.phase==='downloading'&&Number.isFinite(d.lastProgressAt);React.useEffect(()=>{if(!observing||!Number.isSafeInteger(interval)||interval<1||interval>2147483647)return;const timer=setInterval(()=>refresh(x=>x+1),interval);return()=>clearInterval(timer);},[observing,interval,d?.attemptId]);if(!d)return null;const seconds=Number.isFinite(d.lastProgressAt)?Math.max(0,Math.floor((Date.now()-d.lastProgressAt)/1000)):null;const text=d.phase==='downloading'?'正在从'+(d.sourceLabel||'所选地址')+'下载登录组件:已下载 '+d.receivedBytes+' 字节'+(d.totalBytes===null?'(总大小未知)':',共 '+d.totalBytes+' 字节')+(seconds===null?'':',已 '+seconds+' 秒无进展')+'。':d.phase==='verifying'?'正在校验登录组件…':d.phase==='unpacking'?'正在解压登录组件…':d.phase==='failed'?(typeof d.errorCode==='string'&&d.errorCode.startsWith('COMPONENT_DOWNLOAD_TLS_')?'连接被截获,可能连不上主机。':'登录组件准备失败,请查看技术详情;未重试或换源。'):d.phase==='cancelled'?'登录组件下载已取消。':null;return text?h(React.Fragment,null,h('p',{role:'status'},text),['downloading','verifying','unpacking'].includes(d.phase)&&d.attemptId?h('button',{type:'button',onClick:()=>void action('/component-download/cancel/'+d.attemptId)},'取消组件下载'):null):null;}
|
|
188
185
|
function ConversationLog({workbench}){
|
|
189
186
|
const [text,setText]=React.useState(''),[error,setError]=React.useState(''),[loading,setLoading]=React.useState(false),live=React.useRef(true),request=React.useRef(0);
|
|
190
187
|
React.useEffect(()=>()=>{live.current=false;},[]);
|
package/lib/api.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type * from './workspace-location-types.ts';
|
|
|
4
4
|
import type { LocalWorkspaceContextRequest, LocalWorkspaceContext } from './local-workspace-context.ts';
|
|
5
5
|
export type { LocalWorkspaceContextRequest, LocalWorkspaceContext, LocalWorkspaceProcess } from './local-workspace-context.ts';
|
|
6
6
|
export type Provider = 'claude' | 'codex';
|
|
7
|
-
export type NeedCode = 'WORKSPACE_PICKER_INVALID' | 'WORKSPACE_PICKER_STORAGE_FAILED' | 'WORKSPACE_PICKER_ROLLBACK_FAILED' | 'LOCAL_WORKSPACE_CONTEXT_UNSUPPORTED' | 'LOCAL_WORKSPACE_CONTEXT_UNAVAILABLE' | 'HOST_DIRECTORY_EXISTS' | 'HOST_DIRECTORY_INVALID' | 'HOST_DIRECTORY_UNREADABLE' | 'HOST_DIRECTORY_CHANGED' | 'HOST_DIRECTORY_PAGE_TOO_LARGE' | 'WORKSPACE_LOCATION_REQUIRED' | 'WORKSPACE_LOCATION_INVALID' | 'WORKSPACE_LOCATION_CONFLICT' | 'WORKSPACE_LOCATION_PROVIDER_REQUIRED' | 'WORKSPACE_EXECUTION_UNAVAILABLE' | 'WORKSPACE_LOCATION_STORAGE_FAILED' | 'REMOTE_DETAIL_STORAGE_FAILED' | 'MODEL_CATALOG_CONTEXT_INVALID' | 'ACTIVATION_CONFLICT' | 'ACTIVATION_CANCELLED' | 'ENROLLMENT_CLEANUP_UNBOUND' | 'ENROLLMENT_CLEANUP_FAILED' | 'ENROLLMENT_MISMATCH' | 'LOCAL_STATE_INVALID' | 'ALREADY_RUNNING' | 'ENROLLMENT_RECEIPT_REQUIRED' | 'CONTROL_PROTOCOL_INVALID' | 'HELPER_HANDOFF_FAILED' | 'HELPER_SHUTDOWN_FORCED' | '
|
|
7
|
+
export type NeedCode = 'WORKSPACE_PICKER_INVALID' | 'WORKSPACE_PICKER_STORAGE_FAILED' | 'WORKSPACE_PICKER_ROLLBACK_FAILED' | 'LOCAL_WORKSPACE_CONTEXT_UNSUPPORTED' | 'LOCAL_WORKSPACE_CONTEXT_UNAVAILABLE' | 'HOST_DIRECTORY_EXISTS' | 'HOST_DIRECTORY_INVALID' | 'HOST_DIRECTORY_UNREADABLE' | 'HOST_DIRECTORY_CHANGED' | 'HOST_DIRECTORY_PAGE_TOO_LARGE' | 'WORKSPACE_LOCATION_REQUIRED' | 'WORKSPACE_LOCATION_INVALID' | 'WORKSPACE_LOCATION_CONFLICT' | 'WORKSPACE_LOCATION_PROVIDER_REQUIRED' | 'WORKSPACE_EXECUTION_UNAVAILABLE' | 'WORKSPACE_LOCATION_STORAGE_FAILED' | 'REMOTE_DETAIL_STORAGE_FAILED' | 'MODEL_CATALOG_CONTEXT_INVALID' | 'ACTIVATION_CONFLICT' | 'ACTIVATION_CANCELLED' | 'ENROLLMENT_CLEANUP_UNBOUND' | 'ENROLLMENT_CLEANUP_FAILED' | 'ENROLLMENT_MISMATCH' | 'LOCAL_STATE_INVALID' | 'ALREADY_RUNNING' | 'ENROLLMENT_RECEIPT_REQUIRED' | 'CONTROL_PROTOCOL_INVALID' | 'HELPER_HANDOFF_FAILED' | 'HELPER_SHUTDOWN_FORCED' | 'ENROLLMENT_KEY_REJECTED' | 'ENROLLMENT_REJECTED' | 'ENROLLMENT_REQUIRED' | 'ENROLLMENT_INVALID' | 'NETWORK_KEY_INVALID' | 'HOST_OFFLINE' | 'EMPLOYEE_MISSING' | 'SSH_FAILED' | 'LOGIN_REQUIRED' | 'POLICY_DENIED' | 'CONNECTION_LOST' | 'DEPENDENCY_REQUIRED' | 'SETTINGS_REQUIRED' | 'AUTH_STATUS_INVALID' | 'LOGIN_FAILED' | 'LOGIN_PROMPT_INVALID' | 'DISPOSED' | 'HOST_TRUST_REQUIRED' | 'HOST_KEY_MISMATCH' | 'PROJECT_PROTOCOL_INVALID' | 'PROJECT_BINDING_REQUIRED' | 'PROJECT_BINDING_INVALID';
|
|
8
8
|
export interface ConnectNeed {
|
|
9
9
|
code: NeedCode;
|
|
10
10
|
layer: 'enrollment' | 'network' | 'ssh' | 'auth' | 'integration' | 'settings' | 'projects';
|
package/lib/defaults.d.ts
CHANGED
|
@@ -15,18 +15,15 @@ export declare const ELECTRON_PIN: Readonly<{
|
|
|
15
15
|
executable: "Electron.app/Contents/MacOS/Electron";
|
|
16
16
|
}>;
|
|
17
17
|
export declare const NETWORK_DEFAULTS: Readonly<{
|
|
18
|
-
proxyListen: "127.0.0.1:0";
|
|
19
18
|
logUpload: false;
|
|
20
19
|
statusRefreshIntervalSeconds: 2;
|
|
21
20
|
dialTimeoutSeconds: 20;
|
|
22
21
|
headerTimeoutSeconds: 10;
|
|
23
22
|
enrollmentObservationSeconds: 30;
|
|
24
23
|
httpMaxHeaderBytes: 1048576;
|
|
25
|
-
httpMaxResponseHeaderBytes: 1048576;
|
|
26
24
|
startupObservationSeconds: 35;
|
|
27
25
|
shutdownObservationSeconds: 10;
|
|
28
26
|
controlResponseMaxBytes: 65536;
|
|
29
|
-
downloadMaxRedirects: 3;
|
|
30
27
|
}>;
|
|
31
28
|
export declare const WORKSPACE_LOCATION_DEFAULTS: {
|
|
32
29
|
readonly pageSize: 100;
|
package/lib/defaults.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Owner-approved technical settings (2026-10-20, part two). One source for schema and composition.
|
|
2
2
|
export const L_DEFAULTS = Object.freeze({ enrollmentMetadataMaxBytes: 1048576, commandOutputMaxBytes: 1048576, remoteKillGraceMs: 1000, componentDownloadMaxRedirects: 3, componentObservationIntervalMs: 1000, maxDownloadBytes: 200000000, maxExtractedBytes: 600000000, loginOutputMaxBytes: 1048576, ipcMaxBytes: 1048576 });
|
|
3
3
|
export const ELECTRON_PIN = Object.freeze({ source: 'https://github.com/electron/electron/releases/download/v44.0.0/electron-v44.0.0-darwin-arm64.zip', sha256: '076d79742986e1b100b69ebecc691cb07368045e54c9087cef631b8622b76a80', executable: 'Electron.app/Contents/MacOS/Electron' });
|
|
4
|
-
export const NETWORK_DEFAULTS = Object.freeze({
|
|
4
|
+
export const NETWORK_DEFAULTS = Object.freeze({ logUpload: false, statusRefreshIntervalSeconds: 2, dialTimeoutSeconds: 20, headerTimeoutSeconds: 10, enrollmentObservationSeconds: 30, httpMaxHeaderBytes: 1048576, startupObservationSeconds: 35, shutdownObservationSeconds: 10, controlResponseMaxBytes: 65536 });
|
|
5
5
|
export const WORKSPACE_LOCATION_DEFAULTS = { pageSize: 100 };
|
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { Ports } from './ports.ts';
|
|
|
6
6
|
import { type ComponentInventory } from './components.ts';
|
|
7
7
|
import type { NetworkSettings } from './network.ts';
|
|
8
8
|
import type { AssemblySettings } from './profile-activation.ts';
|
|
9
|
-
export { writeNetworkConfig
|
|
9
|
+
export { writeNetworkConfig } from './network.ts';
|
|
10
10
|
export type * from './api.ts';
|
|
11
11
|
export { createConnect } from './connect.ts';
|
|
12
12
|
export { sshArgs } from './ssh.ts';
|
|
@@ -38,7 +38,7 @@ export interface Config {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
export declare const Config: z<Config>;
|
|
41
|
-
export declare function register(ctx: Context, ports: Ports, _inventory?: ComponentInventory, extend?: (api: import('./api.ts').ConnectApi) => void): void;
|
|
41
|
+
export declare function register(ctx: Context, ports: Ports, _inventory?: ComponentInventory, extend?: (api: import('./api.ts').ConnectApi) => void, autoStart?: boolean): void;
|
|
42
42
|
export declare function apply(ctx: Context, config?: Config): void;
|
|
43
43
|
export { createProfileEnrollment } from './profile-enrollment.ts';
|
|
44
44
|
export { profileSettings } from './profile-settings.ts';
|
package/lib/index.js
CHANGED
|
@@ -9,11 +9,11 @@ import { createComponentSources } from "./component-source.js";
|
|
|
9
9
|
import { createComponentProgress } from "./component-download.js";
|
|
10
10
|
import { L_DEFAULTS, NETWORK_DEFAULTS } from "./defaults.js";
|
|
11
11
|
import { registerComponents } from "./components.js";
|
|
12
|
-
export { writeNetworkConfig
|
|
12
|
+
export { writeNetworkConfig } from "./network.js";
|
|
13
13
|
export { createConnect } from "./connect.js";
|
|
14
14
|
export { sshArgs } from "./ssh.js";
|
|
15
15
|
export const name = 'ai-workbench-connect';
|
|
16
|
-
export const inject = ['aiWorkbenchNetwork'];
|
|
16
|
+
export const inject = ['aiWorkbenchNetwork', 'profileContext'];
|
|
17
17
|
const positive = () => z.number().step(1).min(1);
|
|
18
18
|
// Administrator settings are optional in schema so the loaded service can explain missing prerequisites.
|
|
19
19
|
// aiWorkbenchNetwork itself is a required Cordis injection; missing N holds this module from loading.
|
|
@@ -26,23 +26,24 @@ export const Config = z.object({
|
|
|
26
26
|
enrollmentPackageDir: z.string().description('连接资料目录:由管理员安装时配置,员工无需手填'),
|
|
27
27
|
trustDir: z.string().description('主机信任缓存目录:由管理员安装时配置'),
|
|
28
28
|
commandOutputMaxBytes: positive().default(L_DEFAULTS.commandOutputMaxBytes).description('远程命令输出内存上限(字节),默认1048576,管理员可修改'),
|
|
29
|
-
network: z.object({ executable: z.string(), runtimeDir: z.string(), stateDir: z.string(), configFile: z.string(), helperLogFile: z.string(), nodeName: z.string(), startupObservationSeconds: z.number().min(0.001).max(2147483.647).default(NETWORK_DEFAULTS.startupObservationSeconds), shutdownObservationSeconds: z.number().min(0.001).max(2147483.647).default(NETWORK_DEFAULTS.shutdownObservationSeconds), controlResponseMaxBytes: positive().default(NETWORK_DEFAULTS.controlResponseMaxBytes),
|
|
29
|
+
network: z.object({ executable: z.string(), runtimeDir: z.string(), stateDir: z.string(), configFile: z.string(), helperLogFile: z.string(), nodeName: z.string(), startupObservationSeconds: z.number().min(0.001).max(2147483.647).default(NETWORK_DEFAULTS.startupObservationSeconds), shutdownObservationSeconds: z.number().min(0.001).max(2147483.647).default(NETWORK_DEFAULTS.shutdownObservationSeconds), controlResponseMaxBytes: positive().default(NETWORK_DEFAULTS.controlResponseMaxBytes), logUpload: z.boolean().default(NETWORK_DEFAULTS.logUpload), statusRefreshIntervalSeconds: z.number().min(0.001).max(2147483.647).default(NETWORK_DEFAULTS.statusRefreshIntervalSeconds), dialTimeoutSeconds: z.number().min(1e-9).default(NETWORK_DEFAULTS.dialTimeoutSeconds), headerTimeoutSeconds: z.number().min(0.001).max(2147483.647).default(NETWORK_DEFAULTS.headerTimeoutSeconds), enrollmentObservationSeconds: z.number().min(1e-9).default(NETWORK_DEFAULTS.enrollmentObservationSeconds), httpMaxHeaderBytes: positive().default(NETWORK_DEFAULTS.httpMaxHeaderBytes), controlMaxBytes: positive() }).description('远程网络连接设置:使用默认技术参数,管理员可修改;路径根据当前用户和应用配置目录生成,员工无需填写'),
|
|
30
30
|
helper: z.object({
|
|
31
31
|
componentObservationIntervalMs: z.number().step(1).min(1).max(2147483647).default(L_DEFAULTS.componentObservationIntervalMs).description('无进展观察刷新间隔毫秒,默认1000;只刷新秒数,不超时/重试/换源'),
|
|
32
32
|
componentDownloadMaxRedirects: z.number().step(1).min(0).default(L_DEFAULTS.componentDownloadMaxRedirects).description('组件直接HTTPS下载的重定向次数上限;默认3,0拒绝重定向;管理员可改,不改变网页登录网络'),
|
|
33
33
|
remoteKillGraceMs: z.number().step(1).min(0).max(2147483647).default(L_DEFAULTS.remoteKillGraceMs).description('远端本轮登录进程组结束宽限毫秒;默认1000,0立即KILL,管理员可改'),
|
|
34
|
-
maxRedirects: z.number().step(1).min(0).description('
|
|
34
|
+
maxRedirects: z.number().step(1).min(0).description('兼容旧配置;此项不再生效'),
|
|
35
35
|
sha256: z.string().description('darwin-arm64默认使用Electron 44.0.0对应的下载SHA256;管理员可改,必须校验'),
|
|
36
36
|
cacheDir: z.string().description('默认从当前profile自动派生ai-workbench-connect/login-component-cache;管理员可改,员工不填路径'), maxDownloadBytes: positive().default(L_DEFAULTS.maxDownloadBytes).description('下载字节上限;默认200000000,管理员可改'), maxExtractedBytes: positive().default(L_DEFAULTS.maxExtractedBytes).description('解压字节上限;默认600000000,管理员可改'),
|
|
37
37
|
executable: z.string().description('darwin-arm64默认Electron.app/Contents/MacOS/Electron;其他平台无默认,管理员可改'), loginOutputMaxBytes: positive().default(L_DEFAULTS.loginOutputMaxBytes).description('登录进程输出字节上限;默认1048576,管理员可改'), ipcMaxBytes: positive().default(L_DEFAULTS.ipcMaxBytes).description('私有IPC字节上限;默认1048576,管理员可改'),
|
|
38
38
|
}),
|
|
39
39
|
});
|
|
40
|
-
export function register(ctx, ports, _inventory, extend) {
|
|
40
|
+
export function register(ctx, ports, _inventory, extend, autoStart = true) {
|
|
41
41
|
// 当前独立插件始终检查两品牌;保留旧inventory参数兼容调用,但不以交付清单开关能力。
|
|
42
42
|
const api = createConnect(ports, state => ctx.emit('ai-workbench/connect-state', state), { onConnectionState: state => ctx.emit('ai-workbench/connection-state', state), onPromptState: state => ctx.emit('ai-workbench/login-prompt-state', state), onPromptResult: result => ctx.emit('ai-workbench/login-prompt-result', result) });
|
|
43
43
|
extend?.(api);
|
|
44
44
|
ctx.provide('aiWorkbenchConnect', api);
|
|
45
|
-
ctx.effect(() => {
|
|
45
|
+
ctx.effect(() => { if (autoStart)
|
|
46
|
+
void api.refreshLoginPrompts(); return () => api.dispose(); });
|
|
46
47
|
}
|
|
47
48
|
export function apply(ctx, config = {}) {
|
|
48
49
|
config = profileSettings(config, ctx.get('profileContext')?.dir);
|
|
@@ -50,7 +51,7 @@ export function apply(ctx, config = {}) {
|
|
|
50
51
|
const sources = createComponentSources({ sha256: config.helper?.sha256 });
|
|
51
52
|
ctx.effect(() => () => sources.dispose());
|
|
52
53
|
const ports = configuredPorts(config, network, component, sources);
|
|
53
|
-
register(ctx, ports, config.inventory, api => attachProfileRuntime(ctx, api, ports, config, network));
|
|
54
|
+
register(ctx, ports, config.inventory, api => attachProfileRuntime(ctx, api, ports, config, network, true), false);
|
|
54
55
|
registerComponents(ctx, config.inventory, config.helper?.cacheDir, component, sources, config.helper?.componentObservationIntervalMs, config.enrollmentMetadataMaxBytes ?? L_DEFAULTS.enrollmentMetadataMaxBytes);
|
|
55
56
|
}
|
|
56
57
|
export { createProfileEnrollment } from "./profile-enrollment.js";
|
package/lib/integration.js
CHANGED
|
@@ -67,7 +67,6 @@ export function configuredPorts(config, provider, component = createComponentPro
|
|
|
67
67
|
}
|
|
68
68
|
return runLogin(target, provider, {
|
|
69
69
|
start: (t, p, s) => createRemoteLogin('ssh', [...sshArgs(t), remoteLoginCommand(p, h.remoteKillGraceMs)], p, h.loginOutputMaxBytes, s, 'remote-control'),
|
|
70
|
-
acquireProxy: (_t, s) => network.acquireProxy(s),
|
|
71
70
|
open: (boot, onCode, s) => launchElectron({ executable: result.value, entry: fileURLToPath(new URL('../helper/main.cjs', import.meta.url)), cacheDir: h.cacheDir, ipcMaxBytes: h.ipcMaxBytes }, boot, onCode, s),
|
|
72
71
|
}, signal);
|
|
73
72
|
} };
|
package/lib/login.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import type { Provider, Result, SshTarget } from './api.ts';
|
|
2
|
-
export interface ProxyLease {
|
|
3
|
-
url: string;
|
|
4
|
-
username: string;
|
|
5
|
-
password: string;
|
|
6
|
-
closed?: Promise<void>;
|
|
7
|
-
release(): Promise<void>;
|
|
8
|
-
}
|
|
9
2
|
export type LoginBoot = {
|
|
10
3
|
provider: 'claude';
|
|
11
4
|
url: string;
|
|
@@ -32,7 +25,6 @@ export interface LoginWindow {
|
|
|
32
25
|
}
|
|
33
26
|
export interface LoginPorts {
|
|
34
27
|
start(t: SshTarget, p: Provider, s: AbortSignal): Promise<RemoteLogin>;
|
|
35
|
-
acquireProxy(t: SshTarget, s: AbortSignal): Promise<ProxyLease>;
|
|
36
28
|
open(boot: LoginBoot, onCode: (code: string) => Promise<void>, s: AbortSignal): Promise<LoginWindow>;
|
|
37
29
|
}
|
|
38
30
|
export declare function extractLoginUrl(provider: Provider, text: string): string | undefined;
|
package/lib/needs.js
CHANGED
|
@@ -28,8 +28,8 @@ const entries = {
|
|
|
28
28
|
CONTROL_PROTOCOL_INVALID: { layer: 'network', message: '网络组件接口不匹配,已停止操作,请联系管理员。', requires: '匹配版本的网络组件接口', actor: 'administrator', action: { id: 'inspect-network-enrollment', label: '联系管理员', available: false } },
|
|
29
29
|
HELPER_HANDOFF_FAILED: { layer: 'network', message: '网络组件交接未完成,请联系管理员。', requires: '完成网络组件交接', actor: 'administrator', action: { id: 'inspect-network-enrollment', label: '联系管理员', available: false } },
|
|
30
30
|
HELPER_SHUTDOWN_FORCED: { layer: 'network', message: '网络组件未能正常退出,请联系管理员核实状态。', requires: '核实网络组件退出状态', actor: 'administrator', action: { id: 'inspect-network-enrollment', label: '联系管理员', available: false } },
|
|
31
|
-
|
|
32
|
-
ENROLLMENT_REJECTED: { layer: 'enrollment', message: '
|
|
31
|
+
ENROLLMENT_KEY_REJECTED: { layer: 'enrollment', message: '开通链接已失效,请向管理员领取新的。', requires: '新的开通链接', actor: 'administrator', action: { id: 'renew-enrollment', label: '联系管理员', available: false } },
|
|
32
|
+
ENROLLMENT_REJECTED: { layer: 'enrollment', message: '已存设备身份已失效,请联系管理员处理。', requires: '管理员处理已失效的设备身份', actor: 'administrator', action: { id: 'check-enrollment-result', label: '联系管理员', available: false } },
|
|
33
33
|
ENROLLMENT_REQUIRED: { layer: 'enrollment', message: '我需要开通链接,请联系管理员发放。', requires: '开通文件', actor: 'administrator', action: { id: 'request-enrollment', label: '联系管理员开通', available: false } },
|
|
34
34
|
ENROLLMENT_INVALID: { layer: 'enrollment', message: '开通文件无效,我需要管理员重新发放。', requires: '有效开通文件', actor: 'administrator', action: { id: 'request-enrollment', label: '重新开通', available: false } },
|
|
35
35
|
NETWORK_KEY_INVALID: { layer: 'network', message: '员工开通已失效,请联系管理员重新发放开通链接。', requires: '新的开通链接', actor: 'administrator', action: { id: 'request-enrollment', label: '联系管理员', available: false } },
|
|
@@ -41,7 +41,7 @@ const entries = {
|
|
|
41
41
|
POLICY_DENIED: { layer: 'auth', message: '公司的 AI 席位设置不允许此操作,需要 AI 账号管理员开启。', requires: '允许此操作的 AI 席位设置', actor: 'ai-administrator', action: { id: 'contact-ai-administrator', label: '联系 AI 账号管理员', available: false } },
|
|
42
42
|
CONNECTION_LOST: { layer: 'network', message: '连接中断,正在等待网络恢复信号,恢复后将重新连接。', requires: '网络恢复', actor: 'plugin', action: { id: 'await-network', label: '等待网络恢复', available: false } },
|
|
43
43
|
DEPENDENCY_REQUIRED: { layer: 'integration', message: '远程主机连接的连接组件没有装好,请联系管理员。', requires: '提供方契约与适配器', actor: 'administrator', action: { id: 'supply-dependency', label: '提供集成前置条件', available: false } },
|
|
44
|
-
SETTINGS_REQUIRED: { layer: 'settings', message: '
|
|
44
|
+
SETTINGS_REQUIRED: { layer: 'settings', message: '远程主机连接设置暂不可用,请查看技术详情。', requires: '已确认的连接设置', actor: 'administrator', action: { id: 'configure-settings', label: '确认具名设置', available: false } },
|
|
45
45
|
AUTH_STATUS_INVALID: { layer: 'auth', message: '暂时无法确认登录状态,可检查本机网络后重新检查。', requires: '有效的官方 CLI 登录状态', actor: 'administrator', action: { id: 'inspect-auth-status', label: '检查官方 CLI', available: false } },
|
|
46
46
|
LOGIN_FAILED: { layer: 'auth', message: '登录未完成,窗口已关闭或助手失败,可以重新授权。', requires: '完成 AI 授权', actor: 'employee', action: { id: 'open-login', label: '重新授权', available: true } },
|
|
47
47
|
HOST_TRUST_REQUIRED: { layer: 'ssh', message: '远程主机连接还缺少可信的连接信息,请联系管理员。', requires: 'host.knownHosts', actor: 'administrator', action: { id: 'supply-host-trust', label: '提供主机信任材料', available: false } },
|
package/lib/network.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import type { Enrollment, NetworkEvent } from './ports.ts';
|
|
2
2
|
import type { Result } from './api.ts';
|
|
3
|
-
import type { ProxyLease } from './login.ts';
|
|
4
3
|
export interface NetworkSettings {
|
|
5
4
|
executable?: string;
|
|
6
5
|
runtimeDir?: string;
|
|
7
6
|
stateDir?: string;
|
|
8
|
-
proxyListen?: string;
|
|
9
7
|
logUpload?: boolean;
|
|
10
8
|
statusRefreshIntervalSeconds?: number;
|
|
11
9
|
dialTimeoutSeconds?: number;
|
|
12
10
|
headerTimeoutSeconds?: number;
|
|
13
11
|
enrollmentObservationSeconds?: number;
|
|
14
12
|
httpMaxHeaderBytes?: number;
|
|
15
|
-
httpMaxResponseHeaderBytes?: number;
|
|
16
13
|
controlMaxBytes?: number;
|
|
17
14
|
}
|
|
18
15
|
export declare function writeNetworkConfig(file: string, e: Enrollment, s: NetworkSettings): Promise<Result<void>>;
|
|
@@ -21,6 +18,5 @@ export declare function createNetworkClient(s: NetworkSettings): {
|
|
|
21
18
|
proxyCommand: string;
|
|
22
19
|
}>>;
|
|
23
20
|
onState(listener: (event: NetworkEvent) => void): () => void;
|
|
24
|
-
acquireProxy(signal: AbortSignal): Promise<ProxyLease>;
|
|
25
21
|
dispose(): void;
|
|
26
22
|
};
|
package/lib/network.js
CHANGED
|
@@ -2,20 +2,19 @@ import { request } from 'node:http';
|
|
|
2
2
|
import { lstat, writeFile, rename, rm } from 'node:fs/promises';
|
|
3
3
|
import { join, dirname, isAbsolute } from 'node:path';
|
|
4
4
|
import { hostname } from 'node:os';
|
|
5
|
-
import { StringDecoder } from 'node:string_decoder';
|
|
6
5
|
import { randomUUID } from 'node:crypto';
|
|
7
6
|
import { need, dependency, ok, fail, NeedError } from "./needs.js";
|
|
8
7
|
import { privateDirectory } from "./private-files.js";
|
|
9
8
|
import { proxyCommand } from "./ssh.js";
|
|
10
|
-
function valid(s) { return [s.executable, s.runtimeDir, s.stateDir].every(p => typeof p === 'string' && isAbsolute(p) && !/[\x00-\x1f\x7f]/.test(p)) &&
|
|
11
|
-
function mapped(code) { return { NEED_ENROLLMENT: 'ENROLLMENT_REQUIRED', ENROLLMENT_REJECTED: '
|
|
9
|
+
function valid(s) { return [s.executable, s.runtimeDir, s.stateDir].every(p => typeof p === 'string' && isAbsolute(p) && !/[\x00-\x1f\x7f]/.test(p)) && s.logUpload === false && [s.statusRefreshIntervalSeconds, s.dialTimeoutSeconds, s.headerTimeoutSeconds, s.enrollmentObservationSeconds].every(n => typeof n === 'number' && Number.isFinite(n) && n >= 1e-9 && n <= 9223372036) && [s.statusRefreshIntervalSeconds, s.headerTimeoutSeconds].every(n => Number.isInteger(n * 1000) && n * 1000 >= 1 && n * 1000 <= 2147483647) && [s.httpMaxHeaderBytes].every(n => Number.isSafeInteger(n) && n > 0) && Number.isSafeInteger(s.controlMaxBytes) && s.controlMaxBytes > 0 && s.controlMaxBytes <= 2147483647; }
|
|
10
|
+
function mapped(code) { return { NEED_ENROLLMENT: 'ENROLLMENT_REQUIRED', ENROLLMENT_REJECTED: 'ENROLLMENT_REJECTED', ENROLLMENT_KEY_REJECTED: 'ENROLLMENT_KEY_REJECTED', LOCAL_STATE_INVALID: 'ENROLLMENT_INVALID', HOST_OFFLINE: 'HOST_OFFLINE', HOST_NOT_VISIBLE: 'DEPENDENCY_REQUIRED', CONFIG_INVALID: 'SETTINGS_REQUIRED', CAPABILITY_NOT_IMPLEMENTED: 'DEPENDENCY_REQUIRED', NEED_HOST_CONTRACT: 'DEPENDENCY_REQUIRED', NETWORK_INTERRUPTED: 'CONNECTION_LOST', CONTROL_UNAVAILABLE: 'DEPENDENCY_REQUIRED' }[String(code)] ?? 'DEPENDENCY_REQUIRED'; }
|
|
12
11
|
export async function writeNetworkConfig(file, e, s) {
|
|
13
12
|
if (!valid(s) || !isAbsolute(file))
|
|
14
13
|
return fail('SETTINGS_REQUIRED');
|
|
15
14
|
let temp;
|
|
16
15
|
try {
|
|
17
16
|
await privateDirectory(dirname(file));
|
|
18
|
-
const config = { apiVersion: 1, stateDir: s.stateDir, runtimeDir: s.runtimeDir, nodeName: `aw-${e.username}-${hostname()}-${process.getuid()}`, ...(e.authKeyFile ? { authKeyFile: e.authKeyFile } : {}), host: { name: e.host, sshPort: e.port, employee: e.username, knownHostsFile: e.knownHostsFile },
|
|
17
|
+
const config = { apiVersion: 1, stateDir: s.stateDir, runtimeDir: s.runtimeDir, nodeName: `aw-${e.username}-${hostname()}-${process.getuid()}`, ...(e.authKeyFile ? { authKeyFile: e.authKeyFile } : {}), host: { name: e.host, sshPort: e.port, employee: e.username, knownHostsFile: e.knownHostsFile }, statusRefreshIntervalSeconds: s.statusRefreshIntervalSeconds, dialTimeoutSeconds: s.dialTimeoutSeconds, headerTimeoutSeconds: s.headerTimeoutSeconds, enrollmentObservationSeconds: s.enrollmentObservationSeconds, logUpload: s.logUpload, httpMaxHeaderBytes: s.httpMaxHeaderBytes };
|
|
19
18
|
temp = join(dirname(file), '.network-' + randomUUID());
|
|
20
19
|
await writeFile(temp, JSON.stringify(config), { flag: 'wx', mode: 0o600 });
|
|
21
20
|
await rename(temp, file);
|
|
@@ -81,7 +80,7 @@ export function createNetworkClient(s) {
|
|
|
81
80
|
return result;
|
|
82
81
|
}
|
|
83
82
|
if (v.enrollment !== 'online')
|
|
84
|
-
return fail(v.enrollment === 'needs_enrollment' ? 'ENROLLMENT_REQUIRED' : v.enrollment === 'rejected' ? '
|
|
83
|
+
return fail(v.enrollment === 'needs_enrollment' ? 'ENROLLMENT_REQUIRED' : v.enrollment === 'rejected' ? 'ENROLLMENT_REJECTED' : 'CONNECTION_LOST');
|
|
85
84
|
if (v.host?.name !== expected?.host)
|
|
86
85
|
return dependency('与开通主机匹配的 N 状态');
|
|
87
86
|
if (v.host.online === false) {
|
|
@@ -136,89 +135,6 @@ export function createNetworkClient(s) {
|
|
|
136
135
|
for (const c of pending)
|
|
137
136
|
c.abort();
|
|
138
137
|
} }; },
|
|
139
|
-
async acquireProxy(signal) {
|
|
140
|
-
const res = await send('POST', '/v1/login-proxy', signal);
|
|
141
|
-
if (res.statusCode !== 201) {
|
|
142
|
-
const v = await json(res);
|
|
143
|
-
if (v?.apiVersion !== 1)
|
|
144
|
-
bad('DEPENDENCY_REQUIRED');
|
|
145
|
-
bad(mapped(v.error?.code));
|
|
146
|
-
}
|
|
147
|
-
if (!String(res.headers['content-type']).startsWith('application/x-ndjson')) {
|
|
148
|
-
res.destroy();
|
|
149
|
-
bad('DEPENDENCY_REQUIRED');
|
|
150
|
-
}
|
|
151
|
-
let resolveLine = () => { }, rejectLine = () => { }, rejectClosed = () => { }, resolveClosed = () => { };
|
|
152
|
-
let text = '', size = 0, received = false, released = false;
|
|
153
|
-
const decoder = new StringDecoder('utf8');
|
|
154
|
-
const first = new Promise((yes, no) => { resolveLine = yes; rejectLine = no; });
|
|
155
|
-
const closed = new Promise((yes, no) => { resolveClosed = yes; rejectClosed = no; });
|
|
156
|
-
void closed.catch(() => { });
|
|
157
|
-
const lost = () => { if (!released) {
|
|
158
|
-
const e = new NeedError(need('CONNECTION_LOST'));
|
|
159
|
-
rejectLine(e);
|
|
160
|
-
rejectClosed(e);
|
|
161
|
-
} };
|
|
162
|
-
res.on('error', lost);
|
|
163
|
-
res.on('end', lost);
|
|
164
|
-
res.on('close', lost);
|
|
165
|
-
res.on('data', (chunk) => {
|
|
166
|
-
size += chunk.length;
|
|
167
|
-
if (size > s.controlMaxBytes) {
|
|
168
|
-
lost();
|
|
169
|
-
res.destroy();
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (received) {
|
|
173
|
-
if (chunk.toString().trim()) {
|
|
174
|
-
lost();
|
|
175
|
-
res.destroy();
|
|
176
|
-
}
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
text += decoder.write(chunk);
|
|
180
|
-
const end = text.indexOf('\n');
|
|
181
|
-
if (end < 0)
|
|
182
|
-
return;
|
|
183
|
-
received = true;
|
|
184
|
-
try {
|
|
185
|
-
const v = JSON.parse(text.slice(0, end)), url = new URL(v.url);
|
|
186
|
-
if (v.apiVersion !== 1 || typeof v.id !== 'string' || !/^[a-zA-Z0-9_-]+$/.test(v.id) || url.protocol !== 'http:' || url.hostname !== '127.0.0.1' || !url.port || url.username || url.password || url.pathname !== '/' || url.search || url.hash || !['username', 'password'].every(k => typeof v[k] === 'string' && v[k].length && !/[\x00-\x1f\x7f]/.test(v[k])) || text.slice(end + 1).trim())
|
|
187
|
-
throw Error();
|
|
188
|
-
resolveLine(v);
|
|
189
|
-
}
|
|
190
|
-
catch {
|
|
191
|
-
rejectLine(new NeedError(need('DEPENDENCY_REQUIRED')));
|
|
192
|
-
res.destroy();
|
|
193
|
-
}
|
|
194
|
-
finally {
|
|
195
|
-
text = '';
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
let v;
|
|
199
|
-
try {
|
|
200
|
-
v = await first;
|
|
201
|
-
}
|
|
202
|
-
catch (e) {
|
|
203
|
-
res.destroy();
|
|
204
|
-
throw e;
|
|
205
|
-
}
|
|
206
|
-
let release;
|
|
207
|
-
const lease = { url: v.url, username: v.username, password: v.password, closed, release: () => release ??= (async () => { released = true; res.destroy(); try {
|
|
208
|
-
const c = new AbortController();
|
|
209
|
-
const response = await send('DELETE', '/v1/login-proxy/' + encodeURIComponent(v.id), c.signal);
|
|
210
|
-
response.resume();
|
|
211
|
-
if (![204, 404].includes(response.statusCode))
|
|
212
|
-
bad('DEPENDENCY_REQUIRED');
|
|
213
|
-
}
|
|
214
|
-
finally {
|
|
215
|
-
lease.username = '';
|
|
216
|
-
lease.password = '';
|
|
217
|
-
v = null;
|
|
218
|
-
resolveClosed();
|
|
219
|
-
} })() };
|
|
220
|
-
return lease;
|
|
221
|
-
},
|
|
222
138
|
dispose() { disposed = true; if (timer)
|
|
223
139
|
clearInterval(timer); for (const c of pending)
|
|
224
140
|
c.abort(); listeners.clear(); },
|
|
@@ -7,18 +7,15 @@ export interface AssemblySettings {
|
|
|
7
7
|
stateDir?: string;
|
|
8
8
|
runtimeDir?: string;
|
|
9
9
|
nodeName?: string;
|
|
10
|
-
proxyListen?: string;
|
|
11
10
|
logUpload?: boolean;
|
|
12
11
|
statusRefreshIntervalSeconds?: number;
|
|
13
12
|
dialTimeoutSeconds?: number;
|
|
14
13
|
headerTimeoutSeconds?: number;
|
|
15
14
|
enrollmentObservationSeconds?: number;
|
|
16
15
|
httpMaxHeaderBytes?: number;
|
|
17
|
-
httpMaxResponseHeaderBytes?: number;
|
|
18
16
|
startupObservationSeconds?: number;
|
|
19
17
|
shutdownObservationSeconds?: number;
|
|
20
18
|
controlResponseMaxBytes?: number;
|
|
21
|
-
downloadMaxRedirects?: number;
|
|
22
19
|
}
|
|
23
20
|
interface Options {
|
|
24
21
|
profileDir: string;
|
|
@@ -50,14 +50,18 @@ export function createProfileActivation(options) {
|
|
|
50
50
|
if (await realpath(p) !== p)
|
|
51
51
|
return fail('ENROLLMENT_INVALID');
|
|
52
52
|
const s = { ...NETWORK_DEFAULTS, ...options.settings };
|
|
53
|
-
const settings = { configFile: s.configFile ?? join(configDir, 'config.json'), helperLogFile: s.helperLogFile ?? join(logDir, 'network.log'), startupObservationSeconds: s.startupObservationSeconds, shutdownObservationSeconds: s.shutdownObservationSeconds, controlResponseMaxBytes: s.controlResponseMaxBytes
|
|
53
|
+
const settings = { configFile: s.configFile ?? join(configDir, 'config.json'), helperLogFile: s.helperLogFile ?? join(logDir, 'network.log'), startupObservationSeconds: s.startupObservationSeconds, shutdownObservationSeconds: s.shutdownObservationSeconds, controlResponseMaxBytes: s.controlResponseMaxBytes };
|
|
54
54
|
const target = { host: e.host, username: e.username, port: e.port, knownHostsFile: e.knownHostsFile };
|
|
55
|
-
const expected = { apiVersion: 1, stateDir: s.stateDir ?? join(homedir(), 'Library', 'Application Support', 'ai-workbench', 'network'), runtimeDir: s.runtimeDir ?? '/tmp/aw-net-' + process.getuid(), nodeName: s.nodeName ?? `aw-${e.username}-${hostname()}-${process.getuid()}`, host: { name: e.host, sshPort: e.port, employee: e.username, knownHostsFile: e.knownHostsFile },
|
|
55
|
+
const expected = { apiVersion: 1, stateDir: s.stateDir ?? join(homedir(), 'Library', 'Application Support', 'ai-workbench', 'network'), runtimeDir: s.runtimeDir ?? '/tmp/aw-net-' + process.getuid(), nodeName: s.nodeName ?? `aw-${e.username}-${hostname()}-${process.getuid()}`, host: { name: e.host, sshPort: e.port, employee: e.username, knownHostsFile: e.knownHostsFile }, logUpload: s.logUpload, statusRefreshIntervalSeconds: s.statusRefreshIntervalSeconds, dialTimeoutSeconds: s.dialTimeoutSeconds, headerTimeoutSeconds: s.headerTimeoutSeconds, enrollmentObservationSeconds: s.enrollmentObservationSeconds, httpMaxHeaderBytes: s.httpMaxHeaderBytes };
|
|
56
56
|
const canonical = (v) => JSON.stringify(v, (_, x) => x && typeof x === 'object' && !Array.isArray(x) ? Object.fromEntries(Object.entries(x).sort(([a], [b]) => a.localeCompare(b))) : x);
|
|
57
57
|
const registration = { schemaVersion: 1, settings, target };
|
|
58
58
|
let stored = false;
|
|
59
59
|
try {
|
|
60
60
|
const r = JSON.parse(await readPrivate(recordFile, options.metadataMaxBytes));
|
|
61
|
+
if (r?.settings) {
|
|
62
|
+
delete r.settings.downloadMaxRedirects;
|
|
63
|
+
delete r.settings.httpMaxResponseHeaderBytes;
|
|
64
|
+
}
|
|
61
65
|
if (canonical(r) !== canonical(registration))
|
|
62
66
|
return fail('ENROLLMENT_MISMATCH');
|
|
63
67
|
stored = true;
|
|
@@ -70,6 +74,8 @@ export function createProfileActivation(options) {
|
|
|
70
74
|
const config = JSON.parse(await readPrivate(settings.configFile, options.metadataMaxBytes));
|
|
71
75
|
const key = config.authKeyFile;
|
|
72
76
|
delete config.authKeyFile;
|
|
77
|
+
delete config.proxyListen;
|
|
78
|
+
delete config.httpMaxResponseHeaderBytes;
|
|
73
79
|
if (canonical(config) !== canonical(expected) || (key !== undefined && key !== e.authKeyFile))
|
|
74
80
|
return fail('ENROLLMENT_MISMATCH');
|
|
75
81
|
if (!stored)
|
package/lib/profile-runtime.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import type { ConnectApi } from './api.ts';
|
|
|
3
3
|
import type { Ports } from './ports.ts';
|
|
4
4
|
import type { Config } from './index.ts';
|
|
5
5
|
import type { NetworkProvider } from './provider.ts';
|
|
6
|
-
export declare function attachProfileRuntime(ctx: Context, api: ConnectApi, ports: Ports, config: Config, network?: NetworkProvider): void;
|
|
6
|
+
export declare function attachProfileRuntime(ctx: Context, api: ConnectApi, ports: Ports, config: Config, network?: NetworkProvider, autoStart?: boolean): void;
|
package/lib/profile-runtime.js
CHANGED
|
@@ -8,17 +8,17 @@ import { createHostSessionProjects } from "./host-session-projects.js";
|
|
|
8
8
|
import { createConversationLog } from "./conversation-log.js";
|
|
9
9
|
import { L_DEFAULTS, WORKSPACE_LOCATION_DEFAULTS } from "./defaults.js";
|
|
10
10
|
import { fail } from "./needs.js";
|
|
11
|
-
export function attachProfileRuntime(ctx, api, ports, config, network) {
|
|
12
|
-
ctx.inject(['profileContext'], scope => attachScopedProfileRuntime(scope, api, ports, config, network));
|
|
11
|
+
export function attachProfileRuntime(ctx, api, ports, config, network, autoStart = false) {
|
|
12
|
+
ctx.inject(['profileContext'], scope => attachScopedProfileRuntime(scope, api, ports, config, network, autoStart));
|
|
13
13
|
}
|
|
14
|
-
function attachScopedProfileRuntime(ctx, api, ports, config, network) {
|
|
14
|
+
function attachScopedProfileRuntime(ctx, api, ports, config, network, autoStart = false) {
|
|
15
15
|
const profile = ctx.get('profileContext');
|
|
16
16
|
if (!profile || typeof profile.dir !== 'string')
|
|
17
17
|
return;
|
|
18
18
|
const activation = createProfileActivation({ profileDir: profile.dir, metadataMaxBytes: config.enrollmentMetadataMaxBytes ?? L_DEFAULTS.enrollmentMetadataMaxBytes, network, settings: config.network });
|
|
19
19
|
const manager = createProfileEnrollment({ profileDir: profile.dir, metadataMaxBytes: config.enrollmentMetadataMaxBytes ?? L_DEFAULTS.enrollmentMetadataMaxBytes,
|
|
20
20
|
pick: createNativeImportPicker(() => ctx.get('directoryPicker')),
|
|
21
|
-
blockedByNetwork: () => { const error = network?.getState().error; return error && ['
|
|
21
|
+
blockedByNetwork: () => { const error = network?.getState().error; return error && ['ENROLLMENT_KEY_REJECTED', 'ENROLLMENT_REJECTED', 'LOCAL_STATE_INVALID', 'ALREADY_RUNNING'].includes(error.code) ? mapNetworkNeed(error) : undefined; },
|
|
22
22
|
activate: activation.activate, onState: state => ctx.emit('ai-workbench/enrollment-state', state) });
|
|
23
23
|
ports.enrollment = { read: () => manager.read() };
|
|
24
24
|
api.getEnrollmentState = manager.getState;
|
|
@@ -26,6 +26,7 @@ function attachScopedProfileRuntime(ctx, api, ports, config, network) {
|
|
|
26
26
|
api.importEnrollment = async () => { const result = await manager.importEnrollment(); if (result.ok && result.value.outcome === 'imported')
|
|
27
27
|
await api.refreshLoginPrompts(); return result; };
|
|
28
28
|
ctx.effect(() => () => manager.dispose());
|
|
29
|
+
// 首次连接由真实资料读取器就绪触发;不读取 integration 的未配置占位端口。
|
|
29
30
|
const beforeAppend = api.appendRemoteConversationDetail, beforeRead = api.readConversationLog;
|
|
30
31
|
const log = createConversationLog({ profileDir: profile.dir });
|
|
31
32
|
api.appendRemoteConversationDetail = log.append;
|
|
@@ -86,4 +87,6 @@ function attachScopedProfileRuntime(ctx, api, ports, config, network) {
|
|
|
86
87
|
native.effect(() => { void locations.refreshWorkspaceLocations(); return api.onConnectionState(() => locations.observeConnection()); });
|
|
87
88
|
native.effect(() => () => { api.resolveSessionProject = unavailableHost; delete api.getLocalWorkspaceContext; delete api.getWorkspaceLocationState; delete api.onWorkspaceLocationState; delete api.refreshWorkspaceLocations; delete api.browseWorkspaceHostDirectories; delete api.selectWorkspaceLocation; delete api.getWorkspaceDirectoryPickerSettings; delete api.browseWorkspaceDirectories; delete api.createWorkspaceDirectory; delete api.selectWorkspaceDirectory; host.dispose(); return Promise.all([locations.dispose(), picker?.dispose()]); });
|
|
88
89
|
});
|
|
90
|
+
if (autoStart)
|
|
91
|
+
void api.refreshLoginPrompts();
|
|
89
92
|
}
|
package/lib/provider.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Ports } from './ports.ts';
|
|
2
|
-
import type { ProxyLease } from './login.ts';
|
|
3
2
|
interface NNeed {
|
|
4
3
|
code: string;
|
|
5
4
|
}
|
|
@@ -16,7 +15,6 @@ export interface ActivationSettings {
|
|
|
16
15
|
startupObservationSeconds: number;
|
|
17
16
|
shutdownObservationSeconds: number;
|
|
18
17
|
controlResponseMaxBytes: number;
|
|
19
|
-
downloadMaxRedirects: number;
|
|
20
18
|
}
|
|
21
19
|
export interface ActivationState {
|
|
22
20
|
instanceId: string;
|
|
@@ -55,19 +53,7 @@ export interface NetworkProvider {
|
|
|
55
53
|
onState(listener: (event: {
|
|
56
54
|
kind: 'lost' | 'restored';
|
|
57
55
|
}) => void): () => void;
|
|
58
|
-
openLoginProxy(signal: AbortSignal): Promise<NResult<{
|
|
59
|
-
credentials: {
|
|
60
|
-
url: string;
|
|
61
|
-
username: string;
|
|
62
|
-
password: string;
|
|
63
|
-
};
|
|
64
|
-
release(): Promise<void>;
|
|
65
|
-
}>>;
|
|
66
|
-
download(source: string, signal: AbortSignal): Promise<NResult<Response>>;
|
|
67
56
|
}
|
|
68
57
|
export declare function mapNetworkNeed(value: NNeed): import("./api.ts").ConnectNeed;
|
|
69
|
-
export declare function adaptNetwork(provider: NetworkProvider): NonNullable<Ports['network']
|
|
70
|
-
acquireProxy(signal: AbortSignal): Promise<ProxyLease>;
|
|
71
|
-
download(source: string, signal: AbortSignal): Promise<Response>;
|
|
72
|
-
};
|
|
58
|
+
export declare function adaptNetwork(provider: NetworkProvider): NonNullable<Ports['network']>;
|
|
73
59
|
export {};
|
package/lib/provider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { need } from "./needs.js";
|
|
2
2
|
export function mapNetworkNeed(value) {
|
|
3
|
-
const code = { NEED_ENROLLMENT: 'ENROLLMENT_REQUIRED', ENROLLMENT_REJECTED: 'ENROLLMENT_REJECTED',
|
|
3
|
+
const code = { NEED_ENROLLMENT: 'ENROLLMENT_REQUIRED', ENROLLMENT_REJECTED: 'ENROLLMENT_REJECTED', ENROLLMENT_KEY_REJECTED: 'ENROLLMENT_KEY_REJECTED', LOCAL_STATE_INVALID: 'ENROLLMENT_INVALID', HOST_OFFLINE: 'HOST_OFFLINE', HOST_TRUST_REQUIRED: 'HOST_TRUST_REQUIRED', HOST_KEY_MISMATCH: 'HOST_KEY_MISMATCH', ENROLLMENT_MISMATCH: 'ENROLLMENT_INVALID', CONFIG_INVALID: 'SETTINGS_REQUIRED', SETTINGS_REQUIRED: 'SETTINGS_REQUIRED', SSH_FAILED: 'SSH_FAILED', NETWORK_INTERRUPTED: 'CONNECTION_LOST', CONTROL_UNAVAILABLE: 'CONNECTION_LOST', NETWORK_NOT_READY: 'CONNECTION_LOST', DISPOSED: 'DISPOSED' }[value.code] ?? 'DEPENDENCY_REQUIRED';
|
|
4
4
|
const direct = ['ACTIVATION_CONFLICT', 'ACTIVATION_CANCELLED', 'ENROLLMENT_CLEANUP_UNBOUND', 'ENROLLMENT_CLEANUP_FAILED', 'ENROLLMENT_MISMATCH', 'LOCAL_STATE_INVALID', 'ALREADY_RUNNING', 'ENROLLMENT_RECEIPT_REQUIRED', 'CONTROL_PROTOCOL_INVALID', 'HELPER_HANDOFF_FAILED', 'HELPER_SHUTDOWN_FORCED'];
|
|
5
5
|
const result = need(direct.includes(value.code) ? value.code : code);
|
|
6
6
|
result.officialReason = /^[A-Z][A-Z0-9_]*$/.test(value.code) ? value.code : 'NETWORK_NEED_INVALID';
|
|
@@ -19,21 +19,5 @@ export function adaptNetwork(provider) {
|
|
|
19
19
|
},
|
|
20
20
|
onState(listener) { return provider.onState(event => { if (event.kind === 'lost' || event.kind === 'restored')
|
|
21
21
|
listener({ kind: event.kind }); }); },
|
|
22
|
-
async acquireProxy(signal) {
|
|
23
|
-
const result = await provider.openLoginProxy(signal);
|
|
24
|
-
if (!result.ok)
|
|
25
|
-
throw new NeedError(mapNetworkNeed(result.error));
|
|
26
|
-
const source = result.value, credentials = source.credentials;
|
|
27
|
-
let release;
|
|
28
|
-
return { url: credentials.url, get username() { return credentials.username; }, get password() { return credentials.password; }, release: () => release ??= (async () => { try {
|
|
29
|
-
await source.release();
|
|
30
|
-
}
|
|
31
|
-
finally {
|
|
32
|
-
credentials.username = '';
|
|
33
|
-
credentials.password = '';
|
|
34
|
-
} })() };
|
|
35
|
-
},
|
|
36
|
-
async download(source, signal) { const result = await provider.download(source, signal); if (!result.ok)
|
|
37
|
-
throw new NeedError(mapNetworkNeed(result.error)); return result.value; },
|
|
38
22
|
};
|
|
39
23
|
}
|
package/lib/startup.js
CHANGED
|
@@ -6,19 +6,19 @@ export function employeeMessage(code, connection) {
|
|
|
6
6
|
const message = connectionEmployeeMessage(connection);
|
|
7
7
|
if (message)
|
|
8
8
|
return message;
|
|
9
|
-
if (code === '
|
|
9
|
+
if (code === 'ENROLLMENT_KEY_REJECTED' || code === 'ENROLLMENT_REJECTED')
|
|
10
10
|
return need(code).message;
|
|
11
11
|
if (code === 'DEPENDENCY_REQUIRED')
|
|
12
12
|
return '远程主机连接尚未准备好,请联系管理员。';
|
|
13
13
|
if (code === 'ENROLLMENT_REQUIRED' || code === 'ENROLLMENT_INVALID' || code === 'NETWORK_KEY_INVALID')
|
|
14
14
|
return '我需要连接资料,请联系管理员发放。';
|
|
15
15
|
if (code === 'SETTINGS_REQUIRED')
|
|
16
|
-
return
|
|
16
|
+
return need(code).message;
|
|
17
17
|
if (code === 'LOGIN_FAILED')
|
|
18
18
|
return '登录没有完成。你可以再次请求登录,或稍后再试。';
|
|
19
19
|
if (code === 'POLICY_DENIED')
|
|
20
20
|
return '这个账号暂时不能使用,请联系公司账号管理员。';
|
|
21
|
-
return '
|
|
21
|
+
return '远程主机暂时连不上,请查看技术详情。';
|
|
22
22
|
}
|
|
23
23
|
export function createStartup(api, providers, emit = () => { }, result = () => { }, instanceId = randomUUID()) {
|
|
24
24
|
let disposed = false, revision = 0, serial = 0, generation = 0, checkSerial = 0, connectionPhase = 'unavailable', observedConnected = false, observedUnavailable = false;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { access, lstat, stat, realpath, readdir, mkdir, open, rename, rm } from 'node:fs/promises';
|
|
2
2
|
import { constants, lstatSync, realpathSync } from 'node:fs';
|
|
3
|
-
import { homedir } from 'node:os';
|
|
4
3
|
import { join, dirname, basename, isAbsolute } from 'node:path';
|
|
5
4
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from 'node:crypto';
|
|
6
5
|
import { privateDirectory, readPrivate, readPrivateSync } from "./private-files.js";
|
|
@@ -15,7 +14,6 @@ const decimal = (v) => typeof v === 'string' && /^\d+$/.test(v);
|
|
|
15
14
|
const strict = (v, keys) => Object.keys(v).every(k => keys.includes(k));
|
|
16
15
|
const sameInfo = (a, b) => a.path === b.path && a.requestedPath === b.requestedPath && a.isSymlink === b.isSymlink && a.identity.device === b.identity.device && a.identity.inode === b.identity.inode && a.entryIdentity.device === b.entryIdentity.device && a.entryIdentity.inode === b.entryIdentity.inode && ['read', 'write', 'execute'].every(k => a.permissions[k] === b.permissions[k]);
|
|
17
16
|
const sameSnapshot = (a, b) => sameInfo(a, b) && a.identity.mtimeNs === b.identity.mtimeNs && a.identity.ctimeNs === b.identity.ctimeNs;
|
|
18
|
-
const binaryCompare = (a, b) => Buffer.compare(Buffer.from(a), Buffer.from(b));
|
|
19
17
|
export function createWorkspaceDirectoryPicker(o) {
|
|
20
18
|
const root = join(o.profileDir, 'ai-workbench-connect'), mappingRoot = join(root, 'remote-workspaces'), file = join(root, 'directory-picker-state.json'), secret = randomBytes(32), controllers = new Set();
|
|
21
19
|
let activePath;
|
|
@@ -170,10 +168,12 @@ export function createWorkspaceDirectoryPicker(o) {
|
|
|
170
168
|
reject('WORKSPACE_PICKER_INVALID');
|
|
171
169
|
if (previous)
|
|
172
170
|
check(previous.context);
|
|
171
|
+
if (target === 'local' && r.path === undefined)
|
|
172
|
+
return ok({ target, path: '', parentPath: null, entries: [], selectionToken: '' });
|
|
173
173
|
const trusted = target === 'host' ? await trust(c) : undefined;
|
|
174
174
|
if (previous && (previous.context.instanceId !== c.instanceId || previous.context.epoch !== c.epoch || previous.identity !== trusted?.identity))
|
|
175
175
|
reject('WORKSPACE_LOCATION_CONFLICT');
|
|
176
|
-
let requested = r.path ?? previous?.info.requestedPath ?? (target === '
|
|
176
|
+
let requested = r.path ?? previous?.info.requestedPath ?? (target === 'host' && state.host?.identity === trusted?.identity ? state.host?.path : undefined), notice;
|
|
177
177
|
let info, entries, after = cursor?.kind === 'cursor' ? cursor.after : undefined, nextAfter;
|
|
178
178
|
async function read() {
|
|
179
179
|
if (target === 'host') {
|
|
@@ -181,29 +181,7 @@ export function createWorkspaceDirectoryPicker(o) {
|
|
|
181
181
|
reject('DEPENDENCY_REQUIRED');
|
|
182
182
|
return remote(signal => o.hostDirectories.browse(trusted.target, { ...(requested !== undefined ? { path: requested } : {}), pageSize: o.pageSize, ...(after ? { after, expected: previous.info.identity } : {}) }, signal));
|
|
183
183
|
}
|
|
184
|
-
|
|
185
|
-
if (previous && !sameSnapshot(previous.info, parent))
|
|
186
|
-
reject('HOST_DIRECTORY_CHANGED');
|
|
187
|
-
const names = (await readdir(parent.path, { withFileTypes: true })).filter(e => e.isDirectory() || e.isSymbolicLink()).map(e => e.name).sort(binaryCompare).filter(n => after === undefined || binaryCompare(n, after) > 0), children = [];
|
|
188
|
-
for (const name of names) {
|
|
189
|
-
const requestedPath = join(parent.path, name);
|
|
190
|
-
try {
|
|
191
|
-
const child = await localInfo(requestedPath);
|
|
192
|
-
children.push({ ...child, name });
|
|
193
|
-
}
|
|
194
|
-
catch (e) {
|
|
195
|
-
if (!(e instanceof NeedError) || !['HOST_DIRECTORY_INVALID', 'HOST_DIRECTORY_UNREADABLE'].includes(e.need.code))
|
|
196
|
-
throw e;
|
|
197
|
-
const entry = await lstat(requestedPath, { bigint: true });
|
|
198
|
-
children.push({ name, requestedPath, entryIdentity: { device: String(entry.dev), inode: String(entry.ino) }, isSymlink: entry.isSymbolicLink(), permissions: { read: false, write: null, execute: false, reason: 'HOST_PERMISSION_UNKNOWN' }, errorCode: e.need.code });
|
|
199
|
-
}
|
|
200
|
-
if (children.length === o.pageSize)
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
const final = await localInfo(parent.requestedPath);
|
|
204
|
-
if (!sameSnapshot(parent, final))
|
|
205
|
-
reject('HOST_DIRECTORY_CHANGED');
|
|
206
|
-
return { ...parent, entries: children, ...(names.length > children.length ? { nextAfter: children.at(-1).name } : {}) };
|
|
184
|
+
return { ...await localInfo(requested), entries: [] };
|
|
207
185
|
}
|
|
208
186
|
let page;
|
|
209
187
|
try {
|
|
@@ -213,7 +191,7 @@ export function createWorkspaceDirectoryPicker(o) {
|
|
|
213
191
|
if (r.path !== undefined || r.cursor !== undefined || requested === undefined || !(e instanceof NeedError) || !['HOST_DIRECTORY_INVALID', 'HOST_DIRECTORY_UNREADABLE'].includes(e.need.code))
|
|
214
192
|
throw e;
|
|
215
193
|
requested = undefined;
|
|
216
|
-
notice =
|
|
194
|
+
notice = '上次选择的远程目录已失效或不可读,已返回远程用户根目录。';
|
|
217
195
|
page = await read();
|
|
218
196
|
}
|
|
219
197
|
const { entries: rawEntries, nextAfter: more, ...directory } = page;
|
|
@@ -234,6 +234,15 @@ export function createWorkspaceLocations(o) {
|
|
|
234
234
|
const base = { workspaceId: w.id, workspaceName: w.title || w.id, localPath: n.localPath, bindingId: r?.bindingId ?? null };
|
|
235
235
|
if (r) {
|
|
236
236
|
let valid = sameNative(r, n), error;
|
|
237
|
+
// 来源来自本插件的原生路径绑定,离线仍可显示;不改目录或员工自取名称。
|
|
238
|
+
if (valid && w.setTitle) {
|
|
239
|
+
const title = w.title.replace(/(本机)$|(远程主机)$/u, '') + (r.source === 'local' ? '(本机)' : '(远程主机)');
|
|
240
|
+
if (title !== w.title) {
|
|
241
|
+
await w.setTitle(title);
|
|
242
|
+
check(c);
|
|
243
|
+
}
|
|
244
|
+
base.workspaceName = title;
|
|
245
|
+
}
|
|
237
246
|
if (valid && r.source !== 'local') {
|
|
238
247
|
try {
|
|
239
248
|
valid = (await target(c)).identity === r.identity;
|
package/package.json
CHANGED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## [2.0.1] - 2020-08-29
|
|
10
|
-
### Fixed
|
|
11
|
-
- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [2.0.0] - 2020-08-14
|
|
15
|
-
### Changed
|
|
16
|
-
- Full rewrite. Now port from python 3.9.0 & more precise following.
|
|
17
|
-
See [doc](./doc) for difference and migration info.
|
|
18
|
-
- node.js 10+ required
|
|
19
|
-
- Removed most of local docs in favour of original ones.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [1.0.10] - 2018-02-15
|
|
23
|
-
### Fixed
|
|
24
|
-
- Use .concat instead of + for arrays, #122.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## [1.0.9] - 2016-09-29
|
|
28
|
-
### Changed
|
|
29
|
-
- Rerelease after 1.0.8 - deps cleanup.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## [1.0.8] - 2016-09-29
|
|
33
|
-
### Changed
|
|
34
|
-
- Maintenance (deps bump, fix node 6.5+ tests, coverage report).
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## [1.0.7] - 2016-03-17
|
|
38
|
-
### Changed
|
|
39
|
-
- Teach `addArgument` to accept string arg names. #97, @tomxtobin.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## [1.0.6] - 2016-02-06
|
|
43
|
-
### Changed
|
|
44
|
-
- Maintenance: moved to eslint & updated CS.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## [1.0.5] - 2016-02-05
|
|
48
|
-
### Changed
|
|
49
|
-
- Removed lodash dependency to significantly reduce install size.
|
|
50
|
-
Thanks to @mourner.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## [1.0.4] - 2016-01-17
|
|
54
|
-
### Changed
|
|
55
|
-
- Maintenance: lodash update to 4.0.0.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
## [1.0.3] - 2015-10-27
|
|
59
|
-
### Fixed
|
|
60
|
-
- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
## [1.0.2] - 2015-03-22
|
|
64
|
-
### Changed
|
|
65
|
-
- Relaxed lodash version dependency.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## [1.0.1] - 2015-02-20
|
|
69
|
-
### Changed
|
|
70
|
-
- Changed dependencies to be compatible with ancient nodejs.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## [1.0.0] - 2015-02-19
|
|
74
|
-
### Changed
|
|
75
|
-
- Maintenance release.
|
|
76
|
-
- Replaced `underscore` with `lodash`.
|
|
77
|
-
- Bumped version to 1.0.0 to better reflect semver meaning.
|
|
78
|
-
- HISTORY.md -> CHANGELOG.md
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## [0.1.16] - 2013-12-01
|
|
82
|
-
### Changed
|
|
83
|
-
- Maintenance release. Updated dependencies and docs.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
## [0.1.15] - 2013-05-13
|
|
87
|
-
### Fixed
|
|
88
|
-
- Fixed #55, @trebor89
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
## [0.1.14] - 2013-05-12
|
|
92
|
-
### Fixed
|
|
93
|
-
- Fixed #62, @maxtaco
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## [0.1.13] - 2013-04-08
|
|
97
|
-
### Changed
|
|
98
|
-
- Added `.npmignore` to reduce package size
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
## [0.1.12] - 2013-02-10
|
|
102
|
-
### Fixed
|
|
103
|
-
- Fixed conflictHandler (#46), @hpaulj
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
## [0.1.11] - 2013-02-07
|
|
107
|
-
### Added
|
|
108
|
-
- Added 70+ tests (ported from python), @hpaulj
|
|
109
|
-
- Added conflictHandler, @applepicke
|
|
110
|
-
- Added fromfilePrefixChar, @hpaulj
|
|
111
|
-
|
|
112
|
-
### Fixed
|
|
113
|
-
- Multiple bugfixes, @hpaulj
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
## [0.1.10] - 2012-12-30
|
|
117
|
-
### Added
|
|
118
|
-
- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion)
|
|
119
|
-
support, thanks to @hpaulj
|
|
120
|
-
|
|
121
|
-
### Fixed
|
|
122
|
-
- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
## [0.1.9] - 2012-12-27
|
|
126
|
-
### Fixed
|
|
127
|
-
- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj
|
|
128
|
-
- Fixed default value behavior with `*` positionals, thanks to @hpaulj
|
|
129
|
-
- Improve `getDefault()` behavior, thanks to @hpaulj
|
|
130
|
-
- Improve negative argument parsing, thanks to @hpaulj
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
## [0.1.8] - 2012-12-01
|
|
134
|
-
### Fixed
|
|
135
|
-
- Fixed parser parents (issue #19), thanks to @hpaulj
|
|
136
|
-
- Fixed negative argument parse (issue #20), thanks to @hpaulj
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
## [0.1.7] - 2012-10-14
|
|
140
|
-
### Fixed
|
|
141
|
-
- Fixed 'choices' argument parse (issue #16)
|
|
142
|
-
- Fixed stderr output (issue #15)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
## [0.1.6] - 2012-09-09
|
|
146
|
-
### Fixed
|
|
147
|
-
- Fixed check for conflict of options (thanks to @tomxtobin)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
## [0.1.5] - 2012-09-03
|
|
151
|
-
### Fixed
|
|
152
|
-
- Fix parser #setDefaults method (thanks to @tomxtobin)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
## [0.1.4] - 2012-07-30
|
|
156
|
-
### Fixed
|
|
157
|
-
- Fixed pseudo-argument support (thanks to @CGamesPlay)
|
|
158
|
-
- Fixed addHelp default (should be true), if not set (thanks to @benblank)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
## [0.1.3] - 2012-06-27
|
|
162
|
-
### Fixed
|
|
163
|
-
- Fixed formatter api name: Formatter -> HelpFormatter
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
## [0.1.2] - 2012-05-29
|
|
167
|
-
### Fixed
|
|
168
|
-
- Removed excess whitespace in help
|
|
169
|
-
- Fixed error reporting, when parcer with subcommands
|
|
170
|
-
called with empty arguments
|
|
171
|
-
|
|
172
|
-
### Added
|
|
173
|
-
- Added basic tests
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
## [0.1.1] - 2012-05-23
|
|
177
|
-
### Fixed
|
|
178
|
-
- Fixed line wrapping in help formatter
|
|
179
|
-
- Added better error reporting on invalid arguments
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
## [0.1.0] - 2012-05-16
|
|
183
|
-
### Added
|
|
184
|
-
- First release.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1
|
|
188
|
-
[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0
|
|
189
|
-
[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10
|
|
190
|
-
[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9
|
|
191
|
-
[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8
|
|
192
|
-
[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7
|
|
193
|
-
[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6
|
|
194
|
-
[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5
|
|
195
|
-
[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4
|
|
196
|
-
[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3
|
|
197
|
-
[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2
|
|
198
|
-
[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1
|
|
199
|
-
[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0
|
|
200
|
-
[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16
|
|
201
|
-
[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15
|
|
202
|
-
[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14
|
|
203
|
-
[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13
|
|
204
|
-
[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12
|
|
205
|
-
[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11
|
|
206
|
-
[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10
|
|
207
|
-
[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9
|
|
208
|
-
[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8
|
|
209
|
-
[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7
|
|
210
|
-
[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6
|
|
211
|
-
[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5
|
|
212
|
-
[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4
|
|
213
|
-
[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3
|
|
214
|
-
[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2
|
|
215
|
-
[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1
|
|
216
|
-
[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0
|